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