projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added concept of wire width to GUIComponents and GUIWires
[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
0f7ff08
..
c8fd574
100644
(file)
--- a/
LogicUI/src/era/mi/gui/model/wires/GUIWire.java
+++ b/
LogicUI/src/era/mi/gui/model/wires/GUIWire.java
@@
-14,6
+14,7
@@
import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
public class GUIWire
{
private final ViewModel model;
public class GUIWire
{
private final ViewModel model;
+ public final int logicWidth;
private Pin pin1;
private Pin pin2;
private double[] path;
private Pin pin1;
private Pin pin2;
private double[] path;
@@
-25,6
+26,9
@@
public class GUIWire
public GUIWire(ViewModel model, Pin pin1, Pin pin2, Point... path)
{
this.model = model;
public GUIWire(ViewModel model, Pin pin1, Pin pin2, Point... path)
{
this.model = model;
+ this.logicWidth = pin1.logicWidth;
+ if (pin2.logicWidth != pin1.logicWidth)
+ throw new IllegalArgumentException("Can't connect pins of different logic width");
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)
{