74da19ccfa557bf142862f771d20b61f57197476
[Mograsim.git] / LogicUI / src / era / mi / gui / examples / Playground.java
1 package era.mi.gui.examples;
2
3 import era.mi.gui.LogicUICanvas;
4 import era.mi.gui.LogicUIStandalone;
5 import era.mi.gui.model.ViewModel;
6 import era.mi.gui.model.components.GUIAndGate;
7 import era.mi.gui.model.components.GUINotGate;
8 import era.mi.gui.model.wires.GUIWire;
9
10 public class Playground
11 {
12         private static final int WIRE_DELAY = 10;
13         private static final int OR_DELAY = 50;
14         private static final int NOT_DELAY = 50;
15
16         public static void main(String[] args)
17         {
18                 ViewModel model = new ViewModel();
19                 LogicUIStandalone ui = new LogicUIStandalone(model);
20                 addComponentsAndWires(ui.getLogicUICanvas(), model);
21                 ui.run();
22         }
23
24         public static void addComponentsAndWires(LogicUICanvas ui, ViewModel model)
25         {
26                 GUIAndGate andGate = new GUIAndGate(model);
27                 andGate.moveTo(10, 10);
28                 GUINotGate notGate = new GUINotGate(model);
29                 notGate.moveTo(10, 40);
30
31                 new GUIWire(model, andGate.getPins().get(0), notGate.getPins().get(1));
32         }
33 }