1
0
mirror of https://github.com/DanilaFe/abacus synced 2024-06-26 04:36:24 -07:00

Remove output.

This commit is contained in:
Danila Fedorin 2017-08-07 10:39:50 -07:00
parent 314552f95a
commit 1cd332b97d
2 changed files with 18 additions and 7 deletions

View File

@ -12,13 +12,25 @@ import javafx.stage.Stage;
*/ */
public class AbacusApplication extends Application { public class AbacusApplication extends Application {
/**
* The controller currently managing the application.
*/
private AbacusController controller;
@Override @Override
public void start(Stage primaryStage) throws Exception { public void start(Stage primaryStage) throws Exception {
Parent parent = FXMLLoader.load(getClass().getResource("/abacus.fxml")); FXMLLoader loader = new FXMLLoader(getClass().getResource("/abacus.fxml"));
Parent parent = loader.load();
controller = loader.getController();
Scene mainScene = new Scene(parent, 320, 480); Scene mainScene = new Scene(parent, 320, 480);
primaryStage.setScene(mainScene); primaryStage.setScene(mainScene);
primaryStage.setTitle("Abacus"); primaryStage.setTitle("Abacus");
primaryStage.show(); primaryStage.show();
} }
@Override
public void stop() throws Exception {
super.stop();
controller.performStop();
}
} }

View File

@ -259,7 +259,7 @@ public class AbacusController implements PluginListener {
} }
@FXML @FXML
private void performCalculation() { public void performCalculation() {
inputButton.setDisable(true); inputButton.setDisable(true);
stopButton.setDisable(false); stopButton.setDisable(false);
calculationThread = new Thread(CALCULATION_RUNNABLE); calculationThread = new Thread(CALCULATION_RUNNABLE);
@ -269,7 +269,7 @@ public class AbacusController implements PluginListener {
} }
@FXML @FXML
private void performStop(){ public void performStop(){
if(calculationThread != null) { if(calculationThread != null) {
calculationThread.interrupt(); calculationThread.interrupt();
calculationThread = null; calculationThread = null;
@ -281,7 +281,7 @@ public class AbacusController implements PluginListener {
} }
@FXML @FXML
private void performSaveAndReload() { public void performSaveAndReload() {
performSave(); performSave();
performReload(); performReload();
changesMade = false; changesMade = false;
@ -289,13 +289,13 @@ public class AbacusController implements PluginListener {
} }
@FXML @FXML
private void performReload() { public void performReload() {
alertIfApplyNeeded(true); alertIfApplyNeeded(true);
abacus.getPluginManager().reload(); abacus.getPluginManager().reload();
} }
@FXML @FXML
private void performSave() { public void performSave() {
Configuration configuration = abacus.getConfiguration(); Configuration configuration = abacus.getConfiguration();
configuration.setNumberImplementation(numberImplementationBox.getSelectionModel().getSelectedItem()); configuration.setNumberImplementation(numberImplementationBox.getSelectionModel().getSelectedItem());
Set<String> disabledPlugins = configuration.getDisabledPlugins(); Set<String> disabledPlugins = configuration.getDisabledPlugins();
@ -305,7 +305,6 @@ public class AbacusController implements PluginListener {
} }
if(computationLimitField.getText().matches("\\d*(\\.\\d+)?") && computationLimitField.getText().length() != 0) if(computationLimitField.getText().matches("\\d*(\\.\\d+)?") && computationLimitField.getText().length() != 0)
configuration.setComputationDelay(Double.parseDouble(computationLimitField.getText())); configuration.setComputationDelay(Double.parseDouble(computationLimitField.getText()));
System.out.println(configuration.getComputationDelay());
configuration.saveTo(CONFIG_FILE); configuration.saveTo(CONFIG_FILE);
changesMade = false; changesMade = false;
reloadAlertShown = false; reloadAlertShown = false;