Merge branch 'development' of
[Mograsim.git] / net.mograsim.logic.model / src / net / mograsim / logic / model / examples / ClickableSubmodelComponentsTest.java
1 package net.mograsim.logic.model.examples;
2
3 import net.mograsim.logic.model.SimpleLogicUIStandalone;
4 import net.mograsim.logic.model.model.ViewModelModifiable;
5 import net.mograsim.logic.model.model.components.atomic.GUIBitDisplay;
6 import net.mograsim.logic.model.model.components.atomic.GUIManualSwitch;
7 import net.mograsim.logic.model.model.components.submodels.SimpleRectangularSubmodelComponent;
8 import net.mograsim.logic.model.model.wires.GUIWire;
9
10 public class ClickableSubmodelComponentsTest
11 {
12         public static void main(String[] args)
13         {
14                 SimpleLogicUIStandalone.executeVisualisation(ClickableSubmodelComponentsTest::createExample);
15         }
16
17         public static void createExample(ViewModelModifiable model)
18         {
19                 @SuppressWarnings("unused") // GUIWire
20                 SimpleRectangularSubmodelComponent comp = new SimpleRectangularSubmodelComponent(model, 1, "")
21                 {
22                         {
23                                 setSubmodelScale(.4);
24                                 setOutputPins("O0");
25
26                                 GUIManualSwitch sw = new GUIManualSwitch(submodelModifiable);
27                                 GUIBitDisplay bd = new GUIBitDisplay(submodelModifiable);
28
29                                 sw.moveTo(10, 5);
30                                 bd.moveTo(50, 5);
31
32                                 new GUIWire(submodelModifiable, sw.getOutputPin(), bd.getInputPin());
33
34                         }
35                 };
36                 comp.moveTo(10, 10);
37         }
38 }