-
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 #11 : Getting data from a <<bus>> (actually class who get js…
…on by a static way); Improving tests; JellyBeans can be readOnly
- Loading branch information
Nathaël NOGUÈS
committed
Jul 28, 2016
1 parent
8e3b069
commit 84296b5
Showing
31 changed files
with
508 additions
and
349 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
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
40 changes: 40 additions & 0 deletions
40
avek-gui/src/main/java/fr/axonic/avek/gui/components/jellyBeans/JellyBeanPane.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,40 @@ | ||
package fr.axonic.avek.gui.components.jellyBeans; | ||
|
||
import fr.axonic.avek.gui.model.structure.ExperimentResult; | ||
import javafx.scene.Node; | ||
import javafx.scene.layout.FlowPane; | ||
|
||
import java.util.function.Consumer; | ||
|
||
/** | ||
* Created by Nathaël N on 28/07/16. | ||
*/ | ||
public class JellyBeanPane extends FlowPane { | ||
|
||
private Consumer<String> onRemoveJellyBean; | ||
|
||
public void addJellyBean(ExperimentResult choice) { | ||
JellyBean jb2 = new JellyBean(); | ||
jb2.setStateType(choice.getStateClass()); | ||
jb2.setText(choice.getName()); | ||
|
||
if(onRemoveJellyBean != null) | ||
jb2.setOnDelete(this::removeJellyBean); | ||
|
||
getChildren().add(jb2); | ||
} | ||
|
||
private void removeJellyBean(JellyBean jbc) { | ||
getChildren().remove(jbc); | ||
if(onRemoveJellyBean != null) | ||
onRemoveJellyBean.accept(jbc.getText()); | ||
} | ||
void onRemoveJellyBean(Consumer<String> function) { | ||
this.onRemoveJellyBean = function; | ||
|
||
for(Node n : getChildren()) { | ||
JellyBean jb = (JellyBean)n; | ||
jb.setOnDelete(function==null?null:this::removeJellyBean); | ||
} | ||
} | ||
} |
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
36 changes: 36 additions & 0 deletions
36
avek-gui/src/main/java/fr/axonic/avek/gui/model/DataBus.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,36 @@ | ||
package fr.axonic.avek.gui.model; | ||
|
||
import fr.axonic.avek.gui.model.json.Jsonifier; | ||
import fr.axonic.avek.gui.model.structure.ExperimentResultsMap; | ||
import fr.axonic.avek.gui.util.Util; | ||
import fr.axonic.avek.model.MonitoredSystem; | ||
import fr.axonic.avek.model.base.engine.AEntity; | ||
import fr.axonic.avek.model.base.engine.AList; | ||
|
||
/** | ||
* Created by Nathaël N on 28/07/16. | ||
*/ | ||
public class DataBus { | ||
|
||
public static MonitoredSystem getMonitoredSystem() { | ||
String monitoredSystemJson = Util.getFileContent("files/subjectFile.json"); | ||
return MonitoredSystem.fromJson(monitoredSystemJson); | ||
} | ||
|
||
public static AList<AEntity> getExperimentParameters() { | ||
String experimentParametersJson = Util.getFileContent("files/parametersFile.json"); | ||
AList<AEntity> list = Jsonifier.toAListofAListAndAVar(experimentParametersJson); | ||
|
||
return list; | ||
} | ||
|
||
public static ExperimentResultsMap getExperimentResults() { | ||
String experimentResultsJson = Util.getFileContent("files/resultEnum1.json"); | ||
|
||
ExperimentResultsMap expResMap = | ||
new Jsonifier<>(ExperimentResultsMap.class) | ||
.fromJson(experimentResultsJson); | ||
|
||
return expResMap; | ||
} | ||
} |
Oops, something went wrong.