-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DEV refs #31 : Moving of Strategy button, add (Treat|EstablishedEffec…
…t)View
- Loading branch information
Nathaël NOGUÈS
committed
Jul 26, 2016
1 parent
1197646
commit 360eec3
Showing
23 changed files
with
289 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package fr.axonic.avek.gui; | ||
|
||
import fr.axonic.avek.gui.util.ConcurrentTaskManager; | ||
import fr.axonic.avek.gui.util.Util; | ||
import fr.axonic.avek.gui.view.GeneralizedView; | ||
import fr.axonic.avek.gui.view.MainFrame; | ||
import javafx.application.Application; | ||
import javafx.scene.Scene; | ||
import javafx.stage.Stage; | ||
import org.apache.log4j.Logger; | ||
|
||
import java.io.IOException; | ||
|
||
public class Main extends Application { | ||
private final static Logger logger = Logger.getLogger(Main.class); | ||
|
||
public static void main(String[] args) { | ||
launch(args); | ||
} | ||
|
||
@Override | ||
public void start(Stage primaryStage) throws IOException { | ||
ConcurrentTaskManager ctm = new ConcurrentTaskManager(); | ||
|
||
logger.debug("Loading MainFrame..."); | ||
|
||
primaryStage.setTitle("#AVEK analyzer"); | ||
|
||
MainFrame mainFrame = new MainFrame(); | ||
Scene s = new Scene(mainFrame, 800, 600); | ||
primaryStage.setScene(s); | ||
|
||
primaryStage.show(); | ||
logger.debug("MainFrame created."); | ||
|
||
|
||
ctm.runLaterOnThread(() -> { | ||
try { | ||
GeneralizedView generalizedView = new GeneralizedView(); | ||
Thread.sleep(2000); | ||
ctm.runLaterOnPlatform(() -> mainFrame.setView(generalizedView)); | ||
Thread.sleep(2000); | ||
ctm.runLaterOnPlatform(() -> generalizedView.setMonitoredSystem(Util.getFileContent("files/subjectFile.json"))); | ||
Thread.sleep(2000); | ||
ctm.runLaterOnPlatform(() -> generalizedView.setExperimentParameters(Util.getFileContent("files/parametersFile.json"))); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
}); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
avek-gui/src/main/java/fr/axonic/avek/gui/view/EstablishEffectView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
package fr.axonic.avek.gui.view; | ||
|
||
import fr.axonic.avek.gui.components.MonitoredSystemPane; | ||
import fr.axonic.avek.gui.components.parameters.ParametersPane; | ||
import fr.axonic.avek.gui.components.results.JellyBeansSelector; | ||
import fr.axonic.avek.gui.model.json.Jsonifier; | ||
import fr.axonic.avek.model.MonitoredSystem; | ||
import fr.axonic.avek.model.base.engine.AEntity; | ||
import fr.axonic.avek.model.base.engine.AList; | ||
import javafx.event.ActionEvent; | ||
import javafx.fxml.FXML; | ||
import javafx.fxml.FXMLLoader; | ||
import javafx.scene.control.Button; | ||
import org.apache.log4j.Logger; | ||
|
||
import java.io.IOException; | ||
import java.net.URL; | ||
|
||
public class EstablishEffectView extends AbstractView { | ||
private final static Logger logger = Logger.getLogger(EstablishEffectView.class); | ||
private final static URL FXML | ||
= EstablishEffectView.class.getClassLoader().getResource("fxml/views/GeneralizedView.fxml"); | ||
|
||
@FXML | ||
private Button btnStrategy; | ||
@FXML | ||
private ParametersPane paneParameters; | ||
@FXML | ||
private MonitoredSystemPane monitoredSystemPane; | ||
@FXML | ||
private JellyBeansSelector jellyBeansSelector; | ||
|
||
// Should be public | ||
public EstablishEffectView() { | ||
FXMLLoader fxmlLoader = new FXMLLoader(FXML); | ||
fxmlLoader.setController(this); | ||
fxmlLoader.setRoot(this); | ||
|
||
logger.info("Loading EstablishEffectView... (fxml)"); | ||
try { | ||
fxmlLoader.load(); | ||
logger.debug("EstablishEffectView loaded."); | ||
} catch (IOException e) { | ||
logger.fatal("Impossible to load FXML for EstablishEffectView", e); | ||
} | ||
} | ||
|
||
@FXML | ||
void onClicStrategyButton(ActionEvent event) { | ||
btnStrategy.setDisable(true); | ||
} | ||
|
||
/** Fill experiment monitoredSystemPane informations | ||
* | ||
* @param monitoredSystemJson the MonitoredSystem as a Json String | ||
*/ | ||
void setMonitoredSystem(String monitoredSystemJson) { | ||
monitoredSystemPane.setMonitoredSystem(MonitoredSystem.fromJson(monitoredSystemJson)); | ||
} | ||
|
||
void setExperimentParameters(String experimentParametersJson) { | ||
AList<AEntity> list = Jsonifier.toAListofAListAndAVar(experimentParametersJson); | ||
|
||
for (AEntity ae : list.getEntities()) | ||
paneParameters.addExpParameter(ae); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.