X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=LogicUI%2Fsrc%2Fera%2Fmi%2Fgui%2Fexamples%2FRSLatchGUIExample.java;h=b91ebe99d0d01ab19149c582e32eea0ef7facbf7;hb=055d61dd8838c5926e78c9931cd4dcf16f761941;hp=23e9ac9f3fb6a7fc7f0c2bed3444a2d353c58e46;hpb=29132a3ced2ade6609a747f731614e235830b9b9;p=Mograsim.git diff --git a/LogicUI/src/era/mi/gui/examples/RSLatchGUIExample.java b/LogicUI/src/era/mi/gui/examples/RSLatchGUIExample.java index 23e9ac9f..b91ebe99 100644 --- a/LogicUI/src/era/mi/gui/examples/RSLatchGUIExample.java +++ b/LogicUI/src/era/mi/gui/examples/RSLatchGUIExample.java @@ -19,11 +19,11 @@ public class RSLatchGUIExample public static void main(String[] args) { LogicUIStandalone ui = new LogicUIStandalone(); - initComponents(ui.getLogicUICanvas()); + addComponentsAndWires(ui.getLogicUICanvas()); ui.run(); } - private static void initComponents(LogicUICanvas ui) + public static void addComponentsAndWires(LogicUICanvas ui) { Simulation.TIMELINE.reset(); Wire r = new Wire(1, WIRE_DELAY); @@ -33,12 +33,12 @@ public class RSLatchGUIExample Wire q = new Wire(1, WIRE_DELAY); Wire nq = new Wire(1, WIRE_DELAY); - GUIManualSwitch rIn = ui.addComponent(new GUIManualSwitch(r.createEnd()), 100, 100); - GUIManualSwitch sIn = ui.addComponent(new GUIManualSwitch(s.createEnd()), 100, 200); - GUIOrGate or1 = ui.addComponent(new GUIOrGate(OR_DELAY, t1.createEnd(), r.createReadOnlyEnd(), nq.createReadOnlyEnd()), 160, 102.5); - GUIOrGate or2 = ui.addComponent(new GUIOrGate(OR_DELAY, t2.createEnd(), q.createReadOnlyEnd(), s.createReadOnlyEnd()), 160, 192.5); - GUINotGate not1 = ui.addComponent(new GUINotGate(NOT_DELAY, t1.createReadOnlyEnd(), q.createEnd()), 200, 107.5); - GUINotGate not2 = ui.addComponent(new GUINotGate(NOT_DELAY, t2.createReadOnlyEnd(), nq.createEnd()), 200, 197.5); + GUIManualSwitch rIn = ui.addComponent(new GUIManualSwitch(r.createReadWriteEnd()), 100, 100); + GUIManualSwitch sIn = ui.addComponent(new GUIManualSwitch(s.createReadWriteEnd()), 100, 200); + GUIOrGate or1 = ui.addComponent(new GUIOrGate(OR_DELAY, t1.createReadWriteEnd(), r.createReadOnlyEnd(), nq.createReadOnlyEnd()), 160, 102.5); + GUIOrGate or2 = ui.addComponent(new GUIOrGate(OR_DELAY, t2.createReadWriteEnd(), q.createReadOnlyEnd(), s.createReadOnlyEnd()), 160, 192.5); + GUINotGate not1 = ui.addComponent(new GUINotGate(NOT_DELAY, t1.createReadOnlyEnd(), q.createReadWriteEnd()), 200, 107.5); + GUINotGate not2 = ui.addComponent(new GUINotGate(NOT_DELAY, t2.createReadOnlyEnd(), nq.createReadWriteEnd()), 200, 197.5); WireConnectionPoint p1 = ui.addComponent(new WireConnectionPoint(q, 3), 250, 112.5); WireConnectionPoint p2 = ui.addComponent(new WireConnectionPoint(nq, 3), 250, 202.5);