X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fwires%2FGUIWire.java;h=f59355ce53060ac95cfea7a4b6fa5986eeac48e6;hb=a86976434d00dce2652d93256cc12b6e3a0f324a;hp=7146d63166189dca4348eb7d9208b23efa2c69d3;hpb=e5ba4628b160a373ed5e7bdcd96ae59b7fbc1faa;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java index 7146d631..f59355ce 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/wires/GUIWire.java @@ -30,6 +30,10 @@ public class GUIWire * The model this wire is a part of. */ private final ViewModelModifiable model; + /** + * The name of this wire. Is unique for all wires in its model. + */ + public final String name; /** * The logical width of this wire. Is equal to the logical with of {@link #pin1} and {@link #pin2}. */ @@ -72,83 +76,164 @@ public class GUIWire // creation and destruction /** - * Creates a new {@link GUIWire} with automatic interpolation. + * Creates a new {@link GUIWire} with automatic interpolation and using the default name. * * @author Daniel Kirschten */ public GUIWire(ViewModelModifiable model, WireCrossPoint pin1, WireCrossPoint pin2) { - this(model, pin1, pin2, (Point[]) null); + this(model, null, pin1, pin2); } /** - * Creates a new {@link GUIWire} with automatic interpolation. + * Creates a new {@link GUIWire} with automatic interpolation and using the default name. * * @author Daniel Kirschten */ public GUIWire(ViewModelModifiable model, WireCrossPoint pin1, Pin pin2) { - this(model, pin1, pin2, (Point[]) null); + this(model, null, pin1, pin2); } /** - * Creates a new {@link GUIWire} with automatic interpolation. + * Creates a new {@link GUIWire} with automatic interpolation and using the default name. * * @author Daniel Kirschten */ public GUIWire(ViewModelModifiable model, Pin pin1, WireCrossPoint pin2) { - this(model, pin1, pin2, (Point[]) null); + this(model, null, pin1, pin2); } /** - * Creates a new {@link GUIWire} with automatic interpolation. + * Creates a new {@link GUIWire} with automatic interpolation and using the default name. * * @author Daniel Kirschten */ public GUIWire(ViewModelModifiable model, Pin pin1, Pin pin2) { - this(model, pin1, pin2, (Point[]) null); + this(model, null, pin1, pin2); } /** - * Creates a new {@link GUIWire} without automatic interpolation. + * Creates a new {@link GUIWire} without automatic interpolation and using the default name. * * @author Daniel Kirschten */ public GUIWire(ViewModelModifiable model, WireCrossPoint pin1, WireCrossPoint pin2, Point... path) { - this(model, pin1.getPin(), pin2.getPin(), path); + this(model, null, pin1, pin2, path); } /** - * Creates a new {@link GUIWire} without automatic interpolation. + * Creates a new {@link GUIWire} without automatic interpolation and using the default name. * * @author Daniel Kirschten */ public GUIWire(ViewModelModifiable model, WireCrossPoint pin1, Pin pin2, Point... path) { - this(model, pin1.getPin(), pin2, path); + this(model, null, pin1, pin2, path); } /** - * Creates a new {@link GUIWire} without automatic interpolation. + * Creates a new {@link GUIWire} without automatic interpolation and using the default name. * * @author Daniel Kirschten */ public GUIWire(ViewModelModifiable model, Pin pin1, WireCrossPoint pin2, Point... path) { - this(model, pin1, pin2.getPin(), path); + this(model, null, pin1, pin2, path); } /** - * Creates a new {@link GUIWire} without automatic interpolation. + * Creates a new {@link GUIWire} without automatic interpolation and using the default name. * * @author Daniel Kirschten */ public GUIWire(ViewModelModifiable model, Pin pin1, Pin pin2, Point... path) + { + this(model, null, pin1, pin2, path); + } + + /** + * Creates a new {@link GUIWire} with automatic interpolation. + * + * @author Daniel Kirschten + */ + public GUIWire(ViewModelModifiable model, String name, WireCrossPoint pin1, WireCrossPoint pin2) + { + this(model, name, pin1, pin2, (Point[]) null); + } + + /** + * Creates a new {@link GUIWire} with automatic interpolation. + * + * @author Daniel Kirschten + */ + public GUIWire(ViewModelModifiable model, String name, WireCrossPoint pin1, Pin pin2) + { + this(model, name, pin1, pin2, (Point[]) null); + } + + /** + * Creates a new {@link GUIWire} with automatic interpolation. + * + * @author Daniel Kirschten + */ + public GUIWire(ViewModelModifiable model, String name, Pin pin1, WireCrossPoint pin2) + { + this(model, name, pin1, pin2, (Point[]) null); + } + + /** + * Creates a new {@link GUIWire} with automatic interpolation. + * + * @author Daniel Kirschten + */ + public GUIWire(ViewModelModifiable model, String name, Pin pin1, Pin pin2) + { + this(model, name, pin1, pin2, (Point[]) null); + } + + /** + * Creates a new {@link GUIWire} without automatic interpolation. + * + * @author Daniel Kirschten + */ + public GUIWire(ViewModelModifiable model, String name, WireCrossPoint pin1, WireCrossPoint pin2, Point... path) + { + this(model, name, pin1.getPin(), pin2.getPin(), path); + } + + /** + * Creates a new {@link GUIWire} without automatic interpolation. + * + * @author Daniel Kirschten + */ + public GUIWire(ViewModelModifiable model, String name, WireCrossPoint pin1, Pin pin2, Point... path) + { + this(model, name, pin1.getPin(), pin2, path); + } + + /** + * Creates a new {@link GUIWire} without automatic interpolation. + * + * @author Daniel Kirschten + */ + public GUIWire(ViewModelModifiable model, String name, Pin pin1, WireCrossPoint pin2, Point... path) + { + this(model, name, pin1, pin2.getPin(), path); + } + + /** + * Creates a new {@link GUIWire} without automatic interpolation. + * + * @author Daniel Kirschten + */ + public GUIWire(ViewModelModifiable model, String name, Pin pin1, Pin pin2, Point... path) { this.model = model; + this.name = name == null ? model.getDefaultWireName() : name; this.logicWidth = pin1.logicWidth; if (pin2.logicWidth != pin1.logicWidth) throw new IllegalArgumentException("Can't connect pins of different logic width");