projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Actually use adapter. Somehow this introduced a rendering bug...
[Mograsim.git]
/
LogicUI
/
src
/
era
/
mi
/
gui
/
examples
/
Playground.java
diff --git
a/LogicUI/src/era/mi/gui/examples/Playground.java
b/LogicUI/src/era/mi/gui/examples/Playground.java
index
372381a
..
cf9f1e0
100644
(file)
--- a/
LogicUI/src/era/mi/gui/examples/Playground.java
+++ b/
LogicUI/src/era/mi/gui/examples/Playground.java
@@
-11,15
+11,19
@@
import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
public class Playground
{
public class Playground
{
- private static final int WIRE_DELAY = 10;
- private static final int OR_DELAY = 50;
- private static final int NOT_DELAY = 50;
-
public static void main(String[] args)
{
ViewModel model = new ViewModel();
public static void main(String[] args)
{
ViewModel model = new ViewModel();
+ GUIAndGate andGate = new GUIAndGate(model, 1);
+ andGate.moveTo(10, 10);
+ GUINotGate notGate = new GUINotGate(model, 1);
+ notGate.moveTo(10, 40);
+
+ new GUIWire(model, andGate.getPins().get(0), notGate.getPins().get(1), new Point(20, 50));
+
LogicUIStandalone ui = new LogicUIStandalone(model);
LogicUIStandalone ui = new LogicUIStandalone(model);
- addComponentsAndWires(ui, model);
+
+ ui.getLogicUICanvas().addListener(SWT.KeyDown, e -> notGate.moveTo(150, 10));
ui.run();
}
ui.run();
}