projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added destroy for GUIComponent and GUIWire
[Mograsim.git]
/
LogicUI
/
src
/
era
/
mi
/
gui
/
model
/
wires
/
GUIWire.java
diff --git
a/LogicUI/src/era/mi/gui/model/wires/GUIWire.java
b/LogicUI/src/era/mi/gui/model/wires/GUIWire.java
index
649ddb6
..
1121335
100644
(file)
--- a/
LogicUI/src/era/mi/gui/model/wires/GUIWire.java
+++ b/
LogicUI/src/era/mi/gui/model/wires/GUIWire.java
@@
-11,6
+11,7
@@
import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
public class GUIWire
{
public class GUIWire
{
+ private final ViewModel model;
private Pin pin1;
private Pin pin2;
private double[] path;
private Pin pin1;
private Pin pin2;
private double[] path;
@@
-19,6
+20,7
@@
public class GUIWire
public GUIWire(ViewModel model, Pin pin1, Pin pin2, Point... path)
{
public GUIWire(ViewModel model, Pin pin1, Pin pin2, Point... path)
{
+ this.model = model;
this.path = new double[path.length * 2 + 4];
for (int srcI = 0, dstI = 2; srcI < path.length; srcI++, dstI += 2)
{
this.path = new double[path.length * 2 + 4];
for (int srcI = 0, dstI = 2; srcI < path.length; srcI++, dstI += 2)
{
@@
-37,6
+39,11
@@
public class GUIWire
model.wireCreated(this);
}
model.wireCreated(this);
}
+ public void destroy()
+ {
+ model.wireDestroyed(this);
+ }
+
public void render(GeneralGC gc)
{
Color oldFG = gc.getForeground();
public void render(GeneralGC gc)
{
Color oldFG = gc.getForeground();