Small changes; mainly in the listener system:
[Mograsim.git] / LogicUI / src / era / mi / gui / examples / Playground.java
index eafa1a5..f556759 100644 (file)
@@ -1,10 +1,10 @@
 package era.mi.gui.examples;
 
-import era.mi.gui.LogicUICanvas;
 import era.mi.gui.LogicUIStandalone;
 import era.mi.gui.model.ViewModel;
 import era.mi.gui.model.components.GUIAndGate;
 import era.mi.gui.model.components.GUINotGate;
+import era.mi.gui.model.wires.GUIWire;
 
 public class Playground
 {
@@ -16,17 +16,17 @@ public class Playground
        {
                ViewModel model = new ViewModel();
                LogicUIStandalone ui = new LogicUIStandalone(model);
-               addComponentsAndWires(ui.getLogicUICanvas(), model);
+               addComponentsAndWires(model);
                ui.run();
        }
 
-       public static void addComponentsAndWires(LogicUICanvas ui, ViewModel model)
+       public static void addComponentsAndWires(ViewModel model)
        {
-               GUIAndGate andGate = ui.addComponent(new GUIAndGate(model));
+               GUIAndGate andGate = new GUIAndGate(model);
                andGate.moveTo(10, 10);
-               GUINotGate notGate = ui.addComponent(new GUINotGate(model));
+               GUINotGate notGate = new GUINotGate(model);
                notGate.moveTo(10, 40);
 
-               ui.addWire(andGate.getPins().get(0), notGate.getPins().get(1));
+               new GUIWire(model, andGate.getPins().get(0), notGate.getPins().get(1));
        }
 }
\ No newline at end of file