Commit dab92105 authored by Valérie Maquil's avatar Valérie Maquil
Browse files

adaptations based on discussions with Patrick

parents 6ee56dd1 61df7ec3
Scenarios/assets/task0.png

39.4 KB | W: | H:

Scenarios/assets/task0.png

57.1 KB | W: | H:

Scenarios/assets/task0.png
Scenarios/assets/task0.png
Scenarios/assets/task0.png
Scenarios/assets/task0.png
  • 2-up
  • Swipe
  • Onion skin
Scenarios/assets/task1.png

23.5 KB | W: | H:

Scenarios/assets/task1.png

22.4 KB | W: | H:

Scenarios/assets/task1.png
Scenarios/assets/task1.png
Scenarios/assets/task1.png
Scenarios/assets/task1.png
  • 2-up
  • Swipe
  • Onion skin
Scenarios/assets/task2.png

18.8 KB | W: | H:

Scenarios/assets/task2.png

19 KB | W: | H:

Scenarios/assets/task2.png
Scenarios/assets/task2.png
Scenarios/assets/task2.png
Scenarios/assets/task2.png
  • 2-up
  • Swipe
  • Onion skin
Scenarios/assets/task3.png

26.3 KB | W: | H:

Scenarios/assets/task3.png

29.5 KB | W: | H:

Scenarios/assets/task3.png
Scenarios/assets/task3.png
Scenarios/assets/task3.png
Scenarios/assets/task3.png
  • 2-up
  • Swipe
  • Onion skin
Scenarios/assets/task4.png

27.2 KB | W: | H:

Scenarios/assets/task4.png

27.9 KB | W: | H:

Scenarios/assets/task4.png
Scenarios/assets/task4.png
Scenarios/assets/task4.png
Scenarios/assets/task4.png
  • 2-up
  • Swipe
  • Onion skin
Scenarios/assets/task5.png

36.4 KB | W: | H:

Scenarios/assets/task5.png

37.1 KB | W: | H:

Scenarios/assets/task5.png
Scenarios/assets/task5.png
Scenarios/assets/task5.png
Scenarios/assets/task5.png
  • 2-up
  • Swipe
  • Onion skin
Scenarios/assets/taskend.png

25.5 KB | W: | H:

Scenarios/assets/taskend.png

21.3 KB | W: | H:

Scenarios/assets/taskend.png
Scenarios/assets/taskend.png
Scenarios/assets/taskend.png
Scenarios/assets/taskend.png
  • 2-up
  • Swipe
  • Onion skin
Scenarios/assets/wheelgear5.png

61.1 KB | W: | H:

Scenarios/assets/wheelgear5.png

60.3 KB | W: | H:

Scenarios/assets/wheelgear5.png
Scenarios/assets/wheelgear5.png
Scenarios/assets/wheelgear5.png
Scenarios/assets/wheelgear5.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
......@@ -34,6 +34,7 @@ import lu.list.itis.dkd.tui.scenario.bootstrapping.SceneBootstrapper;
import lu.list.itis.dkd.tui.utility.PropertiesFetcher;
import lu.list.itis.dkd.tui.widget.BaseWidget;
import lu.list.itis.dkd.tui.widget.ValueWidget;
import lu.list.itis.dkd.tui.widget.corona.ConditionalCorona;
import com.google.common.base.Preconditions;
......@@ -46,7 +47,7 @@ import java.util.Map;
*
* @author Eric Tobias [eric.tobias@list.lu]
* @since 1.0
* @version 1.1.0
* @version 1.1.2
*/
@NonNullByDefault
public class Scenario {
......@@ -93,13 +94,19 @@ public class Scenario {
/**
* Method used to replace the placeholder variables in each widget with the variable as
* initialized by the equation system.
* initialized by the equation system. The method will also set all trigger variables of
* conditional corona with the variables for the given trigger names.
*
*/
private void populateVariables() {
for (final BaseWidget widget : TangibleObjectManager.getWidgets()) {
if (widget instanceof ValueWidget) {
final TangibleNumericalVariable variable = findVariable(((ValueWidget) widget).getVariable().getName());
final TangibleNumericalVariable variable = retrieveVariableByName(((ValueWidget) widget).getVariable().getName());
((ValueWidget) widget).setVariable(variable);
for (final ConditionalCorona corona : widget.getCoronas(ConditionalCorona.class)) {
corona.getTriggers().forEach(trigger -> corona.addVariable(retrieveVariableByName(trigger)));
}
}
}
}
......@@ -112,7 +119,7 @@ public class Scenario {
* @return The {@link TangibleNumericalVariable} that responds to the given name or
* <code>null</code> should no such variable exist.
*/
static @Nullable TangibleNumericalVariable findVariable(String name) {
static @Nullable TangibleNumericalVariable retrieveVariableByName(String name) {
return (TangibleNumericalVariable) (inputs.get(name) == null ? outputs.get(name) : inputs.get(name));
}
......
......@@ -92,7 +92,7 @@ public class Scene extends Content {
final String triggerCondition = element.getChildText(Externalization.TRIGGER_CONDITION_NODE);
for (final String _name : Splitter.on(Externalization.SPACE).trimResults().omitEmptyStrings().split(triggerCondition)) {
final Variable variable = Scenario.findVariable(_name);
final Variable variable = Scenario.retrieveVariableByName(_name);
if (null != variable) {
variables.add(variable);
......
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