mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-08 18:30:42 +00:00
put disabling logic into refreshElements()
This commit is contained in:
parent
7271c22029
commit
0cda05d847
@ -87,6 +87,19 @@ public class TypeInferenceView extends VerticalLayout
|
|||||||
private void refreshElements() {
|
private void refreshElements() {
|
||||||
unification.showStep(currentStep);
|
unification.showStep(currentStep);
|
||||||
tree.showStep(treeNumbers.get(currentStep));
|
tree.showStep(treeNumbers.get(currentStep));
|
||||||
|
|
||||||
|
if (currentStep == 0) {
|
||||||
|
controlPanel.setEnabledFirstStep(false);
|
||||||
|
controlPanel.setEnabledPreviousStep(false);
|
||||||
|
} else if (currentStep == unification.getStepCount() - 1) {
|
||||||
|
controlPanel.setEnabledNextStep(false);
|
||||||
|
controlPanel.setEnabledLastStep(false);
|
||||||
|
} else {
|
||||||
|
controlPanel.setEnabledNextStep(true);
|
||||||
|
controlPanel.setEnabledLastStep(true);
|
||||||
|
controlPanel.setEnabledFirstStep(true);
|
||||||
|
controlPanel.setEnabledPreviousStep(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -94,12 +107,6 @@ public class TypeInferenceView extends VerticalLayout
|
|||||||
int treeEnd = treeNumbers.indexOf(tree.getStepCount() - 1);
|
int treeEnd = treeNumbers.indexOf(tree.getStepCount() - 1);
|
||||||
currentStep = currentStep > treeEnd && tree.getStepCount() > 0 ? treeEnd : 0;
|
currentStep = currentStep > treeEnd && tree.getStepCount() > 0 ? treeEnd : 0;
|
||||||
refreshElements();
|
refreshElements();
|
||||||
if (currentStep == 0) {
|
|
||||||
controlPanel.setEnabledFirstStep(false);
|
|
||||||
controlPanel.setEnabledPreviousStep(false);
|
|
||||||
}
|
|
||||||
controlPanel.setEnabledNextStep(true);
|
|
||||||
controlPanel.setEnabledLastStep(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -107,12 +114,6 @@ public class TypeInferenceView extends VerticalLayout
|
|||||||
int treeEnd = treeNumbers.indexOf(tree.getStepCount() - 1);
|
int treeEnd = treeNumbers.indexOf(tree.getStepCount() - 1);
|
||||||
currentStep = currentStep < treeEnd ? treeEnd : unification.getStepCount() - 1;
|
currentStep = currentStep < treeEnd ? treeEnd : unification.getStepCount() - 1;
|
||||||
refreshElements();
|
refreshElements();
|
||||||
if (currentStep == unification.getStepCount() - 1) {
|
|
||||||
controlPanel.setEnabledNextStep(false);
|
|
||||||
controlPanel.setEnabledLastStep(false);
|
|
||||||
}
|
|
||||||
controlPanel.setEnabledFirstStep(true);
|
|
||||||
controlPanel.setEnabledPreviousStep(true);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,24 +121,12 @@ public class TypeInferenceView extends VerticalLayout
|
|||||||
public void nextStepButton() {
|
public void nextStepButton() {
|
||||||
currentStep = currentStep < unification.getStepCount() - 1 ? currentStep + 1 : currentStep;
|
currentStep = currentStep < unification.getStepCount() - 1 ? currentStep + 1 : currentStep;
|
||||||
refreshElements();
|
refreshElements();
|
||||||
if (currentStep == unification.getStepCount() - 1) {
|
|
||||||
controlPanel.setEnabledNextStep(false);
|
|
||||||
controlPanel.setEnabledLastStep(false);
|
|
||||||
}
|
|
||||||
controlPanel.setEnabledFirstStep(true);
|
|
||||||
controlPanel.setEnabledPreviousStep(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void previousStepButton() {
|
public void previousStepButton() {
|
||||||
currentStep = currentStep > 0 ? currentStep - 1 : currentStep;
|
currentStep = currentStep > 0 ? currentStep - 1 : currentStep;
|
||||||
refreshElements();
|
refreshElements();
|
||||||
if (currentStep == 0) {
|
|
||||||
controlPanel.setEnabledFirstStep(false);
|
|
||||||
controlPanel.setEnabledPreviousStep(false);
|
|
||||||
}
|
|
||||||
controlPanel.setEnabledNextStep(true);
|
|
||||||
controlPanel.setEnabledLastStep(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user