Aufgabe 4 Designanpassung.
This commit is contained in:
parent
242d035756
commit
41c6789c64
|
@ -52,6 +52,8 @@ public class Main extends Application {
|
|||
Scene mainWindowScene = new Scene(rootNode);
|
||||
|
||||
primaryStage.setScene(mainWindowScene);
|
||||
primaryStage.setMinWidth(400);
|
||||
primaryStage.setMinHeight(320);
|
||||
primaryStage.show();
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -52,11 +52,17 @@ public class MainWindowController {
|
|||
@FXML
|
||||
void calculate(ActionEvent event) {
|
||||
valueHandlerDecorator.checkValuesAndCalculateResult(initialAmount.getText(), returnInPercent.getText(), annualCost.getText(), numberOfYears.getText());
|
||||
if(valueHandler.areValuesOk()){
|
||||
results.setBorder(new Border(new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(2))));
|
||||
}else {
|
||||
results.setBorder(new Border(new BorderStroke(Color.RED, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(2))));
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
void clearResults(ActionEvent event) {
|
||||
valueHandlerDecorator.clearResult();
|
||||
results.setBorder(null);
|
||||
}
|
||||
|
||||
|
||||
|
@ -109,6 +115,7 @@ public class MainWindowController {
|
|||
@FXML
|
||||
void showHelp(ActionEvent event) {
|
||||
valueHandlerDecorator.showHelp(helpText);
|
||||
results.setBorder(new Border(new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(2))));
|
||||
}
|
||||
|
||||
public void setValueHandler(ValueHandler valueHandler){
|
||||
|
@ -118,11 +125,6 @@ public class MainWindowController {
|
|||
@Override
|
||||
public void update() {
|
||||
results.setText(valueHandler.getResultBound());
|
||||
if(valueHandler.areValuesOk()){
|
||||
results.setBorder(new Border(new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1))));
|
||||
}else {
|
||||
results.setBorder(new Border(new BorderStroke(Color.RED, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1))));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -32,11 +32,6 @@ public class ResultWindowController {
|
|||
@Override
|
||||
public void update() {
|
||||
results.setText(valueHandler.getResultBound());
|
||||
if(valueHandler.areValuesOk()){
|
||||
results.setBorder(new Border(new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1))));
|
||||
}else {
|
||||
results.setBorder(new Border(new BorderStroke(Color.RED, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1))));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue