Commit 8fefd96b authored by Joachim Müssig's avatar Joachim Müssig

clear up code, javadoc

parent 505ee23e
package keyjoana.settings;
import java.util.Properties;
/**
*
* @author joachim
*
*/
public interface PropertySaver {
void load(Properties p);
void save(Properties p);
public void getProperties();
}
......@@ -99,7 +99,6 @@ public class AddSourceDialogController implements Initializable {
stage.showAndWait();
String selectMethodStr = selectMethodCB.getSelectionModel().getSelectedItem();
String selectionStr = selectionCB.getSelectionModel().getSelectedItem();
System.out.println(selectionStr); //TODO muessig remove
if (selectionStr != null && selectMethodStr.equals(PROGRAM_PART)) {
return Optional.of(SinkOrSource.createProgramPart(selectionStr,
CombinedApproach.HIGH_SECURITY));
......
......@@ -48,8 +48,8 @@ import specgui.joanahandler.Helper;
import specgui.joanahandler.JoanaInstance;
/**
*
* @author holgerklein
* user interface controller for the spec gui
* @author holgerklein, joachim
*/
public class FXMLDocumentController implements Initializable {
......@@ -133,6 +133,9 @@ public class FXMLDocumentController implements Initializable {
}
}
/**
* is called when pressing 'Add' at the Sinks
*/
@FXML
public void onAddSink() {
SinkOrSource sink = sourceSinkAdderDialogHandler.letUserAddSink(stage);
......@@ -142,6 +145,9 @@ public class FXMLDocumentController implements Initializable {
}
}
/**
* is called when pressing 'remove' button at the sinks
*/
@FXML
public void onRemoveSink() {
final int selected = sinkList.getSelectionModel().getSelectedIndex();
......@@ -159,9 +165,7 @@ public class FXMLDocumentController implements Initializable {
//TODO refactor code. Use and generate helper classes
@FXML
public void createJoak() throws FileNotFoundException, IOException { // TODO: maybe replace the template with
// functions from JsonHelper (add
// JsonStringToStringBuilder)
public void createJoak() throws FileNotFoundException, IOException {
FileChooser fileChooser = new FileChooser();
fileChooser.setTitle("Select storage location.");
......@@ -199,13 +203,9 @@ public class FXMLDocumentController implements Initializable {
}
private void tryCreateJoanaAsync() {
//TODO: call this method from Controller . Maybe place this thread in controller class to handle the gui stuff there.
if (joanaView.checkCreateJoanaConditions()) {
disableMainGUIElements(true, true, true, true);
enableProgressIndicator(true);
// buttonCompile.setDisable(true);
// mainClassesCB.setDisable(true);
// srcSinkAP.setDisable(true);
setStatusMessage("Generate Joana Instance and SDG files ...");
setStatusMessageColor(javafx.scene.paint.Color.BLUE);
asyncJoanaInstanceThread = new Thread(() -> {
......@@ -214,8 +214,6 @@ public class FXMLDocumentController implements Initializable {
Platform.runLater(() -> {
enableProgressIndicator(false);
disableMainGUIElements(false, false, false, false);
// buttonCompile.setDisable(false);
// mainClassesCB.setDisable(false);
setStatusMessage("Success. Now choose Sinks and Sources to generate a *.Joak file.");
setStatusMessageColor(javafx.scene.paint.Color.GREEN);
......@@ -257,6 +255,9 @@ public class FXMLDocumentController implements Initializable {
joanaView.setPreProcessing(preProcessCheckBox.isSelected());
}
/**
* initialize spec gui
*/
@Override
public void initialize(URL url, ResourceBundle rb) {
setStatusMessage("");
......@@ -312,7 +313,6 @@ public class FXMLDocumentController implements Initializable {
}
void letUserChooseMainClass(List<String> allClassesContainingMainMethod) {
mainClassesCB.getItems().clear();
mainClassesCB.getItems().addAll(allClassesContainingMainMethod);
mainClassesCB.setDisable(false);
......@@ -350,6 +350,10 @@ public class FXMLDocumentController implements Initializable {
}
/**
* eneable the progress indicator on the user interface
* @param enable
*/
public void enableProgressIndicator(boolean enable) {
this.progressIndicator.setVisible(enable);
}
......@@ -400,7 +404,6 @@ public class FXMLDocumentController implements Initializable {
}
}
//TODO use this method everywhere you can to reduce errors and code duplication
private void disableMainGUIElements(boolean menuBar, boolean srcSinkPane, boolean buttonRecompile
, boolean cbMainClass) {
menuBarMain.setDisable(menuBar);
......
......@@ -26,8 +26,6 @@ public class JoanaKeYGui extends Application {
Parent root = fXMLLoader.load();
FXMLDocumentController controller = (FXMLDocumentController) fXMLLoader.getController();
controller.setStage(stage);
Scene scene = new Scene(root);
stage.setTitle("Combined Approach KeYJoana: Specification Panel ");
stage.setScene(scene);
......
......@@ -29,10 +29,9 @@ import joanakey.slicing.SourceCodeSlicer;
import specgui.helper.JarCreator;
import specgui.joanahandler.JoanaInstance;
/**
*
* @author holgerklein
* @author holgerklein, joachim
*/
public class JoanaView {
......@@ -44,11 +43,10 @@ public class JoanaView {
private String currentMainClass;
private FXMLDocumentController controller;
private JoanaInstance joanaInstance;
private boolean preProcessing;// = true;
private boolean preProcessing;
public JoanaView(FXMLDocumentController controller) {
this.controller = controller;
// this.preProcessing = controller.isPreProcessingSelected();
}
public void setCurrentJarFile(File jarFile) {
......@@ -56,9 +54,6 @@ public class JoanaView {
return;
}
this.currentJarFile = jarFile;
//boolean correctJarFile =
// boolean correctJar = checkIfCorrectJarFile();
//handle result
}
public void setPreProcessing(boolean selected) {
......@@ -115,14 +110,6 @@ public class JoanaView {
} catch (IOException e) {
e.printStackTrace();
}
// controller.letUserChooseMainClass(
// Helper.getAllClassesContainingMainMethod(this.currentJavaFolderFile)
// );
//TODO encapsulate the create Joana call ! bad smell because the method name does not indicate this call !
// tryCreateJoanaAsync();
// tryCreateJoana();
}
public void setCurrentSDGFile(String sdgFile) {
......@@ -145,10 +132,6 @@ public class JoanaView {
public void setCurrentMainClass(String currentMainClass) {
this.currentMainClass = currentMainClass;
//TODO encapsulate the create Joana call ! bad smell because the method name does not indicate this call !
// tryCreateJoanaAsync();
// tryCreateJoana();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment