"x": 0.0,
"y": 5.0
},
- "name": "Input pin #0",
+ "name": "A",
"logicWidth": 1
},
{
"x": 0.0,
"y": 15.0
},
- "name": "Input pin #1",
+ "name": "B",
"logicWidth": 1
},
{
"x": 0.0,
"y": 25.0
},
- "name": "Input pin #2",
+ "name": "C",
"logicWidth": 1
},
{
"x": 35.0,
"y": 5.0
},
- "name": "Output pin #0",
+ "name": "Y",
"logicWidth": 1
},
{
"x": 35.0,
"y": 15.0
},
- "name": "Output pin #1",
+ "name": "Z",
"logicWidth": 1
}
],
{
"pin1": {
"compId": 0,
- "pinIndex": 0
+ "pinName": "A"
},
"pin2": {
"compId": 2,
- "pinIndex": 0
+ "pinName": "A"
},
"path": []
},
{
"pin1": {
"compId": 0,
- "pinIndex": 1
+ "pinName": "B"
},
"pin2": {
"compId": 1,
- "pinIndex": 0
+ "pinName": "A"
}
},
{
"pin1": {
"compId": 0,
- "pinIndex": 2
+ "pinName": "C"
},
"pin2": {
"compId": 1,
- "pinIndex": 1
+ "pinName": "B"
}
},
{
"pin1": {
"compId": 1,
- "pinIndex": 2
+ "pinName": "Y"
},
"pin2": {
"compId": 2,
- "pinIndex": 1
+ "pinName": "B"
}
},
{
"pin1": {
"compId": 1,
- "pinIndex": 3
+ "pinName": "_Z"
},
"pin2": {
"compId": 3,
- "pinIndex": 2
+ "pinName": "B"
},
"path": []
},
{
"pin1": {
"compId": 2,
- "pinIndex": 2
+ "pinName": "Y"
},
"pin2": {
"compId": 0,
- "pinIndex": 3
+ "pinName": "Y"
},
"path": []
},
{
"pin1": {
"compId": 2,
- "pinIndex": 3
+ "pinName": "_Z"
},
"pin2": {
"compId": 3,
- "pinIndex": 1
+ "pinName": "A"
},
"path": [
{
{
"pin1": {
"compId": 3,
- "pinIndex": 0
+ "pinName": "Y"
},
"pin2": {
"compId": 0,
- "pinIndex": 4
+ "pinName": "Z"
}
}
]
"x": 35.0,
"y": 15.0
},
- "name": "Z",
+ "name": "_Z",
"logicWidth": 1
}
],
{
"pin1": {
"compId": 0,
- "pinIndex": 0
+ "pinName": "A"
},
"pin2": {
"compId": 5,
- "pinIndex": 0
+ "pinName": ""
},
"path": []
},
{
"pin1": {
"compId": 5,
- "pinIndex": 0
+ "pinName": ""
},
"pin2": {
"compId": 2,
- "pinIndex": 1
+ "pinName": "A"
},
"path": [
{
{
"pin1": {
"compId": 5,
- "pinIndex": 0
+ "pinName": ""
},
"pin2": {
"compId": 1,
- "pinIndex": 1
+ "pinName": "A"
},
"path": [
{
{
"pin1": {
"compId": 0,
- "pinIndex": 1
+ "pinName": "B"
},
"pin2": {
"compId": 6,
- "pinIndex": 0
+ "pinName": ""
},
"path": []
},
{
"pin1": {
"compId": 6,
- "pinIndex": 0
+ "pinName": ""
},
"pin2": {
"compId": 3,
- "pinIndex": 2
+ "pinName": "B"
},
"path": [
{
{
"pin1": {
"compId": 6,
- "pinIndex": 0
+ "pinName": ""
},
"pin2": {
"compId": 1,
- "pinIndex": 2
+ "pinName": "B"
},
"path": [
{
{
"pin1": {
"compId": 1,
- "pinIndex": 0
+ "pinName": "Y"
},
"pin2": {
"compId": 7,
- "pinIndex": 0
+ "pinName": ""
},
"path": []
},
{
"pin1": {
"compId": 7,
- "pinIndex": 0
+ "pinName": ""
},
"pin2": {
"compId": 0,
- "pinIndex": 3
+ "pinName": "_Z"
},
"path": [
{
{
"pin1": {
"compId": 7,
- "pinIndex": 0
+ "pinName": ""
},
"pin2": {
"compId": 2,
- "pinIndex": 2
+ "pinName": "B"
},
"path": [
{
{
"pin1": {
"compId": 7,
- "pinIndex": 0
+ "pinName": ""
},
"pin2": {
"compId": 3,
- "pinIndex": 1
+ "pinName": "A"
},
"path": [
{
{
"pin1": {
"compId": 2,
- "pinIndex": 0
+ "pinName": "Y"
},
"pin2": {
"compId": 4,
- "pinIndex": 1
+ "pinName": "A"
},
"path": [
{
{
"pin1": {
"compId": 3,
- "pinIndex": 0
+ "pinName": "Y"
},
"pin2": {
"compId": 4,
- "pinIndex": 2
+ "pinName": "B"
},
"path": [
{
{
"pin1": {
"compId": 4,
- "pinIndex": 0
+ "pinName": "Y"
},
"pin2": {
"compId": 0,
- "pinIndex": 2
+ "pinName": "Y"
},
"path": []
}
{
GUIManualSwitch sw = new GUIManualSwitch(model);
sw.moveTo(0, 20 * i);
- new GUIWire(model, am2901.getPins().get(i), sw.getOutputPin());
+ new GUIWire(model, am2901.getPin(am2901.inputNames.get(i)), sw.getOutputPin());
}
for (int i = 0; i < am2901.outputNames.size(); i++)
{
GUIBitDisplay bd = new GUIBitDisplay(model);
bd.moveTo(200, 20 * i);
- new GUIWire(model, am2901.getPins().get(am2901.inputNames.size() + i), bd.getInputPin());
+ new GUIWire(model, am2901.getPin(am2901.outputNames.get(i)), bd.getInputPin());
}
}
}
\ No newline at end of file
GUIBitDisplay bdZ = new GUIBitDisplay(model);
bdZ.moveTo(90, 30);
- new GUIWire(model, swA.getOutputPin(), adder.getInputPins().get(0));
- new GUIWire(model, swB.getOutputPin(), adder.getInputPins().get(1));
- new GUIWire(model, swC.getOutputPin(), adder.getInputPins().get(2));
+ new GUIWire(model, swA.getOutputPin(), adder.getPin("A"));
+ new GUIWire(model, swB.getOutputPin(), adder.getPin("B"));
+ new GUIWire(model, swC.getOutputPin(), adder.getPin("C"));
- new GUIWire(model, adder.getOutputPins().get(0), bdY.getInputPin());
- new GUIWire(model, adder.getOutputPins().get(1), bdZ.getInputPin());
+ new GUIWire(model, adder.getPin("Y"), bdY.getInputPin());
+ new GUIWire(model, adder.getPin("Z"), bdZ.getInputPin());
SubmodelComponent adder2 = GUICustomComponentCreator.create(model, pC, "");
bdZ = new GUIBitDisplay(model);
bdZ.moveTo(90, 85);
- new GUIWire(model, swA.getOutputPin(), adder2.getPins().get(0));
- new GUIWire(model, swB.getOutputPin(), adder2.getPins().get(1));
- new GUIWire(model, swC.getOutputPin(), adder2.getPins().get(2));
+ new GUIWire(model, swA.getOutputPin(), adder.getPin("A"));
+ new GUIWire(model, swB.getOutputPin(), adder.getPin("B"));
+ new GUIWire(model, swC.getOutputPin(), adder.getPin("C"));
- new GUIWire(model, adder2.getPins().get(3), bdY.getInputPin());
- new GUIWire(model, adder2.getPins().get(4), bdZ.getInputPin());
+ new GUIWire(model, adder.getPin("Y"), bdY.getInputPin());
+ new GUIWire(model, adder.getPin("Z"), bdZ.getInputPin());
}
}
\ No newline at end of file
GUIOrGate or1 = new GUIOrGate(model, 1);
or1.moveTo(160, 102.5);
- new GUIWire(model, rIn.getOutputPin(), or1.getInputPins().get(0));
+ new GUIWire(model, rIn.getOutputPin(), or1.getPin("A"));
GUIOrGate or2 = new GUIOrGate(model, 1);
or2.moveTo(160, 192.5);
- new GUIWire(model, sIn.getOutputPin(), or2.getInputPins().get(1));
+ new GUIWire(model, sIn.getOutputPin(), or2.getPin("B"));
GUINotGate not1 = new GUINotGate(model, 1);
not1.moveTo(200, 107.5);
- new GUIWire(model, or1.getOutputPin(), not1.getInputPins().get(0));
+ new GUIWire(model, or1.getPin("Y"), not1.getPin("A"));
GUINotGate not2 = new GUINotGate(model, 1);
not2.moveTo(200, 197.5);
- new GUIWire(model, or2.getOutputPin(), not2.getInputPins().get(0));
+ new GUIWire(model, or2.getPin("Y"), not2.getPin("A"));
WireCrossPoint p1 = new WireCrossPoint(model, 1);
p1.moveCenterTo(250, 112.5);
- new GUIWire(model, not1.getOutputPin(), p1);
- new GUIWire(model, p1, or2.getInputPins().get(0), new Point(250, 130), new Point(140, 185), new Point(140, 197.5));
+ new GUIWire(model, not1.getPin("Y"), p1);
+ new GUIWire(model, p1, or2.getPin("A"), new Point(250, 130), new Point(140, 185), new Point(140, 197.5));
WireCrossPoint p2 = new WireCrossPoint(model, 1);
p2.moveCenterTo(250, 202.5);
- new GUIWire(model, not2.getOutputPin(), p2);
- new GUIWire(model, p2, or1.getInputPins().get(1), new Point(250, 185), new Point(140, 130), new Point(140, 117.5));
+ new GUIWire(model, not2.getPin("Y"), p2);
+ new GUIWire(model, p2, or1.getPin("B"), new Point(250, 185), new Point(140, 130), new Point(140, 117.5));
WireCrossPoint o1 = new WireCrossPoint(model, 1);
o1.moveCenterTo(270, 112.5);
SimpleRectangularSubmodelComponent comp = new GUIAm2901ALUInclDecode(model);
comp.moveTo(100, 0);
- for (int i = 0; i < comp.getInputPins().size(); i++)
+ for (int i = 0; i < comp.getInputPinNames().size(); i++)
{
GUIManualSwitch sw = new GUIManualSwitch(model);
sw.moveTo(0, 20 * i);
- new GUIWire(model, comp.getInputPins().get(i), sw.getOutputPin());
+ new GUIWire(model, comp.getPin(comp.getInputPinNames().get(i)), sw.getOutputPin());
}
- for (int i = 0; i < comp.getOutputPins().size(); i++)
+ for (int i = 0; i < comp.getOutputPinNames().size(); i++)
{
GUIBitDisplay bd = new GUIBitDisplay(model);
bd.moveTo(200, 20 * i);
- new GUIWire(model, comp.getOutputPins().get(i), bd.getInputPin());
+ new GUIWire(model, comp.getPin(comp.getOutputPinNames().get(i)), bd.getInputPin());
}
}
}
\ No newline at end of file
this.outputNames = List.of("Y1", "Y2", "Y3", "Y4", "F=0", "Cn+4", "OVR", "F3_ORAMn+3", "ORAMn", "OQn", "OQn+3");
setSize(50, inputNames.size() * 10);
for (int i = 0; i < inputNames.size(); i++)
- addPin(new Pin(this, "Input pin #" + i, 1, 0, 5 + 10 * i));
+ addPin(new Pin(this, inputNames.get(i), 1, 0, 5 + 10 * i));
for (int i = 0; i < outputNames.size(); i++)
- addPin(new Pin(this, "Output pin #" + i, 1, 50, 5 + 10 * i));
+ addPin(new Pin(this, outputNames.get(i), 1, 50, 5 + 10 * i));
}
@Override
package net.mograsim.logic.ui.model.components;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import java.util.function.Consumer;
import java.util.function.Supplier;
{
protected final ViewModelModifiable model;
private final Rectangle bounds;
- private final List<Pin> pins;
- protected final List<Pin> pinsUnmodifiable;
+ private final Map<String, Pin> pinsByName;
+ protected final Collection<Pin> pinsUnmodifiable;
private final List<Consumer<? super GUIComponent>> componentMovedListeners;
private final List<Consumer<? super Pin>> pinAddedListeners;
{
this.model = model;
this.bounds = new Rectangle(0, 0, 0, 0);
- this.pins = new ArrayList<>();
- this.pinsUnmodifiable = Collections.unmodifiableList(pins);
+ this.pinsByName = new HashMap<>();
+ this.pinsUnmodifiable = Collections.unmodifiableCollection(pinsByName.values());
this.componentMovedListeners = new ArrayList<>();
this.pinAddedListeners = new ArrayList<>();
public void destroy()
{
- pins.forEach(p -> pinRemovedListeners.forEach(l -> l.accept(p)));
+ pinsByName.values().forEach(p -> pinRemovedListeners.forEach(l -> l.accept(p)));
model.componentDestroyed(this);
}
}
/**
- * Returns a list of pins of this component.
+ * Returns a collection of pins of this component.
*/
- public List<Pin> getPins()
+ public Collection<Pin> getPins()
{
return pinsUnmodifiable;
}
+ public Pin getPin(String name)
+ {
+ return pinsByName.get(name);
+ }
+
// @formatter:off
public void addComponentMovedListener (Consumer<? super GUIComponent> listener) {componentMovedListeners.add (listener);}
public void addPinAddedListener (Consumer<? super Pin > listener) {pinAddedListeners .add (listener);}
protected void addPin(Pin pin)
{
- pins.add(pin);
+ if (pinsByName.containsKey(pin.name))
+ throw new IllegalArgumentException("Duplicate pin name: " + pin.name);
+ pinsByName.put(pin.name, pin);
callPinAddedListeners(pin);
pin.addRedrawListener(redrawListenerForSubcomponents);
callRedrawListeners();
}
- protected void removePin(Pin pin)
+ protected void removePin(String name)
{
- pins.remove(pin);
+ Pin pin = pinsByName.remove(name);
callPinRemovedListeners(pin);
pin.removeRedrawListener(redrawListenerForSubcomponents);
callRedrawListeners();
int inputCount = ((Number) m.get(SimpleRectangularSubmodelComponent.kInCount)).intValue();
String[] inputNames = new String[inputCount];
for (int i = 0; i < inputCount; i++)
- inputNames[i] = "Input pin #" + i;
+ inputNames[i] = params.interfacePins[i].name;
rect.setInputPins(inputNames);
int outputCount = ((Number) m.get(SimpleRectangularSubmodelComponent.kOutCount)).intValue();
String[] outputPins = new String[outputCount];
for (int i = 0; i < outputCount; i++)
- outputPins[i] = "Output pin #" + i;
+ outputPins[i] = params.interfacePins[inputCount + i].name;
rect.setOutputPins(outputPins);
return rect;
{
InnerWireParams innerWire = params.innerWires[i];
new GUIWire(comp.submodelModifiable,
- comp.submodelModifiable.getComponents().get(innerWire.pin1.compId).getPins().get(innerWire.pin1.pinIndex),
- comp.submodelModifiable.getComponents().get(innerWire.pin2.compId).getPins().get(innerWire.pin2.pinIndex),
- innerWire.path);
+ comp.submodelModifiable.getComponents().get(innerWire.pin1.compId).getPin(innerWire.pin1.pinName),
+ comp.submodelModifiable.getComponents().get(innerWire.pin2.compId).getPin(innerWire.pin2.pinName), innerWire.path);
}
}
catch (InstantiationException | IllegalAccessException | InvocationTargetException | NoSuchMethodException | SecurityException
package net.mograsim.logic.ui.model.components;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.List;
import net.haspamelodica.swt.helper.gcs.GeneralGC;
private MovablePin outputPin;
private final List<Pin> inputPins;
- private final List<Pin> inputPinsUnmodifiable;
protected SimpleRectangularGUIGate(ViewModelModifiable model, int logicWidth, String label, boolean isInverted)
{
this.outputPin = new MovablePin(this, "Y", logicWidth, width, 0);
addPin(outputPin);
this.inputPins = new ArrayList<>();
- this.inputPinsUnmodifiable = Collections.unmodifiableList(inputPins);
setInputCount(1);
}
setSize(width, inputCount * pinDistance);
if (oldInputCount > inputCount)
while (inputPins.size() > inputCount)
- removePin(inputPins.remove(inputCount));
+ removePin(inputPins.remove(inputCount).name);
else if (oldInputCount < inputCount)
for (int i = oldInputCount; i < inputCount; i++)
{
- // TODO what for more than 26 input pins?
- Pin pin = new Pin(this, "A" + i, logicWidth, 0, pinDistance / 2 + i * pinDistance);
+ // TODO what for more than 24 input pins?
+ Pin pin = new Pin(this, String.valueOf((char) ('A' + i)), logicWidth, 0, pinDistance / 2 + i * pinDistance);
inputPins.add(pin);
addPin(pin);
}
outputPin.setRelPos(width, inputCount * pinDistance / 2);
}
- public Pin getOutputPin()
- {
- return outputPin;
- }
-
- public List<Pin> getInputPins()
- {
- return inputPinsUnmodifiable;
- }
-
@Override
public void render(GeneralGC gc, Rectangle visibleRegion)
{
double posX = getBounds().x;
double posY = getBounds().y;
- double height = inputPins.size() * pinDistance;
+ double height = (getPins().size() - 1) * pinDistance;
gc.drawRectangle(posX, posY, rectWidth, height);
Font oldFont = gc.getFont();
Font labelFont = new Font(oldFont.getName(), fontHeight, oldFont.getStyle());
package net.mograsim.logic.ui.model.components;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
private final String label;
protected final int logicWidth;
- private final List<Pin> inputSupermodelPins;
- private final List<Pin> inputSupermodelPinsUnmodifiable;
- private final List<Pin> outputSupermodelPins;
- private final List<Pin> outputSupermodelPinsUnmodifiable;
- private final List<Pin> inputSubmodelPins;
- private final List<Pin> inputSubmodelPinsUnmodifiable;
- private final List<Pin> outputSubmodelPins;
- private final List<Pin> outputSubmodelPinsUnmodifiable;
+ private final List<String> inputPinNames;
+ private final List<String> inputPinNamesUnmodifiable;
+ private final List<String> outputPinNames;
+ private final List<String> outputPinNamesUnmodifiable;
protected SimpleRectangularSubmodelComponent(ViewModelModifiable model, int logicWidth, String label)
{
super(model);
this.label = label;
this.logicWidth = logicWidth;
- this.inputSupermodelPins = new ArrayList<>();
- this.inputSupermodelPinsUnmodifiable = Collections.unmodifiableList(inputSupermodelPins);
- this.outputSupermodelPins = new ArrayList<>();
- this.outputSupermodelPinsUnmodifiable = Collections.unmodifiableList(outputSupermodelPins);
- this.inputSubmodelPins = new ArrayList<>();
- this.inputSubmodelPinsUnmodifiable = Collections.unmodifiableList(inputSubmodelPins);
- this.outputSubmodelPins = new ArrayList<>();
- this.outputSubmodelPinsUnmodifiable = Collections.unmodifiableList(outputSubmodelPins);
+ this.inputPinNames = new ArrayList<>();
+ this.inputPinNamesUnmodifiable = Collections.unmodifiableList(inputPinNames);
+ this.outputPinNames = new ArrayList<>();
+ this.outputPinNamesUnmodifiable = Collections.unmodifiableList(outputPinNames);
}
protected void setInputPins(String... pinNames)
{
- int inputCount = pinNames.length;
- int oldInputCount = inputSupermodelPins.size();
- double height = Math.max(inputCount, outputSupermodelPins.size()) * pinDistance;
- super.setSize(width, height);
- if (oldInputCount > inputCount)
- while (inputSupermodelPins.size() > inputCount)
- {
- inputSubmodelPins.remove(inputCount);
- super.removeSubmodelInterface(inputSupermodelPins.remove(inputCount));
- }
- else if (oldInputCount < inputCount)
- for (int i = oldInputCount; i < inputCount; i++)
- {
- Pin submodelPin = super.addSubmodelInterface(pinNames[i], logicWidth, 0, pinDistance / 2 + i * pinDistance);
- inputSubmodelPins.add(submodelPin);
- inputSupermodelPins.add(getSupermodelPin(submodelPin));
- }
- for (int i = 0; i < Math.min(oldInputCount, inputCount); i++)
- {
- if (!inputSubmodelPins.get(i).name.equals(pinNames[i]))
- {
- super.removeSubmodelInterface(inputSupermodelPins.get(i));
- Pin submodelPin = super.addSubmodelInterface(pinNames[i], logicWidth, 0, pinDistance / 2 + i * pinDistance);
- inputSubmodelPins.set(i, submodelPin);
- inputSupermodelPins.set(i, getSupermodelPin(submodelPin));
- }
- }
+ setIOPins(0, inputPinNames, outputPinNames, pinNames);
}
protected void setOutputPins(String... pinNames)
{
- int outputCount = pinNames.length;
- int oldOutputCount = outputSupermodelPins.size();
- super.setSize(width, Math.max(inputSupermodelPins.size(), outputCount) * pinDistance);
- if (oldOutputCount > outputCount)
- while (outputSupermodelPins.size() > outputCount)
- {
- outputSubmodelPins.remove(outputCount);
- super.removeSubmodelInterface(outputSupermodelPins.get(outputCount));
- }
- else if (oldOutputCount < outputCount)
- for (int i = oldOutputCount; i < outputCount; i++)
- {
- Pin submodelPin = super.addSubmodelInterface(pinNames[i], logicWidth, width, pinDistance / 2 + i * pinDistance);
- outputSubmodelPins.add(submodelPin);
- outputSupermodelPins.add(getSupermodelPin(submodelPin));
- }
- for (int i = 0; i < Math.min(oldOutputCount, outputCount); i++)
- {
- if (!outputSubmodelPins.get(i).name.equals(pinNames[i]))
- {
- super.removeSubmodelInterface(outputSupermodelPins.get(i));
- Pin submodelPin = super.addSubmodelInterface(pinNames[i], logicWidth, width, pinDistance / 2 + i * pinDistance);
- outputSubmodelPins.set(i, submodelPin);
- outputSupermodelPins.set(i, getSupermodelPin(submodelPin));
- }
- }
+ setIOPins(width, outputPinNames, inputPinNames, pinNames);
}
- public List<Pin> getInputPins()
+ private void setIOPins(double relX, List<String> pinNamesListThisSide, List<String> pinNamesListOtherSide, String... newPinNames)
{
- return inputSupermodelPinsUnmodifiable;
- }
-
- public List<Pin> getOutputPins()
- {
- return outputSupermodelPinsUnmodifiable;
+ int inputCount = newPinNames.length;
+ List<String> newPinNamesList = Arrays.asList(newPinNames);
+ if (new HashSet<>(newPinNamesList).size() != inputCount)
+ throw new IllegalArgumentException("Pin names contain duplicates");
+ for (String pinName : newPinNamesList)
+ if (pinNamesListOtherSide.contains(pinName))
+ throw new IllegalArgumentException("Can't add pin. There is a pin on the other side with the same name: " + pinName);
+ super.setSize(width, Math.max(inputCount, pinNamesListOtherSide.size()) * pinDistance);
+ for (int i = 0; i < inputCount; i++)
+ {
+ String pinName = newPinNames[i];
+ int oldPinIndex = pinNamesListThisSide.indexOf(pinName);
+ if (oldPinIndex == -1)
+ super.addSubmodelInterface(pinName, logicWidth, relX, pinDistance / 2 + i * pinDistance);
+ else
+ getSupermodelMovablePin(pinName).setRelPos(relX, pinDistance / 2 + i * pinDistance);
+ }
+ for (String pinName : pinNamesListThisSide)
+ if (!newPinNamesList.contains(pinName))
+ super.removeSubmodelInterface(pinName);
+ pinNamesListThisSide.clear();
+ pinNamesListThisSide.addAll(newPinNamesList);
}
- protected List<Pin> getInputSubmodelPins()
+ public List<String> getInputPinNames()
{
- return inputSubmodelPinsUnmodifiable;
+ return inputPinNamesUnmodifiable;
}
- protected List<Pin> getOutputSubmodelPins()
+ public List<String> getOutputPinNames()
{
- return outputSubmodelPinsUnmodifiable;
+ return outputPinNamesUnmodifiable;
}
@Override
Point textExtent = gc.textExtent(label);
gc.drawText(label, posX + (getBounds().width - textExtent.x) / 2, posY + (getBounds().height - textExtent.y) / 2, true);
gc.setFont(new Font(oldFont.getName(), pinNameFontHeight, oldFont.getStyle()));
- for (int i = 0; i < inputSupermodelPins.size(); i++)
+ for (int i = 0; i < inputPinNames.size(); i++)
{
- String pinName = inputSupermodelPins.get(i).name;
+ String pinName = inputPinNames.get(i);
textExtent = gc.textExtent(pinName);
gc.drawText(pinName, posX + pinNameMargin, posY + i * pinDistance + (pinDistance - textExtent.y) / 2, true);
}
- for (int i = 0; i < outputSupermodelPins.size(); i++)
+ for (int i = 0; i < outputPinNames.size(); i++)
{
- String pinName = outputSupermodelPins.get(i).name;
+ String pinName = outputPinNames.get(i);
textExtent = gc.textExtent(pinName);
gc.drawText(pinName, posX + width - textExtent.x - pinNameMargin, posY + i * pinDistance + (pinDistance - textExtent.y) / 2,
true);
ret.type = SimpleRectangularSubmodelComponent.class.getSimpleName();
Map<String, Object> m = new TreeMap<>();
m.put(kLabel, label);
- m.put(kInCount, inputSupermodelPins.size());
- m.put(kOutCount, outputSupermodelPins.size());
+ m.put(kInCount, inputPinNames.size());
+ m.put(kOutCount, outputPinNames.size());
m.put(kLogicWidth, logicWidth);
ret.specialized = m;
return ret;
}
@Override
- protected void removeSubmodelInterface(Pin supermodelPin)
+ protected void removeSubmodelInterface(String name)
{
throw new UnsupportedOperationException(
"Can't remove submodel interfaces of a SimpleRectangularSubmodelComponent directly, call setInputPins / setOutputPins instead");
{
protected final ViewModelModifiable submodelModifiable;
public final ViewModel submodel;
- private final Map<MovablePin, MovablePin> submodelPinsPerSupermodelPin;
- private final Map<Pin, Pin> submodelPinsPerSupermodelPinUnmodifiable;
- private final Map<MovablePin, MovablePin> supermodelPinsPerSubmodelPin;
- private final Map<Pin, Pin> supermodelPinsPerSubmodelPinUnmodifiable;
+ private final Map<String, MovablePin> submodelPins;
+ private final Map<String, MovablePin> submodelMovablePinsUnmodifiable;
+ private final Map<String, Pin> submodelUnmovablePinsUnmodifiable;
+ private final Map<String, MovablePin> supermodelPins;
+ private final Map<String, MovablePin> supermodelMovablePinsUnmodifiable;
+ private final Map<String, Pin> supermodelUnmovablePinsUnmodifiable;
private final SubmodelInterface submodelInterface;
private double submodelScale;
super(model);
this.submodelModifiable = new ViewModelModifiable();
this.submodel = submodelModifiable;
- this.submodelPinsPerSupermodelPin = new HashMap<>();
- this.submodelPinsPerSupermodelPinUnmodifiable = Collections.unmodifiableMap(submodelPinsPerSupermodelPin);
- this.supermodelPinsPerSubmodelPin = new HashMap<>();
- this.supermodelPinsPerSubmodelPinUnmodifiable = Collections.unmodifiableMap(supermodelPinsPerSubmodelPin);
+ this.submodelPins = new HashMap<>();
+ this.submodelMovablePinsUnmodifiable = Collections.unmodifiableMap(submodelPins);
+ this.submodelUnmovablePinsUnmodifiable = Collections.unmodifiableMap(submodelPins);
+ this.supermodelPins = new HashMap<>();
+ this.supermodelMovablePinsUnmodifiable = Collections.unmodifiableMap(supermodelPins);
+ this.supermodelUnmovablePinsUnmodifiable = Collections.unmodifiableMap(supermodelPins);
this.submodelInterface = new SubmodelInterface(submodelModifiable);
this.submodelScale = 1;
{
this.submodelScale = submodelScale;
- for (Entry<MovablePin, MovablePin> e : supermodelPinsPerSubmodelPin.entrySet())
- e.getKey().setRelPos(e.getValue().getRelX() * submodelScale, e.getValue().getRelY() * submodelScale);
+ for (Entry<String, MovablePin> e : supermodelPins.entrySet())
+ getSubmodelMovablePin(e.getKey()).setRelPos(e.getValue().getRelX() * submodelScale, e.getValue().getRelY() * submodelScale);
requestRedraw();// needed if there is no submodel interface pin
}
protected Pin addSubmodelInterface(String name, int logicWidth, double relX, double relY)
{
MovablePin submodelPin = new MovablePin(submodelInterface, name, logicWidth, relX / submodelScale, relY / submodelScale);
- submodelInterface.addPin(submodelPin);
-
MovablePin supermodelPin = new MovablePin(this, name, logicWidth, relX, relY);
+
+ submodelPin.addPinMovedListener(p ->
+ {
+ double newRelX = p.getRelX() * submodelScale;
+ double newRelY = p.getRelY() * submodelScale;
+ if (supermodelPin.getRelX() != newRelX || supermodelPin.getRelY() != newRelY)
+ supermodelPin.setRelPos(newRelX, newRelY);
+ });
+ supermodelPin.addPinMovedListener(p ->
+ {
+ double newRelX = p.getRelX() / submodelScale;
+ double newRelY = p.getRelY() / submodelScale;
+ if (submodelPin.getRelX() != newRelX || submodelPin.getRelY() != newRelY)
+ submodelPin.setRelPos(newRelX, newRelY);
+ });
+
+ submodelInterface.addPin(submodelPin);
super.addPin(supermodelPin);
- submodelPinsPerSupermodelPin.put(supermodelPin, submodelPin);
- supermodelPinsPerSubmodelPin.put(submodelPin, supermodelPin);
+ submodelPins.put(name, submodelPin);
+ supermodelPins.put(name, supermodelPin);
// no need to call requestRedraw() because addPin() will request a redraw
return submodelPin;
}
- protected void moveSubmodelInterface(Pin supermodelPin, double relX, double relY)
+ protected void removeSubmodelInterface(String name)
{
- MovablePin submodelPin = getSubmodelMovablePin(supermodelPin);
- MovablePin supermodelPinMovable = getSupermodelMovablePin(submodelPin);
+ super.removePin(name);
+ Pin submodelPin = getSubmodelMovablePin(name);
+ submodelInterface.removePin(submodelPin.name);
- submodelPin.setRelPos(relX / submodelScale, relY / submodelScale);
- supermodelPinMovable.setRelPos(relX, relY);
+ submodelPins.remove(name);
+ supermodelPins.remove(name);
- // no need to call requestRedraw() because setRelPos() will request a redraw
+ // no need to call requestRedraw() because removePin() will request a redraw
}
- protected void removeSubmodelInterface(Pin supermodelPin)
+ public Map<String, Pin> getSubmodelPins()
{
- super.removePin(supermodelPin);
- Pin submodelPin = getSubmodelMovablePin(supermodelPin);
- submodelInterface.removePin(submodelPin);
-
- submodelPinsPerSupermodelPin.remove(supermodelPin);
- supermodelPinsPerSubmodelPin.remove(submodelPin);
+ return submodelUnmovablePinsUnmodifiable;
+ }
- // no need to call requestRedraw() because removePin() will request a redraw
+ public Pin getSubmodelPin(String name)
+ {
+ return getSubmodelMovablePin(name);
}
- public Map<Pin, Pin> getSupermodelPinsPerSubmodelPin()
+ protected Map<String, MovablePin> getSubmodelMovablePins()
{
- return supermodelPinsPerSubmodelPinUnmodifiable;
+ return submodelMovablePinsUnmodifiable;
}
- public Pin getSupermodelPin(Pin submodelPin)
+ protected MovablePin getSubmodelMovablePin(String name)
{
- return getSupermodelMovablePin(submodelPin);
+ return submodelPins.get(name);
}
- protected MovablePin getSupermodelMovablePin(Pin submodelPin)
+ public Map<String, Pin> getSupermodelPins()
{
- return supermodelPinsPerSubmodelPin.get(submodelPin);
+ return supermodelUnmovablePinsUnmodifiable;
}
- public Map<Pin, Pin> getSubmodelPinsPerSupermodelPin()
+ public Pin getSupermodelPin(String name)
{
- return submodelPinsPerSupermodelPinUnmodifiable;
+ return getSupermodelMovablePin(name);
}
- public Pin getSubmodelPin(Pin supermodelPin)
+ protected Map<String, MovablePin> getSupermodelMovablePins()
{
- return getSubmodelMovablePin(supermodelPin);
+ return supermodelMovablePinsUnmodifiable;
}
- protected MovablePin getSubmodelMovablePin(Pin supermodelPin)
+ protected MovablePin getSupermodelMovablePin(String name)
{
- return submodelPinsPerSupermodelPin.get(supermodelPin);
+ return supermodelPins.get(name);
}
@Override
params.width = bounds.width;
params.height = bounds.height;
- List<Pin> pinList = pinsUnmodifiable;
- InterfacePinParams[] iPins = new InterfacePinParams[pinList.size()];
+ InterfacePinParams[] iPins = new InterfacePinParams[getPins().size()];
int i = 0;
- for (Pin p : pinList)
+ for (Pin p : getPins())
{
InterfacePinParams iPinParams = new InterfacePinParams();
iPins[i] = iPinParams;
GUIComponent component = componentIt.next();
InnerComponentParams inner = new InnerComponentParams();
comps[i] = inner;
- inner.logicWidth = component.getPins().get(0).logicWidth; // This could be done a little more elegantly
+ inner.logicWidth = component.getPins().iterator().next().logicWidth; // TODO This could be done a little more elegantly
Rectangle bounds = component.getBounds();
inner.pos = new Point(bounds.x, bounds.y);
inner.type = component.getIdentifier();
wires[i] = inner;
InnerPinParams pin1Params = new InnerPinParams(), pin2Params = new InnerPinParams();
- pin1Params.pinIndex = wire.getPin1().component.getPins().indexOf(wire.getPin1());
+ pin1Params.pinName = wire.getPin1().name;
pin1Params.compId = compList.indexOf(wire.getPin1().component);
- pin2Params.pinIndex = wire.getPin2().component.getPins().indexOf(wire.getPin2());
+ pin2Params.pinName = wire.getPin2().name;
pin2Params.compId = compList.indexOf(wire.getPin2().component);
inner.pin1 = pin1Params;
inner.pin2 = pin2Params;
}
@Override
- protected void removePin(Pin pin)
+ protected void removePin(String name)
{
throw new UnsupportedOperationException("Can't remove pins of a SubmodelComponent directly, call removeSubmodelInterface instead");
}
public static class InnerPinParams
{
- public int compId, pinIndex;
+ public int compId;
+ public String pinName;
}
public static class ComponentCompositionParams
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin _S = getInputSubmodelPins().get(0);
- Pin _R = getInputSubmodelPins().get(1);
- Pin Q = getOutputSubmodelPins().get(0);
- Pin _Q = getOutputSubmodelPins().get(1);
+ Pin _S = getSubmodelPin("_S");
+ Pin _R = getSubmodelPin("_R");
+ Pin Q = getSubmodelPin("Q");
+ Pin _Q = getSubmodelPin("_Q");
GUINandGate nand1 = new GUINandGate(submodelModifiable, 1);
GUINandGate nand2 = new GUINandGate(submodelModifiable, 1);
cp1.moveCenterTo(35, 17.5);
cp2.moveCenterTo(65, 37.5);
- new GUIWire(submodelModifiable, _S, nand1.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, _R, nand2.getInputPins().get(1), new Point(35, 37.5), new Point(35, 27.5));
- new GUIWire(submodelModifiable, nand1.getOutputPin(), cp1, new Point[0]);
- new GUIWire(submodelModifiable, nand2.getOutputPin(), cp2, new Point(65, 22.5));
- new GUIWire(submodelModifiable, cp1, nand2.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cp2, nand1.getInputPins().get(1), new Point(65, 42.5), new Point(5, 42.5), new Point(5, 22.5));
+ new GUIWire(submodelModifiable, _S, nand1.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, _R, nand2.getPin("B"), new Point(35, 37.5), new Point(35, 27.5));
+ new GUIWire(submodelModifiable, nand1.getPin("Y"), cp1, new Point[0]);
+ new GUIWire(submodelModifiable, nand2.getPin("Y"), cp2, new Point(65, 22.5));
+ new GUIWire(submodelModifiable, cp1, nand2.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, cp2, nand1.getPin("B"), new Point(65, 42.5), new Point(5, 42.5), new Point(5, 22.5));
new GUIWire(submodelModifiable, cp1, Q, new Point(35, 17.5), new Point(35, 7.5), new Point(65, 7.5), new Point(65, 12.5));
new GUIWire(submodelModifiable, cp2, _Q, new Point[0]);
}
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin A = getInputSubmodelPins().get(0);
- Pin B = getInputSubmodelPins().get(1);
- Pin Y = getOutputSubmodelPins().get(0);
+ Pin A = getSubmodelPin("A");
+ Pin B = getSubmodelPin("B");
+ Pin Y = getSubmodelPin("Y");
GUINandGate nand = new GUINandGate(submodelModifiable, 1);
GUINandGate not = new GUINandGate(submodelModifiable, 1);
not.moveTo(50, 15);
cp1.moveCenterTo(45, 25);
- new GUIWire(submodelModifiable, A, nand.getInputPins().get(0));
- new GUIWire(submodelModifiable, B, nand.getInputPins().get(1));
- new GUIWire(submodelModifiable, nand.getOutputPin(), cp1, new Point[0]);
- new GUIWire(submodelModifiable, cp1, not.getInputPins().get(0), new Point(45, 20));
- new GUIWire(submodelModifiable, cp1, not.getInputPins().get(1), new Point(45, 30));
- new GUIWire(submodelModifiable, not.getOutputPin(), Y);
+ new GUIWire(submodelModifiable, A, nand.getPin("A"));
+ new GUIWire(submodelModifiable, B, nand.getPin("B"));
+ new GUIWire(submodelModifiable, nand.getPin("Y"), cp1, new Point[0]);
+ new GUIWire(submodelModifiable, cp1, not.getPin("A"), new Point(45, 20));
+ new GUIWire(submodelModifiable, cp1, not.getPin("B"), new Point(45, 30));
+ new GUIWire(submodelModifiable, not.getPin("Y"), Y);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin A1 = getInputSubmodelPins().get(0);
- Pin A2 = getInputSubmodelPins().get(1);
- Pin A3 = getInputSubmodelPins().get(2);
- Pin A4 = getInputSubmodelPins().get(3);
- Pin B = getInputSubmodelPins().get(4);
- Pin Y1 = getOutputSubmodelPins().get(0);
- Pin Y2 = getOutputSubmodelPins().get(1);
- Pin Y3 = getOutputSubmodelPins().get(2);
- Pin Y4 = getOutputSubmodelPins().get(3);
+ Pin A1 = getSubmodelPin("A1");
+ Pin A2 = getSubmodelPin("A2");
+ Pin A3 = getSubmodelPin("A3");
+ Pin A4 = getSubmodelPin("A4");
+ Pin B = getSubmodelPin("B");
+ Pin Y1 = getSubmodelPin("Y1");
+ Pin Y2 = getSubmodelPin("Y2");
+ Pin Y3 = getSubmodelPin("Y3");
+ Pin Y4 = getSubmodelPin("Y4");
GUIand and1 = new GUIand(submodelModifiable);
GUIand and2 = new GUIand(submodelModifiable);
cpB3.moveCenterTo(25, 72.5);
cpB4.moveCenterTo(25, 97.5);
- new GUIWire(submodelModifiable, A1, and1.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, A2, and2.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, A3, and3.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, A4, and4.getInputPins().get(0), new Point[0]);
+ new GUIWire(submodelModifiable, A1, and1.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, A2, and2.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, A3, and3.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, A4, and4.getPin("A"), new Point[0]);
new GUIWire(submodelModifiable, B, cpB4, new Point(25, 112.5));
- new GUIWire(submodelModifiable, cpB4, and4.getInputPins().get(1), new Point[0]);
+ new GUIWire(submodelModifiable, cpB4, and4.getPin("B"), new Point[0]);
new GUIWire(submodelModifiable, cpB4, cpB3, new Point[0]);
- new GUIWire(submodelModifiable, cpB3, and3.getInputPins().get(1), new Point[0]);
+ new GUIWire(submodelModifiable, cpB3, and3.getPin("B"), new Point[0]);
new GUIWire(submodelModifiable, cpB3, cpB2, new Point[0]);
- new GUIWire(submodelModifiable, cpB2, and2.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpB2, and1.getInputPins().get(1), new Point(25, 22.5));
- new GUIWire(submodelModifiable, and1.getOutputPins().get(0), Y1, new Point[0]);
- new GUIWire(submodelModifiable, and2.getOutputPins().get(0), Y2, new Point[0]);
- new GUIWire(submodelModifiable, and3.getOutputPins().get(0), Y3, new Point[0]);
- new GUIWire(submodelModifiable, and4.getOutputPins().get(0), Y4, new Point[0]);
+ new GUIWire(submodelModifiable, cpB2, and2.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, cpB2, and1.getPin("B"), new Point(25, 22.5));
+ new GUIWire(submodelModifiable, and1.getPin("Y"), Y1, new Point[0]);
+ new GUIWire(submodelModifiable, and2.getPin("Y"), Y2, new Point[0]);
+ new GUIWire(submodelModifiable, and3.getPin("Y"), Y3, new Point[0]);
+ new GUIWire(submodelModifiable, and4.getPin("Y"), Y4, new Point[0]);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin C1 = getInputSubmodelPins().get(0);
- Pin C2 = getInputSubmodelPins().get(1);
- Pin C3 = getInputSubmodelPins().get(2);
- Pin C4 = getInputSubmodelPins().get(3);
- Pin A1 = getInputSubmodelPins().get(4);
- Pin A2 = getInputSubmodelPins().get(5);
- Pin A3 = getInputSubmodelPins().get(6);
- Pin A4 = getInputSubmodelPins().get(7);
- Pin B = getInputSubmodelPins().get(8);
- Pin Y1 = getOutputSubmodelPins().get(0);
- Pin Y2 = getOutputSubmodelPins().get(1);
- Pin Y3 = getOutputSubmodelPins().get(2);
- Pin Y4 = getOutputSubmodelPins().get(3);
+ Pin C1 = getSubmodelPin("C1");
+ Pin C2 = getSubmodelPin("C2");
+ Pin C3 = getSubmodelPin("C3");
+ Pin C4 = getSubmodelPin("C4");
+ Pin A1 = getSubmodelPin("A1");
+ Pin A2 = getSubmodelPin("A2");
+ Pin A3 = getSubmodelPin("A3");
+ Pin A4 = getSubmodelPin("A4");
+ Pin B = getSubmodelPin("B");
+ Pin Y1 = getSubmodelPin("Y1");
+ Pin Y2 = getSubmodelPin("Y2");
+ Pin Y3 = getSubmodelPin("Y3");
+ Pin Y4 = getSubmodelPin("Y4");
GUIand41 and = new GUIand41(submodelModifiable);
GUIor_4 or = new GUIor_4(submodelModifiable);
and.moveTo(15, 137.5);
or.moveTo(35, 37.5);
- new GUIWire(submodelModifiable, A1, and.getInputPins().get(0), new Point(10, 112.5), new Point(10, 142.5));
- new GUIWire(submodelModifiable, A2, and.getInputPins().get(1), new Point(5, 137.5), new Point(5, 152.5));
- new GUIWire(submodelModifiable, A3, and.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, A4, and.getInputPins().get(3), new Point(5, 187.5), new Point(5, 172.5));
- new GUIWire(submodelModifiable, B, and.getInputPins().get(4), new Point(10, 212.5), new Point(10, 182.5));
- new GUIWire(submodelModifiable, C1, or.getInputPins().get(0), new Point(10, 12.5), new Point(10, 42.5));
- new GUIWire(submodelModifiable, C2, or.getInputPins().get(1), new Point(5, 37.5), new Point(5, 52.5));
- new GUIWire(submodelModifiable, C3, or.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, C4, or.getInputPins().get(3), new Point(5, 87.5), new Point(5, 72.5));
- new GUIWire(submodelModifiable, and.getOutputPins().get(0), or.getInputPins().get(4), new Point(70, 142.5), new Point(70, 120),
- new Point(30, 120), new Point(30, 82.5));
- new GUIWire(submodelModifiable, and.getOutputPins().get(1), or.getInputPins().get(5), new Point(65, 152.5), new Point(65, 125),
- new Point(25, 125), new Point(25, 92.5));
- new GUIWire(submodelModifiable, and.getOutputPins().get(2), or.getInputPins().get(6), new Point(60, 162.5), new Point(60, 130),
- new Point(20, 130), new Point(20, 102.5));
- new GUIWire(submodelModifiable, and.getOutputPins().get(3), or.getInputPins().get(7), new Point(55, 172.5), new Point(55, 135),
- new Point(15, 135), new Point(15, 112.5));
- new GUIWire(submodelModifiable, or.getOutputPins().get(0), Y1, new Point(75, 42.5), new Point(75, 12.5));
- new GUIWire(submodelModifiable, or.getOutputPins().get(1), Y2, new Point(80, 52.5), new Point(80, 37.5));
- new GUIWire(submodelModifiable, or.getOutputPins().get(2), Y3, new Point[0]);
- new GUIWire(submodelModifiable, or.getOutputPins().get(3), Y4, new Point(80, 72.5), new Point(80, 87.5));
+ new GUIWire(submodelModifiable, A1, and.getPin("A1"), new Point(10, 112.5), new Point(10, 142.5));
+ new GUIWire(submodelModifiable, A2, and.getPin("A2"), new Point(5, 137.5), new Point(5, 152.5));
+ new GUIWire(submodelModifiable, A3, and.getPin("A3"), new Point[0]);
+ new GUIWire(submodelModifiable, A4, and.getPin("A4"), new Point(5, 187.5), new Point(5, 172.5));
+ new GUIWire(submodelModifiable, B, and.getPin("B"), new Point(10, 212.5), new Point(10, 182.5));
+ new GUIWire(submodelModifiable, C1, or.getPin("A1"), new Point(10, 12.5), new Point(10, 42.5));
+ new GUIWire(submodelModifiable, C2, or.getPin("A2"), new Point(5, 37.5), new Point(5, 52.5));
+ new GUIWire(submodelModifiable, C3, or.getPin("A3"), new Point[0]);
+ new GUIWire(submodelModifiable, C4, or.getPin("A4"), new Point(5, 87.5), new Point(5, 72.5));
+ new GUIWire(submodelModifiable, and.getPin("Y1"), or.getPin("B1"), new Point(70, 142.5), new Point(70, 120), new Point(30, 120),
+ new Point(30, 82.5));
+ new GUIWire(submodelModifiable, and.getPin("Y2"), or.getPin("B2"), new Point(65, 152.5), new Point(65, 125), new Point(25, 125),
+ new Point(25, 92.5));
+ new GUIWire(submodelModifiable, and.getPin("Y3"), or.getPin("B3"), new Point(60, 162.5), new Point(60, 130), new Point(20, 130),
+ new Point(20, 102.5));
+ new GUIWire(submodelModifiable, and.getPin("Y4"), or.getPin("B4"), new Point(55, 172.5), new Point(55, 135), new Point(15, 135),
+ new Point(15, 112.5));
+ new GUIWire(submodelModifiable, or.getPin("Y1"), Y1, new Point(75, 42.5), new Point(75, 12.5));
+ new GUIWire(submodelModifiable, or.getPin("Y2"), Y2, new Point(80, 52.5), new Point(80, 37.5));
+ new GUIWire(submodelModifiable, or.getPin("Y3"), Y3, new Point[0]);
+ new GUIWire(submodelModifiable, or.getPin("Y4"), Y4, new Point(80, 72.5), new Point(80, 87.5));
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin S0 = getInputSubmodelPins().get(0);
- Pin S1 = getInputSubmodelPins().get(1);
- Pin Y00 = getOutputSubmodelPins().get(0);
- Pin Y01 = getOutputSubmodelPins().get(1);
- Pin Y10 = getOutputSubmodelPins().get(2);
- Pin Y11 = getOutputSubmodelPins().get(3);
+ Pin S0 = getSubmodelPin("S0");
+ Pin S1 = getSubmodelPin("S1");
+ Pin Y00 = getSubmodelPin("Y00");
+ Pin Y01 = getSubmodelPin("Y01");
+ Pin Y10 = getSubmodelPin("Y10");
+ Pin Y11 = getSubmodelPin("Y11");
GUINandGate notS0 = new GUINandGate(submodelModifiable, 1);
GUINandGate notS1 = new GUINandGate(submodelModifiable, 1);
new GUIWire(submodelModifiable, S0, cpS01, new Point[0]);
new GUIWire(submodelModifiable, S1, cpS11, new Point[0]);
- new GUIWire(submodelModifiable, cpS01, notS0.getInputPins().get(0), new Point(7.5, 7.5));
- new GUIWire(submodelModifiable, cpS11, notS1.getInputPins().get(0), new Point(5, 32.5));
+ new GUIWire(submodelModifiable, cpS01, notS0.getPin("A"), new Point(7.5, 7.5));
+ new GUIWire(submodelModifiable, cpS11, notS1.getPin("A"), new Point(5, 32.5));
new GUIWire(submodelModifiable, cpS01, cpS02, new Point[0]);
new GUIWire(submodelModifiable, cpS11, cpS12, new Point[0]);
- new GUIWire(submodelModifiable, cpS02, notS0.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpS12, notS1.getInputPins().get(1), new Point[0]);
+ new GUIWire(submodelModifiable, cpS02, notS0.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, cpS12, notS1.getPin("B"), new Point[0]);
new GUIWire(submodelModifiable, cpS02, cpS03, new Point(7.5, 62.5));
new GUIWire(submodelModifiable, cpS12, cpS13, new Point(5, 67.5), new Point(32.5, 67.5));
- new GUIWire(submodelModifiable, notS0.getOutputPin(), cpNotS0, new Point[0]);
- new GUIWire(submodelModifiable, notS1.getOutputPin(), cpNotS1, new Point[0]);
- new GUIWire(submodelModifiable, cpNotS0, andY00.getInputPins().get(0), new Point(32.5, 7.5));
- new GUIWire(submodelModifiable, cpNotS1, andY00.getInputPins().get(1), new Point(35, 17.5));
- new GUIWire(submodelModifiable, cpS03, andY01.getInputPins().get(0), new Point(37.5, 32.5));
- new GUIWire(submodelModifiable, cpNotS1, andY01.getInputPins().get(1), new Point(35, 42.5));
- new GUIWire(submodelModifiable, cpNotS0, andY10.getInputPins().get(0), new Point(32.5, 57.5));
- new GUIWire(submodelModifiable, cpS13, andY10.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpS03, andY11.getInputPins().get(0), new Point(37.5, 82.5));
- new GUIWire(submodelModifiable, cpS13, andY11.getInputPins().get(1), new Point(32.5, 92.5));
- new GUIWire(submodelModifiable, andY00.getOutputPins().get(0), Y00);
- new GUIWire(submodelModifiable, andY01.getOutputPins().get(0), Y01);
- new GUIWire(submodelModifiable, andY10.getOutputPins().get(0), Y10);
- new GUIWire(submodelModifiable, andY11.getOutputPins().get(0), Y11);
+ new GUIWire(submodelModifiable, notS0.getPin("Y"), cpNotS0, new Point[0]);
+ new GUIWire(submodelModifiable, notS1.getPin("Y"), cpNotS1, new Point[0]);
+ new GUIWire(submodelModifiable, cpNotS0, andY00.getPin("A"), new Point(32.5, 7.5));
+ new GUIWire(submodelModifiable, cpNotS1, andY00.getPin("B"), new Point(35, 17.5));
+ new GUIWire(submodelModifiable, cpS03, andY01.getPin("A"), new Point(37.5, 32.5));
+ new GUIWire(submodelModifiable, cpNotS1, andY01.getPin("B"), new Point(35, 42.5));
+ new GUIWire(submodelModifiable, cpNotS0, andY10.getPin("A"), new Point(32.5, 57.5));
+ new GUIWire(submodelModifiable, cpS13, andY10.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, cpS03, andY11.getPin("A"), new Point(37.5, 82.5));
+ new GUIWire(submodelModifiable, cpS13, andY11.getPin("B"), new Point(32.5, 92.5));
+ new GUIWire(submodelModifiable, andY00.getPin("Y"), Y00);
+ new GUIWire(submodelModifiable, andY01.getPin("Y"), Y01);
+ new GUIWire(submodelModifiable, andY10.getPin("Y"), Y10);
+ new GUIWire(submodelModifiable, andY11.getPin("Y"), Y11);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin C = getInputSubmodelPins().get(0);
- Pin D = getInputSubmodelPins().get(1);
- Pin Q = getOutputSubmodelPins().get(0);
- Pin _Q = getOutputSubmodelPins().get(1);
+ Pin C = getSubmodelPin("C");
+ Pin D = getSubmodelPin("D");
+ Pin Q = getSubmodelPin("Q");
+ Pin _Q = getSubmodelPin("_Q");
GUI_rsLatch _rsLatch1 = new GUI_rsLatch(submodelModifiable);
GUInand3 nand3 = new GUInand3(submodelModifiable);
cp4.moveCenterTo(100, 45);
new GUIWire(submodelModifiable, C, cp1, new Point[0]);
- new GUIWire(submodelModifiable, cp1, _rsLatch1.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cp1, nand3.getInputPins().get(1), new Point(10, 55));
- new GUIWire(submodelModifiable, D, nand2.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, nand2.getOutputPin(), cp2, new Point(145, 70), new Point(145, 85), new Point(20, 85));
- new GUIWire(submodelModifiable, cp2, _rsLatch1.getInputPins().get(0), new Point(20, 15));
- new GUIWire(submodelModifiable, cp2, nand3.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, _rsLatch1.getOutputPins().get(1), cp3, new Point(100, 25));
- new GUIWire(submodelModifiable, cp3, nand3.getInputPins().get(0), new Point(30, 35), new Point(30, 45));
- new GUIWire(submodelModifiable, cp3, _rsLatch2.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, nand3.getOutputPins().get(0), cp4, new Point[0]);
- new GUIWire(submodelModifiable, cp4, _rsLatch2.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cp4, nand2.getInputPins().get(0), new Point(100, 65));
- new GUIWire(submodelModifiable, _rsLatch2.getOutputPins().get(0), Q);
- new GUIWire(submodelModifiable, _rsLatch2.getOutputPins().get(1), _Q);
+ new GUIWire(submodelModifiable, cp1, _rsLatch1.getPin("_R"), new Point[0]);
+ new GUIWire(submodelModifiable, cp1, nand3.getPin("B"), new Point(10, 55));
+ new GUIWire(submodelModifiable, D, nand2.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, nand2.getPin("Y"), cp2, new Point(145, 70), new Point(145, 85), new Point(20, 85));
+ new GUIWire(submodelModifiable, cp2, _rsLatch1.getPin("_S"), new Point(20, 15));
+ new GUIWire(submodelModifiable, cp2, nand3.getPin("C"), new Point[0]);
+ new GUIWire(submodelModifiable, _rsLatch1.getPin("_Q"), cp3, new Point(100, 25));
+ new GUIWire(submodelModifiable, cp3, nand3.getPin("A"), new Point(30, 35), new Point(30, 45));
+ new GUIWire(submodelModifiable, cp3, _rsLatch2.getPin("_S"), new Point[0]);
+ new GUIWire(submodelModifiable, nand3.getPin("Y"), cp4, new Point[0]);
+ new GUIWire(submodelModifiable, cp4, _rsLatch2.getPin("_R"), new Point[0]);
+ new GUIWire(submodelModifiable, cp4, nand2.getPin("A"), new Point(100, 65));
+ new GUIWire(submodelModifiable, _rsLatch2.getPin("Q"), Q);
+ new GUIWire(submodelModifiable, _rsLatch2.getPin("_Q"), _Q);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin D = getInputSubmodelPins().get(0);
- Pin E = getInputSubmodelPins().get(1);
- Pin Q = getOutputSubmodelPins().get(0);
- Pin _Q = getOutputSubmodelPins().get(1);
+ Pin D = getSubmodelPin("D");
+ Pin E = getSubmodelPin("E");
+ Pin Q = getSubmodelPin("Q");
+ Pin _Q = getSubmodelPin("_Q");
GUINandGate nand1 = new GUINandGate(submodelModifiable, 1);
GUINandGate nand2 = new GUINandGate(submodelModifiable, 1);
cp1.moveCenterTo(5, 37.5);
cp2.moveCenterTo(35, 12.5);
- new GUIWire(submodelModifiable, D, nand1.getInputPins().get(0));
+ new GUIWire(submodelModifiable, D, nand1.getPin("A"));
new GUIWire(submodelModifiable, E, cp1, new Point[0]);
- new GUIWire(submodelModifiable, cp1, nand1.getInputPins().get(1), new Point(5, 17.5));
- new GUIWire(submodelModifiable, cp1, nand2.getInputPins().get(1), new Point(5, 42.5));
- new GUIWire(submodelModifiable, nand1.getOutputPin(), cp2, new Point[0]);
- new GUIWire(submodelModifiable, cp2, nand2.getInputPins().get(0), new Point(35, 25), new Point(10, 25), new Point(10, 32.5));
- new GUIWire(submodelModifiable, cp2, _rsLatch.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, nand2.getOutputPin(), _rsLatch.getInputPins().get(1), new Point(40, 37.5), new Point(40, 22.5));
- new GUIWire(submodelModifiable, _rsLatch.getOutputPins().get(0), Q, new Point[0]);
- new GUIWire(submodelModifiable, _rsLatch.getOutputPins().get(1), _Q);
+ new GUIWire(submodelModifiable, cp1, nand1.getPin("B"), new Point(5, 17.5));
+ new GUIWire(submodelModifiable, cp1, nand2.getPin("B"), new Point(5, 42.5));
+ new GUIWire(submodelModifiable, nand1.getPin("Y"), cp2, new Point[0]);
+ new GUIWire(submodelModifiable, cp2, nand2.getPin("A"), new Point(35, 25), new Point(10, 25), new Point(10, 32.5));
+ new GUIWire(submodelModifiable, cp2, _rsLatch.getPin("_S"), new Point[0]);
+ new GUIWire(submodelModifiable, nand2.getPin("Y"), _rsLatch.getPin("_R"), new Point(40, 37.5), new Point(40, 22.5));
+ new GUIWire(submodelModifiable, _rsLatch.getPin("Q"), Q, new Point[0]);
+ new GUIWire(submodelModifiable, _rsLatch.getPin("_Q"), _Q);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin D1 = getInputSubmodelPins().get(0);
- Pin D2 = getInputSubmodelPins().get(1);
- Pin D3 = getInputSubmodelPins().get(2);
- Pin D4 = getInputSubmodelPins().get(3);
- Pin C = getInputSubmodelPins().get(4);
- Pin Q1 = getOutputSubmodelPins().get(0);
- Pin Q2 = getOutputSubmodelPins().get(1);
- Pin Q3 = getOutputSubmodelPins().get(2);
- Pin Q4 = getOutputSubmodelPins().get(3);
+ Pin D1 = getSubmodelPin("D1");
+ Pin D2 = getSubmodelPin("D2");
+ Pin D3 = getSubmodelPin("D3");
+ Pin D4 = getSubmodelPin("D4");
+ Pin C = getSubmodelPin("C");
+ Pin Q1 = getSubmodelPin("Q1");
+ Pin Q2 = getSubmodelPin("Q2");
+ Pin Q3 = getSubmodelPin("Q3");
+ Pin Q4 = getSubmodelPin("Q4");
GUIdlatch dlatch1 = new GUIdlatch(submodelModifiable);
GUIdlatch dlatch2 = new GUIdlatch(submodelModifiable);
cp4.moveCenterTo(15, 97.5);
new GUIWire(submodelModifiable, C, cp4, new Point(15, 112.5));
- new GUIWire(submodelModifiable, cp4, dlatch4.getInputPins().get(1), new Point[0]);
+ new GUIWire(submodelModifiable, cp4, dlatch4.getPin("E"), new Point[0]);
new GUIWire(submodelModifiable, cp4, cp3, new Point[0]);
- new GUIWire(submodelModifiable, cp3, dlatch3.getInputPins().get(1), new Point[0]);
+ new GUIWire(submodelModifiable, cp3, dlatch3.getPin("E"), new Point[0]);
new GUIWire(submodelModifiable, cp3, cp2, new Point[0]);
- new GUIWire(submodelModifiable, cp2, dlatch2.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cp2, dlatch1.getInputPins().get(1), new Point(15, 22.5));
- new GUIWire(submodelModifiable, D1, dlatch1.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, D2, dlatch2.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, D3, dlatch3.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, D4, dlatch4.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, dlatch1.getOutputPins().get(0), Q1, new Point[0]);
- new GUIWire(submodelModifiable, dlatch2.getOutputPins().get(0), Q2, new Point[0]);
- new GUIWire(submodelModifiable, dlatch3.getOutputPins().get(0), Q3, new Point[0]);
- new GUIWire(submodelModifiable, dlatch4.getOutputPins().get(0), Q4, new Point[0]);
+ new GUIWire(submodelModifiable, cp2, dlatch2.getPin("E"), new Point[0]);
+ new GUIWire(submodelModifiable, cp2, dlatch1.getPin("E"), new Point(15, 22.5));
+ new GUIWire(submodelModifiable, D1, dlatch1.getPin("D"), new Point[0]);
+ new GUIWire(submodelModifiable, D2, dlatch2.getPin("D"), new Point[0]);
+ new GUIWire(submodelModifiable, D3, dlatch3.getPin("D"), new Point[0]);
+ new GUIWire(submodelModifiable, D4, dlatch4.getPin("D"), new Point[0]);
+ new GUIWire(submodelModifiable, dlatch1.getPin("Q"), Q1, new Point[0]);
+ new GUIWire(submodelModifiable, dlatch2.getPin("Q"), Q2, new Point[0]);
+ new GUIWire(submodelModifiable, dlatch3.getPin("Q"), Q3, new Point[0]);
+ new GUIWire(submodelModifiable, dlatch4.getPin("Q"), Q4, new Point[0]);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin A = getInputSubmodelPins().get(0);
- Pin B = getInputSubmodelPins().get(1);
- Pin C = getInputSubmodelPins().get(2);
- Pin Y = getOutputSubmodelPins().get(0);
- Pin Z = getOutputSubmodelPins().get(1);
+ Pin A = getSubmodelPin("A");
+ Pin B = getSubmodelPin("B");
+ Pin C = getSubmodelPin("C");
+ Pin Y = getSubmodelPin("Y");
+ Pin Z = getSubmodelPin("Z");
GUIhalfadder halfBC = new GUIhalfadder(submodelModifiable);
GUIhalfadder halfAY = new GUIhalfadder(submodelModifiable);
halfBC.moveTo(5, 40);
nandZ.moveTo(57.5, 40);
- new GUIWire(submodelModifiable, A, halfAY.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, B, halfBC.getInputPins().get(0));
- new GUIWire(submodelModifiable, C, halfBC.getInputPins().get(1));
- new GUIWire(submodelModifiable, halfBC.getOutputPins().get(0), halfAY.getInputPins().get(1));
- new GUIWire(submodelModifiable, halfBC.getOutputPins().get(1), nandZ.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, halfAY.getOutputPins().get(0), Y, new Point[0]);
- new GUIWire(submodelModifiable, halfAY.getOutputPins().get(1), nandZ.getInputPins().get(0), new Point(82.5, 22.5),
- new Point(82.5, 35), new Point(52.5, 35), new Point(52.5, 45));
- new GUIWire(submodelModifiable, nandZ.getOutputPin(), Z);
+ new GUIWire(submodelModifiable, A, halfAY.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, B, halfBC.getPin("A"));
+ new GUIWire(submodelModifiable, C, halfBC.getPin("B"));
+ new GUIWire(submodelModifiable, halfBC.getPin("Y"), halfAY.getPin("B"));
+ new GUIWire(submodelModifiable, halfBC.getPin("_Z"), nandZ.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, halfAY.getPin("Y"), Y, new Point[0]);
+ new GUIWire(submodelModifiable, halfAY.getPin("_Z"), nandZ.getPin("A"), new Point(82.5, 22.5), new Point(82.5, 35),
+ new Point(52.5, 35), new Point(52.5, 45));
+ new GUIWire(submodelModifiable, nandZ.getPin("Y"), Z);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin A = getInputSubmodelPins().get(0);
- Pin B = getInputSubmodelPins().get(1);
- Pin Y = getOutputSubmodelPins().get(0);
- Pin _Z = getOutputSubmodelPins().get(1);
+ Pin A = getSubmodelPin("A");
+ Pin B = getSubmodelPin("B");
+ Pin Y = getSubmodelPin("Y");
+ Pin _Z = getSubmodelPin("_Z");
GUINandGate nand_Z = new GUINandGate(submodelModifiable, 1);
GUINandGate nandYA = new GUINandGate(submodelModifiable, 1);
cp_Z.moveCenterTo(35, 25);
new GUIWire(submodelModifiable, A, cpA, new Point[0]);
- new GUIWire(submodelModifiable, cpA, nandYA.getInputPins().get(0), new Point(5, 7.5));
- new GUIWire(submodelModifiable, cpA, nand_Z.getInputPins().get(0), new Point(5, 20));
+ new GUIWire(submodelModifiable, cpA, nandYA.getPin("A"), new Point(5, 7.5));
+ new GUIWire(submodelModifiable, cpA, nand_Z.getPin("A"), new Point(5, 20));
new GUIWire(submodelModifiable, B, cpB, new Point[0]);
- new GUIWire(submodelModifiable, cpB, nandYB.getInputPins().get(1), new Point(5, 42.5));
- new GUIWire(submodelModifiable, cpB, nand_Z.getInputPins().get(1), new Point(5, 30));
- new GUIWire(submodelModifiable, nand_Z.getOutputPin(), cp_Z, new Point[0]);
+ new GUIWire(submodelModifiable, cpB, nandYB.getPin("B"), new Point(5, 42.5));
+ new GUIWire(submodelModifiable, cpB, nand_Z.getPin("B"), new Point(5, 30));
+ new GUIWire(submodelModifiable, nand_Z.getPin("Y"), cp_Z, new Point[0]);
new GUIWire(submodelModifiable, cp_Z, _Z, new Point(80, 25), new Point(80, 37.5));
- new GUIWire(submodelModifiable, cp_Z, nandYA.getInputPins().get(1), new Point(35, 17.5));
- new GUIWire(submodelModifiable, cp_Z, nandYB.getInputPins().get(0), new Point(35, 32.5));
- new GUIWire(submodelModifiable, nandYA.getOutputPin(), nandY.getInputPins().get(0), new Point(62.5, 12.5), new Point(62.5, 7.5));
- new GUIWire(submodelModifiable, nandYB.getOutputPin(), nandY.getInputPins().get(1), new Point(62.5, 37.5), new Point(62.5, 17.5));
- new GUIWire(submodelModifiable, nandY.getOutputPin(), Y, new Point[0]);
+ new GUIWire(submodelModifiable, cp_Z, nandYA.getPin("B"), new Point(35, 17.5));
+ new GUIWire(submodelModifiable, cp_Z, nandYB.getPin("A"), new Point(35, 32.5));
+ new GUIWire(submodelModifiable, nandYA.getPin("Y"), nandY.getPin("A"), new Point(62.5, 12.5), new Point(62.5, 7.5));
+ new GUIWire(submodelModifiable, nandYB.getPin("Y"), nandY.getPin("B"), new Point(62.5, 37.5), new Point(62.5, 17.5));
+ new GUIWire(submodelModifiable, nandY.getPin("Y"), Y, new Point[0]);
}
}
\ No newline at end of file
@SuppressWarnings("unused")
private void initSubmodelComponents()
{
- Pin S0 = getInputSubmodelPins().get(0);
- Pin I0 = getInputSubmodelPins().get(1);
- Pin I1 = getInputSubmodelPins().get(2);
- Pin Y = getOutputSubmodelPins().get(0);
+ Pin S0 = getSubmodelPin("S0");
+ Pin I0 = getSubmodelPin("I0");
+ Pin I1 = getSubmodelPin("I1");
+ Pin Y = getSubmodelPin("Y");
GUINandGate nandS0 = new GUINandGate(submodelModifiable, 1);
GUINandGate nandI0 = new GUINandGate(submodelModifiable, 1);
cp1.moveCenterTo(5, 22.5);
new GUIWire(submodelModifiable, S0, cp0, new Point[0]);
- new GUIWire(submodelModifiable, cp0, nandS0.getInputPins().get(0), new Point[0]);
+ new GUIWire(submodelModifiable, cp0, nandS0.getPin("A"), new Point[0]);
new GUIWire(submodelModifiable, cp0, cp1, new Point[0]);
- new GUIWire(submodelModifiable, cp1, nandS0.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, nandS0.getOutputPin(), nandI0.getInputPins().get(0));
- new GUIWire(submodelModifiable, I0, nandI0.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cp1, nandI1.getInputPins().get(0), new Point(5, 52.5));
- new GUIWire(submodelModifiable, I1, nandI1.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, nandI0.getOutputPin(), nandY.getInputPins().get(0));
- new GUIWire(submodelModifiable, nandI1.getOutputPin(), nandY.getInputPins().get(1));
- new GUIWire(submodelModifiable, nandY.getOutputPin(), Y);
+ new GUIWire(submodelModifiable, cp1, nandS0.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, nandS0.getPin("Y"), nandI0.getPin("A"));
+ new GUIWire(submodelModifiable, I0, nandI0.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, cp1, nandI1.getPin("A"), new Point(5, 52.5));
+ new GUIWire(submodelModifiable, I1, nandI1.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, nandI0.getPin("Y"), nandY.getPin("A"));
+ new GUIWire(submodelModifiable, nandI1.getPin("Y"), nandY.getPin("B"));
+ new GUIWire(submodelModifiable, nandY.getPin("Y"), Y);
}
}
\ No newline at end of file
@SuppressWarnings("unused")
private void initSubmodelComponents()
{
- Pin S0 = getInputSubmodelPins().get(0);
- Pin I0_1 = getInputSubmodelPins().get(1);
- Pin I0_2 = getInputSubmodelPins().get(2);
- Pin I0_3 = getInputSubmodelPins().get(3);
- Pin I0_4 = getInputSubmodelPins().get(4);
- Pin I1_1 = getInputSubmodelPins().get(5);
- Pin I1_2 = getInputSubmodelPins().get(6);
- Pin I1_3 = getInputSubmodelPins().get(7);
- Pin I1_4 = getInputSubmodelPins().get(8);
- Pin Y1 = getOutputSubmodelPins().get(0);
- Pin Y2 = getOutputSubmodelPins().get(1);
- Pin Y3 = getOutputSubmodelPins().get(2);
- Pin Y4 = getOutputSubmodelPins().get(3);
+ Pin S0 = getSubmodelPin("S0");
+ Pin I0_1 = getSubmodelPin("I0_1");
+ Pin I0_2 = getSubmodelPin("I0_2");
+ Pin I0_3 = getSubmodelPin("I0_3");
+ Pin I0_4 = getSubmodelPin("I0_4");
+ Pin I1_1 = getSubmodelPin("I1_1");
+ Pin I1_2 = getSubmodelPin("I1_2");
+ Pin I1_3 = getSubmodelPin("I1_3");
+ Pin I1_4 = getSubmodelPin("I1_4");
+ Pin Y1 = getSubmodelPin("Y1");
+ Pin Y2 = getSubmodelPin("Y2");
+ Pin Y3 = getSubmodelPin("Y3");
+ Pin Y4 = getSubmodelPin("Y4");
GUImux1 mux1 = new GUImux1(submodelModifiable);
GUImux1 mux2 = new GUImux1(submodelModifiable);
cp3.moveCenterTo(25, 82.5);
new GUIWire(submodelModifiable, S0, cp1, new Point[0]);
- new GUIWire(submodelModifiable, cp1, mux1.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, I0_1, mux1.getInputPins().get(1), new Point(5, 37.5), new Point(5, 22.5));
- new GUIWire(submodelModifiable, I1_1, mux1.getInputPins().get(2), new Point(10, 137.5), new Point(10, 32.5));
- new GUIWire(submodelModifiable, mux1.getOutputPins().get(0), Y1, new Point[0]);
+ new GUIWire(submodelModifiable, cp1, mux1.getPin("S0"), new Point[0]);
+ new GUIWire(submodelModifiable, I0_1, mux1.getPin("I0"), new Point(5, 37.5), new Point(5, 22.5));
+ new GUIWire(submodelModifiable, I1_1, mux1.getPin("I1"), new Point(10, 137.5), new Point(10, 32.5));
+ new GUIWire(submodelModifiable, mux1.getPin("Y"), Y1, new Point[0]);
new GUIWire(submodelModifiable, cp1, cp2, new Point[0]);
- new GUIWire(submodelModifiable, cp2, mux2.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, I0_2, mux2.getInputPins().get(1), new Point(5, 62.5), new Point(5, 57.5));
- new GUIWire(submodelModifiable, I1_2, mux2.getInputPins().get(2), new Point(15, 162.5), new Point(15, 67.5));
- new GUIWire(submodelModifiable, mux2.getOutputPins().get(0), Y2);
+ new GUIWire(submodelModifiable, cp2, mux2.getPin("S0"), new Point[0]);
+ new GUIWire(submodelModifiable, I0_2, mux2.getPin("I0"), new Point(5, 62.5), new Point(5, 57.5));
+ new GUIWire(submodelModifiable, I1_2, mux2.getPin("I1"), new Point(15, 162.5), new Point(15, 67.5));
+ new GUIWire(submodelModifiable, mux2.getPin("Y"), Y2);
new GUIWire(submodelModifiable, cp2, cp3, new Point[0]);
- new GUIWire(submodelModifiable, cp3, mux3.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, I0_3, mux3.getInputPins().get(1), new Point(5, 87.5), new Point(5, 92.5));
- new GUIWire(submodelModifiable, I1_3, mux3.getInputPins().get(2), new Point(20, 187.5), new Point(20, 102.5));
- new GUIWire(submodelModifiable, mux3.getOutputPins().get(0), Y3);
- new GUIWire(submodelModifiable, cp3, mux4.getInputPins().get(0), new Point(25, 117.5));
- new GUIWire(submodelModifiable, I0_4, mux4.getInputPins().get(1), new Point(5, 112.5), new Point(5, 127.5));
- new GUIWire(submodelModifiable, I1_4, mux4.getInputPins().get(2), new Point(25, 212.5), new Point(25, 137.5));
- new GUIWire(submodelModifiable, mux4.getOutputPins().get(0), Y4);
+ new GUIWire(submodelModifiable, cp3, mux3.getPin("S0"), new Point[0]);
+ new GUIWire(submodelModifiable, I0_3, mux3.getPin("I0"), new Point(5, 87.5), new Point(5, 92.5));
+ new GUIWire(submodelModifiable, I1_3, mux3.getPin("I1"), new Point(20, 187.5), new Point(20, 102.5));
+ new GUIWire(submodelModifiable, mux3.getPin("Y"), Y3);
+ new GUIWire(submodelModifiable, cp3, mux4.getPin("S0"), new Point(25, 117.5));
+ new GUIWire(submodelModifiable, I0_4, mux4.getPin("I0"), new Point(5, 112.5), new Point(5, 127.5));
+ new GUIWire(submodelModifiable, I1_4, mux4.getPin("I1"), new Point(25, 212.5), new Point(25, 137.5));
+ new GUIWire(submodelModifiable, mux4.getPin("Y"), Y4);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin A = getInputSubmodelPins().get(0);
- Pin B = getInputSubmodelPins().get(1);
- Pin C = getInputSubmodelPins().get(2);
- Pin Y = getOutputSubmodelPins().get(0);
+ Pin A = getSubmodelPin("A");
+ Pin B = getSubmodelPin("B");
+ Pin C = getSubmodelPin("C");
+ Pin Y = getSubmodelPin("Y");
GUINandGate nandAB = new GUINandGate(submodelModifiable, 1);
GUINandGate andAB = new GUINandGate(submodelModifiable, 1);
nandABC.moveTo(62.5, 2.5);
cpNandAB.moveCenterTo(32.5, 25);
- new GUIWire(submodelModifiable, A, nandAB.getInputPins().get(0));
- new GUIWire(submodelModifiable, B, nandAB.getInputPins().get(1));
- new GUIWire(submodelModifiable, nandAB.getOutputPin(), cpNandAB, new Point[0]);
- new GUIWire(submodelModifiable, cpNandAB, andAB.getInputPins().get(0), new Point(32.5, 20));
- new GUIWire(submodelModifiable, cpNandAB, andAB.getInputPins().get(1), new Point(32.5, 30));
- new GUIWire(submodelModifiable, andAB.getOutputPin(), nandABC.getInputPins().get(0), new Point(57.5, 25), new Point(57.5, 7.5));
- new GUIWire(submodelModifiable, C, nandABC.getInputPins().get(1), new Point(60, 62.5), new Point(60, 17.5));
- new GUIWire(submodelModifiable, nandABC.getOutputPin(), Y, new Point[0]);
+ new GUIWire(submodelModifiable, A, nandAB.getPin("A"));
+ new GUIWire(submodelModifiable, B, nandAB.getPin("B"));
+ new GUIWire(submodelModifiable, nandAB.getPin("Y"), cpNandAB, new Point[0]);
+ new GUIWire(submodelModifiable, cpNandAB, andAB.getPin("A"), new Point(32.5, 20));
+ new GUIWire(submodelModifiable, cpNandAB, andAB.getPin("B"), new Point(32.5, 30));
+ new GUIWire(submodelModifiable, andAB.getPin("Y"), nandABC.getPin("A"), new Point(57.5, 25), new Point(57.5, 7.5));
+ new GUIWire(submodelModifiable, C, nandABC.getPin("B"), new Point(60, 62.5), new Point(60, 17.5));
+ new GUIWire(submodelModifiable, nandABC.getPin("Y"), Y, new Point[0]);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin A1 = getInputSubmodelPins().get(0);
- Pin A2 = getInputSubmodelPins().get(1);
- Pin A3 = getInputSubmodelPins().get(2);
- Pin A4 = getInputSubmodelPins().get(3);
- Pin Y1 = getOutputSubmodelPins().get(0);
- Pin Y2 = getOutputSubmodelPins().get(1);
- Pin Y3 = getOutputSubmodelPins().get(2);
- Pin Y4 = getOutputSubmodelPins().get(3);
+ Pin A1 = getSubmodelPin("A1");
+ Pin A2 = getSubmodelPin("A2");
+ Pin A3 = getSubmodelPin("A3");
+ Pin A4 = getSubmodelPin("A4");
+ Pin Y1 = getSubmodelPin("Y1");
+ Pin Y2 = getSubmodelPin("Y2");
+ Pin Y3 = getSubmodelPin("Y3");
+ Pin Y4 = getSubmodelPin("Y4");
GUINandGate nand1 = new GUINandGate(submodelModifiable, 1);
GUINandGate nand2 = new GUINandGate(submodelModifiable, 1);
new GUIWire(submodelModifiable, A2, cp2, new Point[0]);
new GUIWire(submodelModifiable, A3, cp3, new Point[0]);
new GUIWire(submodelModifiable, A4, cp4, new Point[0]);
- new GUIWire(submodelModifiable, cp1, nand1.getInputPins().get(0), new Point(15, 7.5));
- new GUIWire(submodelModifiable, cp2, nand2.getInputPins().get(0), new Point(15, 32.5));
- new GUIWire(submodelModifiable, cp3, nand3.getInputPins().get(0), new Point(15, 57.5));
- new GUIWire(submodelModifiable, cp4, nand4.getInputPins().get(0), new Point(15, 82.5));
- new GUIWire(submodelModifiable, cp1, nand1.getInputPins().get(1), new Point(15, 17.5));
- new GUIWire(submodelModifiable, cp2, nand2.getInputPins().get(1), new Point(15, 42.5));
- new GUIWire(submodelModifiable, cp3, nand3.getInputPins().get(1), new Point(15, 67.5));
- new GUIWire(submodelModifiable, cp4, nand4.getInputPins().get(1), new Point(15, 92.5));
- new GUIWire(submodelModifiable, nand1.getOutputPin(), Y1, new Point[0]);
- new GUIWire(submodelModifiable, nand2.getOutputPin(), Y2, new Point[0]);
- new GUIWire(submodelModifiable, nand3.getOutputPin(), Y3, new Point[0]);
- new GUIWire(submodelModifiable, nand4.getOutputPin(), Y4, new Point[0]);
+ new GUIWire(submodelModifiable, cp1, nand1.getPin("A"), new Point(15, 7.5));
+ new GUIWire(submodelModifiable, cp2, nand2.getPin("A"), new Point(15, 32.5));
+ new GUIWire(submodelModifiable, cp3, nand3.getPin("A"), new Point(15, 57.5));
+ new GUIWire(submodelModifiable, cp4, nand4.getPin("A"), new Point(15, 82.5));
+ new GUIWire(submodelModifiable, cp1, nand1.getPin("B"), new Point(15, 17.5));
+ new GUIWire(submodelModifiable, cp2, nand2.getPin("B"), new Point(15, 42.5));
+ new GUIWire(submodelModifiable, cp3, nand3.getPin("B"), new Point(15, 67.5));
+ new GUIWire(submodelModifiable, cp4, nand4.getPin("B"), new Point(15, 92.5));
+ new GUIWire(submodelModifiable, nand1.getPin("Y"), Y1, new Point[0]);
+ new GUIWire(submodelModifiable, nand2.getPin("Y"), Y2, new Point[0]);
+ new GUIWire(submodelModifiable, nand3.getPin("Y"), Y3, new Point[0]);
+ new GUIWire(submodelModifiable, nand4.getPin("Y"), Y4, new Point[0]);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin A1 = getInputSubmodelPins().get(0);
- Pin A2 = getInputSubmodelPins().get(1);
- Pin A3 = getInputSubmodelPins().get(2);
- Pin A4 = getInputSubmodelPins().get(3);
- Pin Y = getOutputSubmodelPins().get(0);
+ Pin A1 = getSubmodelPin("A1");
+ Pin A2 = getSubmodelPin("A2");
+ Pin A3 = getSubmodelPin("A3");
+ Pin A4 = getSubmodelPin("A4");
+ Pin Y = getSubmodelPin("Y");
GUINandGate nandA1 = new GUINandGate(submodelModifiable, 1);
GUINandGate nandA2 = new GUINandGate(submodelModifiable, 1);
new GUIWire(submodelModifiable, A2, cpA2, new Point[0]);
new GUIWire(submodelModifiable, A3, cpA3, new Point[0]);
new GUIWire(submodelModifiable, A4, cpA4, new Point[0]);
- new GUIWire(submodelModifiable, cpA1, nandA1.getInputPins().get(0), new Point(15, 20));
- new GUIWire(submodelModifiable, cpA2, nandA2.getInputPins().get(0), new Point(15, 70));
- new GUIWire(submodelModifiable, cpA3, nandA3.getInputPins().get(0), new Point(15, 120));
- new GUIWire(submodelModifiable, cpA4, nandA4.getInputPins().get(0), new Point(15, 170));
- new GUIWire(submodelModifiable, cpA1, nandA1.getInputPins().get(1), new Point(15, 30));
- new GUIWire(submodelModifiable, cpA2, nandA2.getInputPins().get(1), new Point(15, 80));
- new GUIWire(submodelModifiable, cpA3, nandA3.getInputPins().get(1), new Point(15, 130));
- new GUIWire(submodelModifiable, cpA4, nandA4.getInputPins().get(1), new Point(15, 180));
- new GUIWire(submodelModifiable, nandA1.getOutputPin(), or12.getInputPins().get(0));
- new GUIWire(submodelModifiable, nandA2.getOutputPin(), or12.getInputPins().get(1));
- new GUIWire(submodelModifiable, nandA3.getOutputPin(), or34.getInputPins().get(0));
- new GUIWire(submodelModifiable, nandA4.getOutputPin(), or34.getInputPins().get(1));
- new GUIWire(submodelModifiable, or12.getOutputPin(), cpOr12, new Point[0]);
- new GUIWire(submodelModifiable, or34.getOutputPin(), cpOr34, new Point[0]);
- new GUIWire(submodelModifiable, cpOr12, nor12.getInputPins().get(0), new Point(105, 45));
- new GUIWire(submodelModifiable, cpOr12, nor12.getInputPins().get(1), new Point(105, 55));
- new GUIWire(submodelModifiable, cpOr34, nor34.getInputPins().get(0), new Point(105, 145));
- new GUIWire(submodelModifiable, cpOr34, nor34.getInputPins().get(1), new Point(105, 155));
- new GUIWire(submodelModifiable, nor12.getOutputPin(), or1234.getInputPins().get(0));
- new GUIWire(submodelModifiable, nor34.getOutputPin(), or1234.getInputPins().get(1));
- new GUIWire(submodelModifiable, or1234.getOutputPin(), Y);
+ new GUIWire(submodelModifiable, cpA1, nandA1.getPin("A"), new Point(15, 20));
+ new GUIWire(submodelModifiable, cpA2, nandA2.getPin("A"), new Point(15, 70));
+ new GUIWire(submodelModifiable, cpA3, nandA3.getPin("A"), new Point(15, 120));
+ new GUIWire(submodelModifiable, cpA4, nandA4.getPin("A"), new Point(15, 170));
+ new GUIWire(submodelModifiable, cpA1, nandA1.getPin("B"), new Point(15, 30));
+ new GUIWire(submodelModifiable, cpA2, nandA2.getPin("B"), new Point(15, 80));
+ new GUIWire(submodelModifiable, cpA3, nandA3.getPin("B"), new Point(15, 130));
+ new GUIWire(submodelModifiable, cpA4, nandA4.getPin("B"), new Point(15, 180));
+ new GUIWire(submodelModifiable, nandA1.getPin("Y"), or12.getPin("A"));
+ new GUIWire(submodelModifiable, nandA2.getPin("Y"), or12.getPin("B"));
+ new GUIWire(submodelModifiable, nandA3.getPin("Y"), or34.getPin("A"));
+ new GUIWire(submodelModifiable, nandA4.getPin("Y"), or34.getPin("B"));
+ new GUIWire(submodelModifiable, or12.getPin("Y"), cpOr12, new Point[0]);
+ new GUIWire(submodelModifiable, or34.getPin("Y"), cpOr34, new Point[0]);
+ new GUIWire(submodelModifiable, cpOr12, nor12.getPin("A"), new Point(105, 45));
+ new GUIWire(submodelModifiable, cpOr12, nor12.getPin("B"), new Point(105, 55));
+ new GUIWire(submodelModifiable, cpOr34, nor34.getPin("A"), new Point(105, 145));
+ new GUIWire(submodelModifiable, cpOr34, nor34.getPin("B"), new Point(105, 155));
+ new GUIWire(submodelModifiable, nor12.getPin("Y"), or1234.getPin("A"));
+ new GUIWire(submodelModifiable, nor34.getPin("Y"), or1234.getPin("B"));
+ new GUIWire(submodelModifiable, or1234.getPin("Y"), Y);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin A1 = getInputSubmodelPins().get(0);
- Pin A2 = getInputSubmodelPins().get(1);
- Pin A3 = getInputSubmodelPins().get(2);
- Pin A4 = getInputSubmodelPins().get(3);
- Pin B1 = getInputSubmodelPins().get(4);
- Pin B2 = getInputSubmodelPins().get(5);
- Pin B3 = getInputSubmodelPins().get(6);
- Pin B4 = getInputSubmodelPins().get(7);
- Pin Y1 = getOutputSubmodelPins().get(0);
- Pin Y2 = getOutputSubmodelPins().get(1);
- Pin Y3 = getOutputSubmodelPins().get(2);
- Pin Y4 = getOutputSubmodelPins().get(3);
+ Pin A1 = getSubmodelPin("A1");
+ Pin A2 = getSubmodelPin("A2");
+ Pin A3 = getSubmodelPin("A3");
+ Pin A4 = getSubmodelPin("A4");
+ Pin B1 = getSubmodelPin("B1");
+ Pin B2 = getSubmodelPin("B2");
+ Pin B3 = getSubmodelPin("B3");
+ Pin B4 = getSubmodelPin("B4");
+ Pin Y1 = getSubmodelPin("Y1");
+ Pin Y2 = getSubmodelPin("Y2");
+ Pin Y3 = getSubmodelPin("Y3");
+ Pin Y4 = getSubmodelPin("Y4");
GUINandGate notA1 = new GUINandGate(submodelModifiable, 1);
GUINandGate notA2 = new GUINandGate(submodelModifiable, 1);
new GUIWire(submodelModifiable, B2, cpB2, new Point[0]);
new GUIWire(submodelModifiable, B3, cpB3, new Point[0]);
new GUIWire(submodelModifiable, B4, cpB4, new Point[0]);
- new GUIWire(submodelModifiable, cpA1, notA1.getInputPins().get(0), new Point(7.5, 7.5));
- new GUIWire(submodelModifiable, cpA1, notA1.getInputPins().get(1), new Point(7.5, 17.5));
- new GUIWire(submodelModifiable, cpA2, notA2.getInputPins().get(0), new Point(7.5, 32.5));
- new GUIWire(submodelModifiable, cpA2, notA2.getInputPins().get(1), new Point(7.5, 42.5));
- new GUIWire(submodelModifiable, cpA3, notA3.getInputPins().get(0), new Point(7.5, 57.5));
- new GUIWire(submodelModifiable, cpA3, notA3.getInputPins().get(1), new Point(7.5, 67.5));
- new GUIWire(submodelModifiable, cpA4, notA4.getInputPins().get(0), new Point(7.5, 82.5));
- new GUIWire(submodelModifiable, cpA4, notA4.getInputPins().get(1), new Point(7.5, 92.5));
- new GUIWire(submodelModifiable, cpB1, notB1.getInputPins().get(0), new Point(7.5, 107.5));
- new GUIWire(submodelModifiable, cpB1, notB1.getInputPins().get(1), new Point(7.5, 117.5));
- new GUIWire(submodelModifiable, cpB2, notB2.getInputPins().get(0), new Point(7.5, 132.5));
- new GUIWire(submodelModifiable, cpB2, notB2.getInputPins().get(1), new Point(7.5, 142.5));
- new GUIWire(submodelModifiable, cpB3, notB3.getInputPins().get(0), new Point(7.5, 157.5));
- new GUIWire(submodelModifiable, cpB3, notB3.getInputPins().get(1), new Point(7.5, 167.5));
- new GUIWire(submodelModifiable, cpB4, notB4.getInputPins().get(0), new Point(7.5, 182.5));
- new GUIWire(submodelModifiable, cpB4, notB4.getInputPins().get(1), new Point(7.5, 192.5));
- new GUIWire(submodelModifiable, notA1.getOutputPin(), nandY1.getInputPins().get(0), new Point(40, 12.5), new Point(40, 7.5));
- new GUIWire(submodelModifiable, notB1.getOutputPin(), nandY1.getInputPins().get(1), new Point(45, 112.5), new Point(45, 17.5));
- new GUIWire(submodelModifiable, notA2.getOutputPin(), nandY2.getInputPins().get(0), new Point(40, 37.5), new Point(40, 32.5));
- new GUIWire(submodelModifiable, notB2.getOutputPin(), nandY2.getInputPins().get(1), new Point(50, 137.5), new Point(50, 42.5));
- new GUIWire(submodelModifiable, notA3.getOutputPin(), nandY3.getInputPins().get(0), new Point(40, 62.5), new Point(40, 57.5));
- new GUIWire(submodelModifiable, notB3.getOutputPin(), nandY3.getInputPins().get(1), new Point(55, 162.5), new Point(55, 67.5));
- new GUIWire(submodelModifiable, notA4.getOutputPin(), nandY4.getInputPins().get(0), new Point(40, 87.5), new Point(40, 82.5));
- new GUIWire(submodelModifiable, notB4.getOutputPin(), nandY4.getInputPins().get(1), new Point(60, 187.5), new Point(60, 92.5));
- new GUIWire(submodelModifiable, nandY1.getOutputPin(), Y1, new Point[0]);
- new GUIWire(submodelModifiable, nandY2.getOutputPin(), Y2, new Point[0]);
- new GUIWire(submodelModifiable, nandY3.getOutputPin(), Y3, new Point[0]);
- new GUIWire(submodelModifiable, nandY4.getOutputPin(), Y4, new Point[0]);
+ new GUIWire(submodelModifiable, cpA1, notA1.getPin("A"), new Point(7.5, 7.5));
+ new GUIWire(submodelModifiable, cpA1, notA1.getPin("B"), new Point(7.5, 17.5));
+ new GUIWire(submodelModifiable, cpA2, notA2.getPin("A"), new Point(7.5, 32.5));
+ new GUIWire(submodelModifiable, cpA2, notA2.getPin("B"), new Point(7.5, 42.5));
+ new GUIWire(submodelModifiable, cpA3, notA3.getPin("A"), new Point(7.5, 57.5));
+ new GUIWire(submodelModifiable, cpA3, notA3.getPin("B"), new Point(7.5, 67.5));
+ new GUIWire(submodelModifiable, cpA4, notA4.getPin("A"), new Point(7.5, 82.5));
+ new GUIWire(submodelModifiable, cpA4, notA4.getPin("B"), new Point(7.5, 92.5));
+ new GUIWire(submodelModifiable, cpB1, notB1.getPin("A"), new Point(7.5, 107.5));
+ new GUIWire(submodelModifiable, cpB1, notB1.getPin("B"), new Point(7.5, 117.5));
+ new GUIWire(submodelModifiable, cpB2, notB2.getPin("A"), new Point(7.5, 132.5));
+ new GUIWire(submodelModifiable, cpB2, notB2.getPin("B"), new Point(7.5, 142.5));
+ new GUIWire(submodelModifiable, cpB3, notB3.getPin("A"), new Point(7.5, 157.5));
+ new GUIWire(submodelModifiable, cpB3, notB3.getPin("B"), new Point(7.5, 167.5));
+ new GUIWire(submodelModifiable, cpB4, notB4.getPin("A"), new Point(7.5, 182.5));
+ new GUIWire(submodelModifiable, cpB4, notB4.getPin("B"), new Point(7.5, 192.5));
+ new GUIWire(submodelModifiable, notA1.getPin("Y"), nandY1.getPin("A"), new Point(40, 12.5), new Point(40, 7.5));
+ new GUIWire(submodelModifiable, notB1.getPin("Y"), nandY1.getPin("B"), new Point(45, 112.5), new Point(45, 17.5));
+ new GUIWire(submodelModifiable, notA2.getPin("Y"), nandY2.getPin("A"), new Point(40, 37.5), new Point(40, 32.5));
+ new GUIWire(submodelModifiable, notB2.getPin("Y"), nandY2.getPin("B"), new Point(50, 137.5), new Point(50, 42.5));
+ new GUIWire(submodelModifiable, notA3.getPin("Y"), nandY3.getPin("A"), new Point(40, 62.5), new Point(40, 57.5));
+ new GUIWire(submodelModifiable, notB3.getPin("Y"), nandY3.getPin("B"), new Point(55, 162.5), new Point(55, 67.5));
+ new GUIWire(submodelModifiable, notA4.getPin("Y"), nandY4.getPin("A"), new Point(40, 87.5), new Point(40, 82.5));
+ new GUIWire(submodelModifiable, notB4.getPin("Y"), nandY4.getPin("B"), new Point(60, 187.5), new Point(60, 92.5));
+ new GUIWire(submodelModifiable, nandY1.getPin("Y"), Y1, new Point[0]);
+ new GUIWire(submodelModifiable, nandY2.getPin("Y"), Y2, new Point[0]);
+ new GUIWire(submodelModifiable, nandY3.getPin("Y"), Y3, new Point[0]);
+ new GUIWire(submodelModifiable, nandY4.getPin("Y"), Y4, new Point[0]);
}
}
\ No newline at end of file
private void initSubmodelComponents()
{
//@formatter:off
- Pin A0 = getInputSubmodelPins() .get(0);
- Pin A1 = getInputSubmodelPins() .get(1);
- Pin B0 = getInputSubmodelPins() .get(2);
- Pin B1 = getInputSubmodelPins() .get(3);
- Pin WE = getInputSubmodelPins() .get(4);
- Pin D1 = getInputSubmodelPins() .get(5);
- Pin D2 = getInputSubmodelPins() .get(6);
- Pin D3 = getInputSubmodelPins() .get(7);
- Pin D4 = getInputSubmodelPins() .get(8);
- Pin QA1 = getOutputSubmodelPins().get(0);
- Pin QA2 = getOutputSubmodelPins().get(1);
- Pin QA3 = getOutputSubmodelPins().get(2);
- Pin QA4 = getOutputSubmodelPins().get(3);
- Pin QB1 = getOutputSubmodelPins().get(4);
- Pin QB2 = getOutputSubmodelPins().get(5);
- Pin QB3 = getOutputSubmodelPins().get(6);
- Pin QB4 = getOutputSubmodelPins().get(7);
+ Pin A0 = getSubmodelPin("A0");
+ Pin A1 = getSubmodelPin("A1");
+ Pin B0 = getSubmodelPin("B0");
+ Pin B1 = getSubmodelPin("B1");
+ Pin WE = getSubmodelPin("WE");
+ Pin D1 = getSubmodelPin("D1");
+ Pin D2 = getSubmodelPin("D2");
+ Pin D3 = getSubmodelPin("D3");
+ Pin D4 = getSubmodelPin("D4");
+ Pin QA1 = getSubmodelPin("QA1");
+ Pin QA2 = getSubmodelPin("QA2");
+ Pin QA3 = getSubmodelPin("QA3");
+ Pin QA4 = getSubmodelPin("QA4");
+ Pin QB1 = getSubmodelPin("QB1");
+ Pin QB2 = getSubmodelPin("QB2");
+ Pin QB3 = getSubmodelPin("QB3");
+ Pin QB4 = getSubmodelPin("QB4");
GUIdemux2 demuxA = new GUIdemux2 (submodelModifiable);
GUIdemux2 demuxB = new GUIdemux2 (submodelModifiable);
cpQ311.moveCenterTo(120, 800);
cpQ411.moveCenterTo(115, 810);
- new GUIWire(submodelModifiable, A0, demuxA.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, A1, demuxA.getInputPins().get(1), new Point(10, 150), new Point(10, 60));
- new GUIWire(submodelModifiable, B0, demuxB.getInputPins().get(0), new Point( 5, 250), new Point( 5, 155));
- new GUIWire(submodelModifiable, B1, demuxB.getInputPins().get(1), new Point(10, 350), new Point(10, 165));
- new GUIWire(submodelModifiable, demuxB.getOutputPins().get(0), cpB00, new Point[0]);
- new GUIWire(submodelModifiable, demuxB.getOutputPins().get(1), cpB01, new Point[0]);
- new GUIWire(submodelModifiable, demuxB.getOutputPins().get(2), cpB10, new Point[0]);
- new GUIWire(submodelModifiable, demuxB.getOutputPins().get(3), cpB11, new Point[0]);
- new GUIWire(submodelModifiable, cpB00, weAndB.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpB01, weAndB.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpB10, weAndB.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, cpB11, weAndB.getInputPins().get(3), new Point[0]);
- new GUIWire(submodelModifiable, WE, weAndB.getInputPins().get(4), new Point(5, 450), new Point(5, 300), new Point(125, 300), new Point(125, 195));
- new GUIWire(submodelModifiable, weAndB.getOutputPins().get(0), cell00.getInputPins().get(4), new Point(185, 155), new Point(185, 250), new Point(30, 250), new Point(30, 370));
- new GUIWire(submodelModifiable, weAndB.getOutputPins().get(1), cell01.getInputPins().get(4), new Point(180, 165), new Point(180, 245), new Point(25, 245), new Point(25, 520));
- new GUIWire(submodelModifiable, weAndB.getOutputPins().get(2), cell10.getInputPins().get(4), new Point(175, 175), new Point(175, 240), new Point(20, 240), new Point(20, 670));
- new GUIWire(submodelModifiable, weAndB.getOutputPins().get(3), cell11.getInputPins().get(4), new Point(170, 185), new Point(170, 235), new Point(15, 235), new Point(15, 820));
- new GUIWire(submodelModifiable, D1, cpD1in , new Point[0]);
- new GUIWire(submodelModifiable, D2, cpD2in , new Point[0]);
- new GUIWire(submodelModifiable, D3, cpD3in , new Point[0]);
- new GUIWire(submodelModifiable, D4, cpD4in , new Point(50, 850));
- new GUIWire(submodelModifiable, cpD101, cell00.getInputPins().get(0), new Point(35, 330));
- new GUIWire(submodelModifiable, cpD201, cell00.getInputPins().get(1), new Point(40, 340));
- new GUIWire(submodelModifiable, cpD301, cell00.getInputPins().get(2), new Point(45, 350));
- new GUIWire(submodelModifiable, cpD401, cell00.getInputPins().get(3), new Point(50, 360));
- new GUIWire(submodelModifiable, cpD101, cell01.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpD201, cell01.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpD301, cell01.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, cpD401, cell01.getInputPins().get(3), new Point[0]);
- new GUIWire(submodelModifiable, cpD101, cpD1in , new Point[0]);
- new GUIWire(submodelModifiable, cpD1in, cpD110 , new Point[0]);
- new GUIWire(submodelModifiable, cpD201, cpD210 , new Point[0]);
- new GUIWire(submodelModifiable, cpD301, cpD310 , new Point[0]);
- new GUIWire(submodelModifiable, cpD401, cpD410 , new Point[0]);
- new GUIWire(submodelModifiable, cpD110, cell10.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpD210, cell10.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpD310, cell10.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, cpD410, cell10.getInputPins().get(3), new Point[0]);
- new GUIWire(submodelModifiable, cpD210, cpD2in , new Point[0]);
- new GUIWire(submodelModifiable, cpD310, cpD3in , new Point[0]);
- new GUIWire(submodelModifiable, cpD410, cpD4in , new Point[0]);
- new GUIWire(submodelModifiable, cpD110, cell11.getInputPins().get(0), new Point(35, 780));
- new GUIWire(submodelModifiable, cpD2in, cell11.getInputPins().get(1), new Point(40, 790));
- new GUIWire(submodelModifiable, cpD3in, cell11.getInputPins().get(2), new Point(45, 800));
- new GUIWire(submodelModifiable, cpD4in, cell11.getInputPins().get(3), new Point[0]);
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(0), cpQ100, new Point[0]);
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(1), cpQ200, new Point[0]);
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(2), cpQ300, new Point[0]);
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(3), cpQ400, new Point[0]);
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(0), cpQ101, new Point[0]);
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(1), cpQ201, new Point[0]);
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(2), cpQ301, new Point[0]);
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(3), cpQ401, new Point[0]);
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(0), cpQ110, new Point[0]);
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(1), cpQ210, new Point[0]);
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(2), cpQ310, new Point[0]);
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(3), cpQ410, new Point[0]);
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(0), cpQ111, new Point[0]);
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(1), cpQ211, new Point[0]);
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(2), cpQ311, new Point[0]);
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(3), cpQ411, new Point[0]);
- new GUIWire(submodelModifiable, demuxA.getOutputPins().get(0), andA00 .getInputPins().get(4), new Point(210, 50), new Point(210, 420));
- new GUIWire(submodelModifiable, demuxA.getOutputPins().get(1), andorA01.getInputPins().get(8), new Point(205, 60), new Point(205, 570));
- new GUIWire(submodelModifiable, demuxA.getOutputPins().get(2), andorA10.getInputPins().get(8), new Point(200, 70), new Point(200, 720));
- new GUIWire(submodelModifiable, demuxA.getOutputPins().get(3), andorA11.getInputPins().get(8), new Point(195, 80), new Point(195, 870));
- new GUIWire(submodelModifiable, cpB00 , andB00 .getInputPins().get(4), new Point(110, 370));
- new GUIWire(submodelModifiable, cpB01 , andorB01.getInputPins().get(8), new Point(105, 520));
- new GUIWire(submodelModifiable, cpB10 , andorB10.getInputPins().get(8), new Point(100, 670));
- new GUIWire(submodelModifiable, cpB11 , andorB11.getInputPins().get(8), new Point(95, 820));
- new GUIWire(submodelModifiable, cpQ100, andA00 .getInputPins().get(0), new Point(130, 380));
- new GUIWire(submodelModifiable, cpQ200, andA00 .getInputPins().get(1), new Point(125, 390));
- new GUIWire(submodelModifiable, cpQ300, andA00 .getInputPins().get(2), new Point(120, 400));
- new GUIWire(submodelModifiable, cpQ400, andA00 .getInputPins().get(3), new Point(115, 410));
- new GUIWire(submodelModifiable, cpQ101, andorA01.getInputPins().get(4), new Point(130, 530));
- new GUIWire(submodelModifiable, cpQ201, andorA01.getInputPins().get(5), new Point(125, 540));
- new GUIWire(submodelModifiable, cpQ301, andorA01.getInputPins().get(6), new Point(120, 550));
- new GUIWire(submodelModifiable, cpQ401, andorA01.getInputPins().get(7), new Point(115, 560));
- new GUIWire(submodelModifiable, cpQ110, andorA10.getInputPins().get(4), new Point(130, 680));
- new GUIWire(submodelModifiable, cpQ210, andorA10.getInputPins().get(5), new Point(125, 690));
- new GUIWire(submodelModifiable, cpQ310, andorA10.getInputPins().get(6), new Point(120, 700));
- new GUIWire(submodelModifiable, cpQ410, andorA10.getInputPins().get(7), new Point(115, 710));
- new GUIWire(submodelModifiable, cpQ111, andorA11.getInputPins().get(4), new Point(130, 830));
- new GUIWire(submodelModifiable, cpQ211, andorA11.getInputPins().get(5), new Point(125, 840));
- new GUIWire(submodelModifiable, cpQ311, andorA11.getInputPins().get(6), new Point(120, 850));
- new GUIWire(submodelModifiable, cpQ411, andorA11.getInputPins().get(7), new Point(115, 860));
- new GUIWire(submodelModifiable, cpQ100, andB00 .getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpQ200, andB00 .getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpQ300, andB00 .getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, cpQ400, andB00 .getInputPins().get(3), new Point[0]);
- new GUIWire(submodelModifiable, cpQ101, andorB01.getInputPins().get(4), new Point[0]);
- new GUIWire(submodelModifiable, cpQ201, andorB01.getInputPins().get(5), new Point[0]);
- new GUIWire(submodelModifiable, cpQ301, andorB01.getInputPins().get(6), new Point[0]);
- new GUIWire(submodelModifiable, cpQ401, andorB01.getInputPins().get(7), new Point[0]);
- new GUIWire(submodelModifiable, cpQ110, andorB10.getInputPins().get(4), new Point[0]);
- new GUIWire(submodelModifiable, cpQ210, andorB10.getInputPins().get(5), new Point[0]);
- new GUIWire(submodelModifiable, cpQ310, andorB10.getInputPins().get(6), new Point[0]);
- new GUIWire(submodelModifiable, cpQ410, andorB10.getInputPins().get(7), new Point[0]);
- new GUIWire(submodelModifiable, cpQ111, andorB11.getInputPins().get(4), new Point[0]);
- new GUIWire(submodelModifiable, cpQ211, andorB11.getInputPins().get(5), new Point[0]);
- new GUIWire(submodelModifiable, cpQ311, andorB11.getInputPins().get(6), new Point[0]);
- new GUIWire(submodelModifiable, cpQ411, andorB11.getInputPins().get(7), new Point[0]);
- new GUIWire(submodelModifiable, andA00 .getOutputPins().get(0), andorA01.getInputPins().get(0), new Point(290, 380), new Point(290, 445), new Point(230, 445), new Point(230, 490));
- new GUIWire(submodelModifiable, andA00 .getOutputPins().get(1), andorA01.getInputPins().get(1), new Point(285, 390), new Point(285, 440), new Point(225, 440), new Point(225, 500));
- new GUIWire(submodelModifiable, andA00 .getOutputPins().get(2), andorA01.getInputPins().get(2), new Point(280, 400), new Point(280, 435), new Point(220, 435), new Point(220, 510));
- new GUIWire(submodelModifiable, andA00 .getOutputPins().get(3), andorA01.getInputPins().get(3), new Point(275, 410), new Point(275, 430), new Point(215, 430), new Point(215, 520));
- new GUIWire(submodelModifiable, andorA01.getOutputPins().get(0), andorA10.getInputPins().get(0), new Point(290, 490), new Point(290, 595), new Point(230, 595), new Point(230, 640));
- new GUIWire(submodelModifiable, andorA01.getOutputPins().get(1), andorA10.getInputPins().get(1), new Point(285, 500), new Point(285, 590), new Point(225, 590), new Point(225, 650));
- new GUIWire(submodelModifiable, andorA01.getOutputPins().get(2), andorA10.getInputPins().get(2), new Point(280, 510), new Point(280, 585), new Point(220, 585), new Point(220, 660));
- new GUIWire(submodelModifiable, andorA01.getOutputPins().get(3), andorA10.getInputPins().get(3), new Point(275, 520), new Point(275, 580), new Point(215, 580), new Point(215, 670));
- new GUIWire(submodelModifiable, andorA10.getOutputPins().get(0), andorA11.getInputPins().get(0), new Point(290, 640), new Point(290, 745), new Point(230, 745), new Point(230, 790));
- new GUIWire(submodelModifiable, andorA10.getOutputPins().get(1), andorA11.getInputPins().get(1), new Point(285, 650), new Point(285, 740), new Point(225, 740), new Point(225, 800));
- new GUIWire(submodelModifiable, andorA10.getOutputPins().get(2), andorA11.getInputPins().get(2), new Point(280, 660), new Point(280, 735), new Point(220, 735), new Point(220, 810));
- new GUIWire(submodelModifiable, andorA10.getOutputPins().get(3), andorA11.getInputPins().get(3), new Point(275, 670), new Point(275, 730), new Point(215, 730), new Point(215, 820));
- new GUIWire(submodelModifiable, andorA11.getOutputPins().get(0), QA1 , new Point(300, 790), new Point(300, 50));
- new GUIWire(submodelModifiable, andorA11.getOutputPins().get(1), QA2 , new Point(305, 800), new Point(305, 150));
- new GUIWire(submodelModifiable, andorA11.getOutputPins().get(2), QA3 , new Point(310, 810), new Point(310, 250));
- new GUIWire(submodelModifiable, andorA11.getOutputPins().get(3), QA4 , new Point(315, 820), new Point(315, 350));
- new GUIWire(submodelModifiable, andB00 .getOutputPins().get(0), andorB01.getInputPins().get(0), new Point(190, 330), new Point(190, 430), new Point(130, 430), new Point(130, 440));
- new GUIWire(submodelModifiable, andB00 .getOutputPins().get(1), andorB01.getInputPins().get(1), new Point(185, 340), new Point(185, 425), new Point(125, 425), new Point(125, 450));
- new GUIWire(submodelModifiable, andB00 .getOutputPins().get(2), andorB01.getInputPins().get(2), new Point(180, 350), new Point(180, 420), new Point(120, 420), new Point(120, 460));
- new GUIWire(submodelModifiable, andB00 .getOutputPins().get(3), andorB01.getInputPins().get(3), new Point(175, 360), new Point(175, 415), new Point(115, 415), new Point(115, 470));
- new GUIWire(submodelModifiable, andorB01.getOutputPins().get(0), andorB10.getInputPins().get(0), new Point(190, 440), new Point(190, 580), new Point(130, 580), new Point(130, 590));
- new GUIWire(submodelModifiable, andorB01.getOutputPins().get(1), andorB10.getInputPins().get(1), new Point(185, 450), new Point(185, 575), new Point(125, 575), new Point(125, 600));
- new GUIWire(submodelModifiable, andorB01.getOutputPins().get(2), andorB10.getInputPins().get(2), new Point(180, 460), new Point(180, 570), new Point(120, 570), new Point(120, 610));
- new GUIWire(submodelModifiable, andorB01.getOutputPins().get(3), andorB10.getInputPins().get(3), new Point(175, 470), new Point(175, 565), new Point(115, 565), new Point(115, 620));
- new GUIWire(submodelModifiable, andorB10.getOutputPins().get(0), andorB11.getInputPins().get(0), new Point(190, 590), new Point(190, 730), new Point(130, 730), new Point(130, 740));
- new GUIWire(submodelModifiable, andorB10.getOutputPins().get(1), andorB11.getInputPins().get(1), new Point(185, 600), new Point(185, 725), new Point(125, 725), new Point(125, 750));
- new GUIWire(submodelModifiable, andorB10.getOutputPins().get(2), andorB11.getInputPins().get(2), new Point(180, 610), new Point(180, 720), new Point(120, 720), new Point(120, 760));
- new GUIWire(submodelModifiable, andorB10.getOutputPins().get(3), andorB11.getInputPins().get(3), new Point(175, 620), new Point(175, 715), new Point(115, 715), new Point(115, 770));
- new GUIWire(submodelModifiable, andorB11.getOutputPins().get(0), QB1 , new Point(190, 740), new Point(190, 880), new Point(325, 880), new Point(325, 450));
- new GUIWire(submodelModifiable, andorB11.getOutputPins().get(1), QB2 , new Point(185, 750), new Point(185, 885), new Point(330, 885), new Point(330, 550));
- new GUIWire(submodelModifiable, andorB11.getOutputPins().get(2), QB3 , new Point(180, 760), new Point(180, 890), new Point(335, 890), new Point(335, 650));
- new GUIWire(submodelModifiable, andorB11.getOutputPins().get(3), QB4 , new Point(175, 770), new Point(175, 895), new Point(340, 895), new Point(340, 750));
+ new GUIWire(submodelModifiable, A0, demuxA.getPin("S0"), new Point[0]);
+ new GUIWire(submodelModifiable, A1, demuxA.getPin("S1"), new Point(10, 150), new Point(10, 60));
+ new GUIWire(submodelModifiable, B0, demuxB.getPin("S0"), new Point( 5, 250), new Point( 5, 155));
+ new GUIWire(submodelModifiable, B1, demuxB.getPin("S1"), new Point(10, 350), new Point(10, 165));
+ new GUIWire(submodelModifiable, demuxB.getPin("Y00"), cpB00, new Point[0]);
+ new GUIWire(submodelModifiable, demuxB.getPin("Y01"), cpB01, new Point[0]);
+ new GUIWire(submodelModifiable, demuxB.getPin("Y10"), cpB10, new Point[0]);
+ new GUIWire(submodelModifiable, demuxB.getPin("Y11"), cpB11, new Point[0]);
+ new GUIWire(submodelModifiable, cpB00, weAndB.getPin("A1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpB01, weAndB.getPin("A2"), new Point[0]);
+ new GUIWire(submodelModifiable, cpB10, weAndB.getPin("A3"), new Point[0]);
+ new GUIWire(submodelModifiable, cpB11, weAndB.getPin("A4"), new Point[0]);
+ new GUIWire(submodelModifiable, WE, weAndB.getPin("B"), new Point(5, 450), new Point(5, 300), new Point(125, 300), new Point(125, 195));
+ new GUIWire(submodelModifiable, weAndB.getPin("Y1"), cell00.getPin("C"), new Point(185, 155), new Point(185, 250), new Point(30, 250), new Point(30, 370));
+ new GUIWire(submodelModifiable, weAndB.getPin("Y2"), cell01.getPin("C"), new Point(180, 165), new Point(180, 245), new Point(25, 245), new Point(25, 520));
+ new GUIWire(submodelModifiable, weAndB.getPin("Y3"), cell10.getPin("C"), new Point(175, 175), new Point(175, 240), new Point(20, 240), new Point(20, 670));
+ new GUIWire(submodelModifiable, weAndB.getPin("Y4"), cell11.getPin("C"), new Point(170, 185), new Point(170, 235), new Point(15, 235), new Point(15, 820));
+ new GUIWire(submodelModifiable, D1, cpD1in , new Point[0]);
+ new GUIWire(submodelModifiable, D2, cpD2in , new Point[0]);
+ new GUIWire(submodelModifiable, D3, cpD3in , new Point[0]);
+ new GUIWire(submodelModifiable, D4, cpD4in , new Point(50, 850));
+ new GUIWire(submodelModifiable, cpD101, cell00.getPin("D1"), new Point(35, 330));
+ new GUIWire(submodelModifiable, cpD201, cell00.getPin("D2"), new Point(40, 340));
+ new GUIWire(submodelModifiable, cpD301, cell00.getPin("D3"), new Point(45, 350));
+ new GUIWire(submodelModifiable, cpD401, cell00.getPin("D4"), new Point(50, 360));
+ new GUIWire(submodelModifiable, cpD101, cell01.getPin("D1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD201, cell01.getPin("D2"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD301, cell01.getPin("D3"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD401, cell01.getPin("D4"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD101, cpD1in , new Point[0]);
+ new GUIWire(submodelModifiable, cpD1in, cpD110 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD201, cpD210 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD301, cpD310 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD401, cpD410 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD110, cell10.getPin("D1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD210, cell10.getPin("D2"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD310, cell10.getPin("D3"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD410, cell10.getPin("D4"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD210, cpD2in , new Point[0]);
+ new GUIWire(submodelModifiable, cpD310, cpD3in , new Point[0]);
+ new GUIWire(submodelModifiable, cpD410, cpD4in , new Point[0]);
+ new GUIWire(submodelModifiable, cpD110, cell11.getPin("D1"), new Point(35, 780));
+ new GUIWire(submodelModifiable, cpD2in, cell11.getPin("D2"), new Point(40, 790));
+ new GUIWire(submodelModifiable, cpD3in, cell11.getPin("D3"), new Point(45, 800));
+ new GUIWire(submodelModifiable, cpD4in, cell11.getPin("D4"), new Point[0]);
+ new GUIWire(submodelModifiable, cell00.getPin("Q1"), cpQ100, new Point[0]);
+ new GUIWire(submodelModifiable, cell00.getPin("Q2"), cpQ200, new Point[0]);
+ new GUIWire(submodelModifiable, cell00.getPin("Q3"), cpQ300, new Point[0]);
+ new GUIWire(submodelModifiable, cell00.getPin("Q4"), cpQ400, new Point[0]);
+ new GUIWire(submodelModifiable, cell01.getPin("Q1"), cpQ101, new Point[0]);
+ new GUIWire(submodelModifiable, cell01.getPin("Q2"), cpQ201, new Point[0]);
+ new GUIWire(submodelModifiable, cell01.getPin("Q3"), cpQ301, new Point[0]);
+ new GUIWire(submodelModifiable, cell01.getPin("Q4"), cpQ401, new Point[0]);
+ new GUIWire(submodelModifiable, cell10.getPin("Q1"), cpQ110, new Point[0]);
+ new GUIWire(submodelModifiable, cell10.getPin("Q2"), cpQ210, new Point[0]);
+ new GUIWire(submodelModifiable, cell10.getPin("Q3"), cpQ310, new Point[0]);
+ new GUIWire(submodelModifiable, cell10.getPin("Q4"), cpQ410, new Point[0]);
+ new GUIWire(submodelModifiable, cell11.getPin("Q1"), cpQ111, new Point[0]);
+ new GUIWire(submodelModifiable, cell11.getPin("Q2"), cpQ211, new Point[0]);
+ new GUIWire(submodelModifiable, cell11.getPin("Q3"), cpQ311, new Point[0]);
+ new GUIWire(submodelModifiable, cell11.getPin("Q4"), cpQ411, new Point[0]);
+ new GUIWire(submodelModifiable, demuxA.getPin("Y00"), andA00 .getPin("B"), new Point(210, 50), new Point(210, 420));
+ new GUIWire(submodelModifiable, demuxA.getPin("Y01"), andorA01.getPin("B"), new Point(205, 60), new Point(205, 570));
+ new GUIWire(submodelModifiable, demuxA.getPin("Y10"), andorA10.getPin("B"), new Point(200, 70), new Point(200, 720));
+ new GUIWire(submodelModifiable, demuxA.getPin("Y11"), andorA11.getPin("B"), new Point(195, 80), new Point(195, 870));
+ new GUIWire(submodelModifiable, cpB00 , andB00 .getPin("B"), new Point(110, 370));
+ new GUIWire(submodelModifiable, cpB01 , andorB01.getPin("B"), new Point(105, 520));
+ new GUIWire(submodelModifiable, cpB10 , andorB10.getPin("B"), new Point(100, 670));
+ new GUIWire(submodelModifiable, cpB11 , andorB11.getPin("B"), new Point(95, 820));
+ new GUIWire(submodelModifiable, cpQ100, andA00 .getPin("A1"), new Point(130, 380));
+ new GUIWire(submodelModifiable, cpQ200, andA00 .getPin("A2"), new Point(125, 390));
+ new GUIWire(submodelModifiable, cpQ300, andA00 .getPin("A3"), new Point(120, 400));
+ new GUIWire(submodelModifiable, cpQ400, andA00 .getPin("A4"), new Point(115, 410));
+ new GUIWire(submodelModifiable, cpQ101, andorA01.getPin("A1"), new Point(130, 530));
+ new GUIWire(submodelModifiable, cpQ201, andorA01.getPin("A2"), new Point(125, 540));
+ new GUIWire(submodelModifiable, cpQ301, andorA01.getPin("A3"), new Point(120, 550));
+ new GUIWire(submodelModifiable, cpQ401, andorA01.getPin("A4"), new Point(115, 560));
+ new GUIWire(submodelModifiable, cpQ110, andorA10.getPin("A1"), new Point(130, 680));
+ new GUIWire(submodelModifiable, cpQ210, andorA10.getPin("A2"), new Point(125, 690));
+ new GUIWire(submodelModifiable, cpQ310, andorA10.getPin("A3"), new Point(120, 700));
+ new GUIWire(submodelModifiable, cpQ410, andorA10.getPin("A4"), new Point(115, 710));
+ new GUIWire(submodelModifiable, cpQ111, andorA11.getPin("A1"), new Point(130, 830));
+ new GUIWire(submodelModifiable, cpQ211, andorA11.getPin("A2"), new Point(125, 840));
+ new GUIWire(submodelModifiable, cpQ311, andorA11.getPin("A3"), new Point(120, 850));
+ new GUIWire(submodelModifiable, cpQ411, andorA11.getPin("A4"), new Point(115, 860));
+ new GUIWire(submodelModifiable, cpQ100, andB00 .getPin("A1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ200, andB00 .getPin("A2"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ300, andB00 .getPin("A3"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ400, andB00 .getPin("A4"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ101, andorB01.getPin("A1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ201, andorB01.getPin("A2"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ301, andorB01.getPin("A3"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ401, andorB01.getPin("A4"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ110, andorB10.getPin("A1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ210, andorB10.getPin("A2"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ310, andorB10.getPin("A3"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ410, andorB10.getPin("A4"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ111, andorB11.getPin("A1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ211, andorB11.getPin("A2"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ311, andorB11.getPin("A3"), new Point[0]);
+ new GUIWire(submodelModifiable, cpQ411, andorB11.getPin("A4"), new Point[0]);
+ new GUIWire(submodelModifiable, andA00 .getPin("Y1"), andorA01.getPin("C1"), new Point(290, 380), new Point(290, 445), new Point(230, 445), new Point(230, 490));
+ new GUIWire(submodelModifiable, andA00 .getPin("Y2"), andorA01.getPin("C2"), new Point(285, 390), new Point(285, 440), new Point(225, 440), new Point(225, 500));
+ new GUIWire(submodelModifiable, andA00 .getPin("Y3"), andorA01.getPin("C3"), new Point(280, 400), new Point(280, 435), new Point(220, 435), new Point(220, 510));
+ new GUIWire(submodelModifiable, andA00 .getPin("Y4"), andorA01.getPin("C4"), new Point(275, 410), new Point(275, 430), new Point(215, 430), new Point(215, 520));
+ new GUIWire(submodelModifiable, andorA01.getPin("Y1"), andorA10.getPin("C1"), new Point(290, 490), new Point(290, 595), new Point(230, 595), new Point(230, 640));
+ new GUIWire(submodelModifiable, andorA01.getPin("Y2"), andorA10.getPin("C2"), new Point(285, 500), new Point(285, 590), new Point(225, 590), new Point(225, 650));
+ new GUIWire(submodelModifiable, andorA01.getPin("Y3"), andorA10.getPin("C3"), new Point(280, 510), new Point(280, 585), new Point(220, 585), new Point(220, 660));
+ new GUIWire(submodelModifiable, andorA01.getPin("Y4"), andorA10.getPin("C4"), new Point(275, 520), new Point(275, 580), new Point(215, 580), new Point(215, 670));
+ new GUIWire(submodelModifiable, andorA10.getPin("Y1"), andorA11.getPin("C1"), new Point(290, 640), new Point(290, 745), new Point(230, 745), new Point(230, 790));
+ new GUIWire(submodelModifiable, andorA10.getPin("Y2"), andorA11.getPin("C2"), new Point(285, 650), new Point(285, 740), new Point(225, 740), new Point(225, 800));
+ new GUIWire(submodelModifiable, andorA10.getPin("Y3"), andorA11.getPin("C3"), new Point(280, 660), new Point(280, 735), new Point(220, 735), new Point(220, 810));
+ new GUIWire(submodelModifiable, andorA10.getPin("Y4"), andorA11.getPin("C4"), new Point(275, 670), new Point(275, 730), new Point(215, 730), new Point(215, 820));
+ new GUIWire(submodelModifiable, andorA11.getPin("Y1"), QA1 , new Point(300, 790), new Point(300, 50));
+ new GUIWire(submodelModifiable, andorA11.getPin("Y2"), QA2 , new Point(305, 800), new Point(305, 150));
+ new GUIWire(submodelModifiable, andorA11.getPin("Y3"), QA3 , new Point(310, 810), new Point(310, 250));
+ new GUIWire(submodelModifiable, andorA11.getPin("Y4"), QA4 , new Point(315, 820), new Point(315, 350));
+ new GUIWire(submodelModifiable, andB00 .getPin("Y1"), andorB01.getPin("C1"), new Point(190, 330), new Point(190, 430), new Point(130, 430), new Point(130, 440));
+ new GUIWire(submodelModifiable, andB00 .getPin("Y2"), andorB01.getPin("C2"), new Point(185, 340), new Point(185, 425), new Point(125, 425), new Point(125, 450));
+ new GUIWire(submodelModifiable, andB00 .getPin("Y3"), andorB01.getPin("C3"), new Point(180, 350), new Point(180, 420), new Point(120, 420), new Point(120, 460));
+ new GUIWire(submodelModifiable, andB00 .getPin("Y4"), andorB01.getPin("C4"), new Point(175, 360), new Point(175, 415), new Point(115, 415), new Point(115, 470));
+ new GUIWire(submodelModifiable, andorB01.getPin("Y1"), andorB10.getPin("C1"), new Point(190, 440), new Point(190, 580), new Point(130, 580), new Point(130, 590));
+ new GUIWire(submodelModifiable, andorB01.getPin("Y2"), andorB10.getPin("C2"), new Point(185, 450), new Point(185, 575), new Point(125, 575), new Point(125, 600));
+ new GUIWire(submodelModifiable, andorB01.getPin("Y3"), andorB10.getPin("C3"), new Point(180, 460), new Point(180, 570), new Point(120, 570), new Point(120, 610));
+ new GUIWire(submodelModifiable, andorB01.getPin("Y4"), andorB10.getPin("C4"), new Point(175, 470), new Point(175, 565), new Point(115, 565), new Point(115, 620));
+ new GUIWire(submodelModifiable, andorB10.getPin("Y1"), andorB11.getPin("C1"), new Point(190, 590), new Point(190, 730), new Point(130, 730), new Point(130, 740));
+ new GUIWire(submodelModifiable, andorB10.getPin("Y2"), andorB11.getPin("C2"), new Point(185, 600), new Point(185, 725), new Point(125, 725), new Point(125, 750));
+ new GUIWire(submodelModifiable, andorB10.getPin("Y3"), andorB11.getPin("C3"), new Point(180, 610), new Point(180, 720), new Point(120, 720), new Point(120, 760));
+ new GUIWire(submodelModifiable, andorB10.getPin("Y4"), andorB11.getPin("C4"), new Point(175, 620), new Point(175, 715), new Point(115, 715), new Point(115, 770));
+ new GUIWire(submodelModifiable, andorB11.getPin("Y1"), QB1 , new Point(190, 740), new Point(190, 880), new Point(325, 880), new Point(325, 450));
+ new GUIWire(submodelModifiable, andorB11.getPin("Y2"), QB2 , new Point(185, 750), new Point(185, 885), new Point(330, 885), new Point(330, 550));
+ new GUIWire(submodelModifiable, andorB11.getPin("Y3"), QB3 , new Point(180, 760), new Point(180, 890), new Point(335, 890), new Point(335, 650));
+ new GUIWire(submodelModifiable, andorB11.getPin("Y4"), QB4 , new Point(175, 770), new Point(175, 895), new Point(340, 895), new Point(340, 750));
//@formatter:on
}
}
\ No newline at end of file
private void initSubmodelComponents()
{
//@formatter:off
- Pin A0 = getInputSubmodelPins() .get( 0);
- Pin A1 = getInputSubmodelPins() .get( 1);
- Pin A2 = getInputSubmodelPins() .get( 2);
- Pin A3 = getInputSubmodelPins() .get( 3);
- Pin B0 = getInputSubmodelPins() .get( 4);
- Pin B1 = getInputSubmodelPins() .get( 5);
- Pin B2 = getInputSubmodelPins() .get( 6);
- Pin B3 = getInputSubmodelPins() .get( 7);
- Pin WE = getInputSubmodelPins() .get( 8);
- Pin D1 = getInputSubmodelPins() .get( 9);
- Pin D2 = getInputSubmodelPins() .get(10);
- Pin D3 = getInputSubmodelPins() .get(11);
- Pin D4 = getInputSubmodelPins() .get(12);
- Pin QA1 = getOutputSubmodelPins().get( 0);
- Pin QA2 = getOutputSubmodelPins().get( 1);
- Pin QA3 = getOutputSubmodelPins().get( 2);
- Pin QA4 = getOutputSubmodelPins().get( 3);
- Pin QB1 = getOutputSubmodelPins().get( 4);
- Pin QB2 = getOutputSubmodelPins().get( 5);
- Pin QB3 = getOutputSubmodelPins().get( 6);
- Pin QB4 = getOutputSubmodelPins().get( 7);
+ Pin A0 = getSubmodelPin("A0");
+ Pin A1 = getSubmodelPin("A1");
+ Pin A2 = getSubmodelPin("A2");
+ Pin A3 = getSubmodelPin("A3");
+ Pin B0 = getSubmodelPin("B0");
+ Pin B1 = getSubmodelPin("B1");
+ Pin B2 = getSubmodelPin("B2");
+ Pin B3 = getSubmodelPin("B3");
+ Pin WE = getSubmodelPin("WE");
+ Pin D1 = getSubmodelPin("D1");
+ Pin D2 = getSubmodelPin("D2");
+ Pin D3 = getSubmodelPin("D3");
+ Pin D4 = getSubmodelPin("D4");
+ Pin QA1 =getSubmodelPin("QA1");
+ Pin QA2 =getSubmodelPin("QA2");
+ Pin QA3 =getSubmodelPin("QA3");
+ Pin QA4 =getSubmodelPin("QA4");
+ Pin QB1 =getSubmodelPin("QB1");
+ Pin QB2 =getSubmodelPin("QB2");
+ Pin QB3 =getSubmodelPin("QB3");
+ Pin QB4 =getSubmodelPin("QB4");
GUIdemux2 demuxA = new GUIdemux2 (submodelModifiable);
GUIdemux2 demuxB = new GUIdemux2 (submodelModifiable);
cpAB3in.moveCenterTo( 50, 650);
cpAB4in.moveCenterTo( 55, 750);
- new GUIWire(submodelModifiable, A0, demuxA.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, A1, demuxA.getInputPins().get(1), new Point(10, 150), new Point(10, 60));
- new GUIWire(submodelModifiable, B0, demuxB.getInputPins().get(0), new Point( 5, 450), new Point( 5, 155));
- new GUIWire(submodelModifiable, B1, demuxB.getInputPins().get(1), new Point(10, 550), new Point(10, 165));
- new GUIWire(submodelModifiable, demuxB.getOutputPins().get(0), cpB00, new Point[0]);
- new GUIWire(submodelModifiable, demuxB.getOutputPins().get(1), cpB01, new Point[0]);
- new GUIWire(submodelModifiable, demuxB.getOutputPins().get(2), cpB10, new Point[0]);
- new GUIWire(submodelModifiable, demuxB.getOutputPins().get(3), cpB11, new Point[0]);
- new GUIWire(submodelModifiable, cpB00, weAndB.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpB01, weAndB.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpB10, weAndB.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, cpB11, weAndB.getInputPins().get(3), new Point[0]);
- new GUIWire(submodelModifiable, WE, weAndB.getInputPins().get(4), new Point(15, 850), new Point(15, 195));
- new GUIWire(submodelModifiable, weAndB.getOutputPins().get(0), cell00.getInputPins().get(4), new Point(290, 155), new Point(290, 230), new Point(35, 230), new Point(35, 375));
- new GUIWire(submodelModifiable, weAndB.getOutputPins().get(1), cell01.getInputPins().get(4), new Point(285, 165), new Point(285, 225), new Point(30, 225), new Point(30, 525));
- new GUIWire(submodelModifiable, weAndB.getOutputPins().get(2), cell10.getInputPins().get(4), new Point(280, 175), new Point(280, 220), new Point(25, 220), new Point(25, 675));
- new GUIWire(submodelModifiable, weAndB.getOutputPins().get(3), cell11.getInputPins().get(4), new Point(275, 185), new Point(275, 215), new Point(20, 215), new Point(20, 825));
- new GUIWire(submodelModifiable, cpAB101, cpAB1in , new Point[0]);
- new GUIWire(submodelModifiable, cpAB1in, cell00.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpAB201, cpAB2in , new Point[0]);
- new GUIWire(submodelModifiable, cpAB2in, cell00.getInputPins().get(1), new Point(45, 345));
- new GUIWire(submodelModifiable, cpAB301, cell00.getInputPins().get(2), new Point(50, 355));
- new GUIWire(submodelModifiable, cpAB401, cell00.getInputPins().get(3), new Point(55, 365));
- new GUIWire(submodelModifiable, cpAB101, cell01.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpAB201, cell01.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpAB301, cell01.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, cpAB401, cell01.getInputPins().get(3), new Point[0]);
- new GUIWire(submodelModifiable, cpAB101, cpAB110 , new Point[0]);
- new GUIWire(submodelModifiable, cpAB201, cpAB210 , new Point[0]);
- new GUIWire(submodelModifiable, cpAB301, cpAB3in , new Point[0]);
- new GUIWire(submodelModifiable, B2, cpAB3in , new Point[0]);
- new GUIWire(submodelModifiable, cpAB3in, cpAB310 , new Point[0]);
- new GUIWire(submodelModifiable, cpAB401, cpAB410 , new Point[0]);
- new GUIWire(submodelModifiable, cpAB110, cell10.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpAB210, cell10.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpAB310, cell10.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, cpAB410, cell10.getInputPins().get(3), new Point[0]);
- new GUIWire(submodelModifiable, cpAB110, cell11.getInputPins().get(0), new Point(40, 785));
- new GUIWire(submodelModifiable, cpAB210, cell11.getInputPins().get(1), new Point(45, 795));
- new GUIWire(submodelModifiable, cpAB310, cell11.getInputPins().get(2), new Point(50, 805));
- new GUIWire(submodelModifiable, cpAB410, cpAB4in , new Point[0]);
- new GUIWire(submodelModifiable, cpAB4in, cell11.getInputPins().get(3), new Point(55, 815));
- new GUIWire(submodelModifiable, A2, cpAB1in , new Point(40, 250));
- new GUIWire(submodelModifiable, A3, cpAB2in , new Point[0]);
- new GUIWire(submodelModifiable, B3, cpAB4in , new Point[0]);
- new GUIWire(submodelModifiable, cpD_101, cell00.getInputPins().get(5), new Point(60, 385));
- new GUIWire(submodelModifiable, cpD_201, cell00.getInputPins().get(6), new Point(65, 395));
- new GUIWire(submodelModifiable, cpD_301, cell00.getInputPins().get(7), new Point(70, 405));
- new GUIWire(submodelModifiable, cpD_401, cell00.getInputPins().get(8), new Point(75, 415));
- new GUIWire(submodelModifiable, cpD_101, cell01.getInputPins().get(5), new Point[0]);
- new GUIWire(submodelModifiable, cpD_201, cell01.getInputPins().get(6), new Point[0]);
- new GUIWire(submodelModifiable, cpD_301, cell01.getInputPins().get(7), new Point[0]);
- new GUIWire(submodelModifiable, cpD_401, cell01.getInputPins().get(8), new Point[0]);
- new GUIWire(submodelModifiable, cpD_101, cpD_110 , new Point[0]);
- new GUIWire(submodelModifiable, cpD_201, cpD_210 , new Point[0]);
- new GUIWire(submodelModifiable, cpD_301, cpD_310 , new Point[0]);
- new GUIWire(submodelModifiable, cpD_401, cpD_410 , new Point[0]);
- new GUIWire(submodelModifiable, cpD_110, cell10.getInputPins().get(5), new Point[0]);
- new GUIWire(submodelModifiable, cpD_210, cell10.getInputPins().get(6), new Point[0]);
- new GUIWire(submodelModifiable, cpD_310, cell10.getInputPins().get(7), new Point[0]);
- new GUIWire(submodelModifiable, cpD_410, cell10.getInputPins().get(8), new Point[0]);
- new GUIWire(submodelModifiable, cpD_110, cpD_111 , new Point[0]);
- new GUIWire(submodelModifiable, cpD_210, cpD_211 , new Point[0]);
- new GUIWire(submodelModifiable, cpD_310, cpD_311 , new Point[0]);
- new GUIWire(submodelModifiable, cpD_410, cpD_411 , new Point[0]);
- new GUIWire(submodelModifiable, cpD_111, cell11.getInputPins().get(5), new Point[0]);
- new GUIWire(submodelModifiable, cpD_211, cell11.getInputPins().get(6), new Point[0]);
- new GUIWire(submodelModifiable, cpD_311, cell11.getInputPins().get(7), new Point[0]);
- new GUIWire(submodelModifiable, cpD_411, cell11.getInputPins().get(8), new Point[0]);
- new GUIWire(submodelModifiable, D1, cpD_111 , new Point(60, 950));
- new GUIWire(submodelModifiable, D2, cpD_211 , new Point(65, 1050));
- new GUIWire(submodelModifiable, D3, cpD_311 , new Point(70, 1150));
- new GUIWire(submodelModifiable, D4, cpD_411 , new Point(75, 1250));
- new GUIWire(submodelModifiable, demuxA.getOutputPins().get(0), andA00 .getInputPins().get(4), new Point(135, 50), new Point(135, 370));
- new GUIWire(submodelModifiable, demuxA.getOutputPins().get(1), andorA01.getInputPins().get(8), new Point(130, 60), new Point(130, 520));
- new GUIWire(submodelModifiable, demuxA.getOutputPins().get(2), andorA10.getInputPins().get(8), new Point(125, 70), new Point(125, 670));
- new GUIWire(submodelModifiable, demuxA.getOutputPins().get(3), andorA11.getInputPins().get(8), new Point(120, 80), new Point(120, 820));
- new GUIWire(submodelModifiable, cpB00 , andB00 .getInputPins().get(4), new Point(230, 420));
- new GUIWire(submodelModifiable, cpB01 , andorB01.getInputPins().get(8), new Point(225, 570));
- new GUIWire(submodelModifiable, cpB10 , andorB10.getInputPins().get(8), new Point(220, 720));
- new GUIWire(submodelModifiable, cpB11 , andorB11.getInputPins().get(8), new Point(215, 870));
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(4), andB00 .getInputPins().get(0), new Point(140, 375), new Point(140, 380));
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(5), andB00 .getInputPins().get(1), new Point(140, 385), new Point(140, 390));
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(6), andB00 .getInputPins().get(2), new Point(140, 395), new Point(140, 400));
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(7), andB00 .getInputPins().get(3), new Point(140, 405), new Point(140, 410));
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(4), andorB01.getInputPins().get(4), new Point(140, 525), new Point(140, 530));
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(5), andorB01.getInputPins().get(5), new Point(140, 535), new Point(140, 540));
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(6), andorB01.getInputPins().get(6), new Point(140, 545), new Point(140, 550));
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(7), andorB01.getInputPins().get(7), new Point(140, 555), new Point(140, 560));
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(4), andorB10.getInputPins().get(4), new Point(140, 675), new Point(140, 680));
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(5), andorB10.getInputPins().get(5), new Point(140, 685), new Point(140, 690));
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(6), andorB10.getInputPins().get(6), new Point(140, 695), new Point(140, 700));
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(7), andorB10.getInputPins().get(7), new Point(140, 705), new Point(140, 710));
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(4), andorB11.getInputPins().get(4), new Point(140, 825), new Point(140, 830));
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(5), andorB11.getInputPins().get(5), new Point(140, 835), new Point(140, 840));
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(6), andorB11.getInputPins().get(6), new Point(140, 845), new Point(140, 850));
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(7), andorB11.getInputPins().get(7), new Point(140, 855), new Point(140, 860));
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(0), andA00 .getInputPins().get(0), new Point(140, 335), new Point(140, 330));
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(1), andA00 .getInputPins().get(1), new Point(140, 345), new Point(140, 340));
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(2), andA00 .getInputPins().get(2), new Point(140, 355), new Point(140, 350));
- new GUIWire(submodelModifiable, cell00.getOutputPins().get(3), andA00 .getInputPins().get(3), new Point(140, 365), new Point(140, 360));
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(0), andorA01.getInputPins().get(4), new Point(140, 485), new Point(140, 480));
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(1), andorA01.getInputPins().get(5), new Point(140, 495), new Point(140, 490));
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(2), andorA01.getInputPins().get(6), new Point(140, 505), new Point(140, 500));
- new GUIWire(submodelModifiable, cell01.getOutputPins().get(3), andorA01.getInputPins().get(7), new Point(140, 515), new Point(140, 510));
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(0), andorA10.getInputPins().get(4), new Point(140, 635), new Point(140, 630));
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(1), andorA10.getInputPins().get(5), new Point(140, 645), new Point(140, 640));
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(2), andorA10.getInputPins().get(6), new Point(140, 655), new Point(140, 650));
- new GUIWire(submodelModifiable, cell10.getOutputPins().get(3), andorA10.getInputPins().get(7), new Point(140, 665), new Point(140, 660));
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(0), andorA11.getInputPins().get(4), new Point(140, 785), new Point(140, 780));
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(1), andorA11.getInputPins().get(5), new Point(140, 795), new Point(140, 790));
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(2), andorA11.getInputPins().get(6), new Point(140, 805), new Point(140, 800));
- new GUIWire(submodelModifiable, cell11.getOutputPins().get(3), andorA11.getInputPins().get(7), new Point(140, 815), new Point(140, 810));
- new GUIWire(submodelModifiable, andB00 .getOutputPins().get(0), andorB01.getInputPins().get(0), new Point(305, 380), new Point(305, 445), new Point(245, 445), new Point(245, 490));
- new GUIWire(submodelModifiable, andB00 .getOutputPins().get(1), andorB01.getInputPins().get(1), new Point(300, 390), new Point(300, 440), new Point(240, 440), new Point(240, 500));
- new GUIWire(submodelModifiable, andB00 .getOutputPins().get(2), andorB01.getInputPins().get(2), new Point(295, 400), new Point(295, 435), new Point(235, 435), new Point(235, 510));
- new GUIWire(submodelModifiable, andB00 .getOutputPins().get(3), andorB01.getInputPins().get(3), new Point(290, 410), new Point(290, 430), new Point(230, 430), new Point(230, 520));
- new GUIWire(submodelModifiable, andorB01.getOutputPins().get(0), andorB10.getInputPins().get(0), new Point(305, 490), new Point(305, 595), new Point(245, 595), new Point(245, 640));
- new GUIWire(submodelModifiable, andorB01.getOutputPins().get(1), andorB10.getInputPins().get(1), new Point(300, 500), new Point(300, 590), new Point(240, 590), new Point(240, 650));
- new GUIWire(submodelModifiable, andorB01.getOutputPins().get(2), andorB10.getInputPins().get(2), new Point(295, 510), new Point(295, 585), new Point(235, 585), new Point(235, 660));
- new GUIWire(submodelModifiable, andorB01.getOutputPins().get(3), andorB10.getInputPins().get(3), new Point(290, 520), new Point(290, 580), new Point(230, 580), new Point(230, 670));
- new GUIWire(submodelModifiable, andorB10.getOutputPins().get(0), andorB11.getInputPins().get(0), new Point(305, 640), new Point(305, 745), new Point(245, 745), new Point(245, 790));
- new GUIWire(submodelModifiable, andorB10.getOutputPins().get(1), andorB11.getInputPins().get(1), new Point(300, 650), new Point(300, 740), new Point(240, 740), new Point(240, 800));
- new GUIWire(submodelModifiable, andorB10.getOutputPins().get(2), andorB11.getInputPins().get(2), new Point(295, 660), new Point(295, 735), new Point(235, 735), new Point(235, 810));
- new GUIWire(submodelModifiable, andorB10.getOutputPins().get(3), andorB11.getInputPins().get(3), new Point(290, 670), new Point(290, 730), new Point(230, 730), new Point(230, 820));
- new GUIWire(submodelModifiable, andorB11.getOutputPins().get(0), QB1 , new Point(330, 790), new Point(330, 450));
- new GUIWire(submodelModifiable, andorB11.getOutputPins().get(1), QB2 , new Point(335, 800), new Point(335, 550));
- new GUIWire(submodelModifiable, andorB11.getOutputPins().get(2), QB3 , new Point(340, 810), new Point(340, 650));
- new GUIWire(submodelModifiable, andorB11.getOutputPins().get(3), QB4 , new Point(345, 820), new Point(345, 750));
- new GUIWire(submodelModifiable, andA00 .getOutputPins().get(0), andorA01.getInputPins().get(0), new Point(210, 330), new Point(210, 430), new Point(150, 430), new Point(150, 440));
- new GUIWire(submodelModifiable, andA00 .getOutputPins().get(1), andorA01.getInputPins().get(1), new Point(205, 340), new Point(205, 425), new Point(145, 425), new Point(145, 450));
- new GUIWire(submodelModifiable, andA00 .getOutputPins().get(2), andorA01.getInputPins().get(2), new Point(200, 350), new Point(200, 420), new Point(140, 420), new Point(140, 460));
- new GUIWire(submodelModifiable, andA00 .getOutputPins().get(3), andorA01.getInputPins().get(3), new Point(195, 360), new Point(195, 415), new Point(135, 415), new Point(135, 470));
- new GUIWire(submodelModifiable, andorA01.getOutputPins().get(0), andorA10.getInputPins().get(0), new Point(210, 440), new Point(210, 580), new Point(150, 580), new Point(150, 590));
- new GUIWire(submodelModifiable, andorA01.getOutputPins().get(1), andorA10.getInputPins().get(1), new Point(205, 450), new Point(205, 575), new Point(145, 575), new Point(145, 600));
- new GUIWire(submodelModifiable, andorA01.getOutputPins().get(2), andorA10.getInputPins().get(2), new Point(200, 460), new Point(200, 570), new Point(140, 570), new Point(140, 610));
- new GUIWire(submodelModifiable, andorA01.getOutputPins().get(3), andorA10.getInputPins().get(3), new Point(195, 470), new Point(195, 565), new Point(135, 565), new Point(135, 620));
- new GUIWire(submodelModifiable, andorA10.getOutputPins().get(0), andorA11.getInputPins().get(0), new Point(210, 590), new Point(210, 730), new Point(150, 730), new Point(150, 740));
- new GUIWire(submodelModifiable, andorA10.getOutputPins().get(1), andorA11.getInputPins().get(1), new Point(205, 600), new Point(205, 725), new Point(145, 725), new Point(145, 750));
- new GUIWire(submodelModifiable, andorA10.getOutputPins().get(2), andorA11.getInputPins().get(2), new Point(200, 610), new Point(200, 720), new Point(140, 720), new Point(140, 760));
- new GUIWire(submodelModifiable, andorA10.getOutputPins().get(3), andorA11.getInputPins().get(3), new Point(195, 620), new Point(195, 715), new Point(135, 715), new Point(135, 770));
- new GUIWire(submodelModifiable, andorA11.getOutputPins().get(0), QA1 , new Point(210, 740), new Point(210, 880), new Point(310, 880), new Point(310, 50));
- new GUIWire(submodelModifiable, andorA11.getOutputPins().get(1), QA2 , new Point(205, 750), new Point(205, 885), new Point(315, 885), new Point(315, 150));
- new GUIWire(submodelModifiable, andorA11.getOutputPins().get(2), QA3 , new Point(200, 760), new Point(200, 890), new Point(320, 890), new Point(320, 250));
- new GUIWire(submodelModifiable, andorA11.getOutputPins().get(3), QA4 , new Point(195, 770), new Point(195, 895), new Point(325, 895), new Point(325, 350));
+ new GUIWire(submodelModifiable, A0, demuxA.getPin("S0"), new Point[0]);
+ new GUIWire(submodelModifiable, A1, demuxA.getPin("S1"), new Point(10, 150), new Point(10, 60));
+ new GUIWire(submodelModifiable, B0, demuxB.getPin("S0"), new Point( 5, 450), new Point( 5, 155));
+ new GUIWire(submodelModifiable, B1, demuxB.getPin("S1"), new Point(10, 550), new Point(10, 165));
+ new GUIWire(submodelModifiable, demuxB.getPin("Y00"), cpB00, new Point[0]);
+ new GUIWire(submodelModifiable, demuxB.getPin("Y01"), cpB01, new Point[0]);
+ new GUIWire(submodelModifiable, demuxB.getPin("Y10"), cpB10, new Point[0]);
+ new GUIWire(submodelModifiable, demuxB.getPin("Y11"), cpB11, new Point[0]);
+ new GUIWire(submodelModifiable, cpB00, weAndB.getPin("A1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpB01, weAndB.getPin("A2"), new Point[0]);
+ new GUIWire(submodelModifiable, cpB10, weAndB.getPin("A3"), new Point[0]);
+ new GUIWire(submodelModifiable, cpB11, weAndB.getPin("A4"), new Point[0]);
+ new GUIWire(submodelModifiable, WE, weAndB.getPin("B"), new Point(15, 850), new Point(15, 195));
+ new GUIWire(submodelModifiable, weAndB.getPin("Y1"), cell00.getPin("WE"), new Point(290, 155), new Point(290, 230), new Point(35, 230), new Point(35, 375));
+ new GUIWire(submodelModifiable, weAndB.getPin("Y2"), cell01.getPin("WE"), new Point(285, 165), new Point(285, 225), new Point(30, 225), new Point(30, 525));
+ new GUIWire(submodelModifiable, weAndB.getPin("Y3"), cell10.getPin("WE"), new Point(280, 175), new Point(280, 220), new Point(25, 220), new Point(25, 675));
+ new GUIWire(submodelModifiable, weAndB.getPin("Y4"), cell11.getPin("WE"), new Point(275, 185), new Point(275, 215), new Point(20, 215), new Point(20, 825));
+ new GUIWire(submodelModifiable, cpAB101, cpAB1in , new Point[0]);
+ new GUIWire(submodelModifiable, cpAB1in, cell00.getPin("A0"), new Point[0]);
+ new GUIWire(submodelModifiable, cpAB201, cpAB2in , new Point[0]);
+ new GUIWire(submodelModifiable, cpAB2in, cell00.getPin("A1"), new Point(45, 345));
+ new GUIWire(submodelModifiable, cpAB301, cell00.getPin("B0"), new Point(50, 355));
+ new GUIWire(submodelModifiable, cpAB401, cell00.getPin("B1"), new Point(55, 365));
+ new GUIWire(submodelModifiable, cpAB101, cell01.getPin("A0"), new Point[0]);
+ new GUIWire(submodelModifiable, cpAB201, cell01.getPin("A1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpAB301, cell01.getPin("B0"), new Point[0]);
+ new GUIWire(submodelModifiable, cpAB401, cell01.getPin("B1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpAB101, cpAB110 , new Point[0]);
+ new GUIWire(submodelModifiable, cpAB201, cpAB210 , new Point[0]);
+ new GUIWire(submodelModifiable, cpAB301, cpAB3in , new Point[0]);
+ new GUIWire(submodelModifiable, B2 , cpAB3in , new Point[0]);
+ new GUIWire(submodelModifiable, cpAB3in, cpAB310 , new Point[0]);
+ new GUIWire(submodelModifiable, cpAB401, cpAB410 , new Point[0]);
+ new GUIWire(submodelModifiable, cpAB110, cell10.getPin("A0"), new Point[0]);
+ new GUIWire(submodelModifiable, cpAB210, cell10.getPin("A1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpAB310, cell10.getPin("B0"), new Point[0]);
+ new GUIWire(submodelModifiable, cpAB410, cell10.getPin("B1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpAB110, cell11.getPin("A0"), new Point(40, 785));
+ new GUIWire(submodelModifiable, cpAB210, cell11.getPin("A1"), new Point(45, 795));
+ new GUIWire(submodelModifiable, cpAB310, cell11.getPin("B0"), new Point(50, 805));
+ new GUIWire(submodelModifiable, cpAB410, cpAB4in , new Point[0]);
+ new GUIWire(submodelModifiable, cpAB4in, cell11.getPin("B1"), new Point(55, 815));
+ new GUIWire(submodelModifiable, A2, cpAB1in , new Point(40, 250));
+ new GUIWire(submodelModifiable, A3, cpAB2in , new Point[0]);
+ new GUIWire(submodelModifiable, B3, cpAB4in , new Point[0]);
+ new GUIWire(submodelModifiable, cpD_101, cell00.getPin("D1"), new Point(60, 385));
+ new GUIWire(submodelModifiable, cpD_201, cell00.getPin("D2"), new Point(65, 395));
+ new GUIWire(submodelModifiable, cpD_301, cell00.getPin("D3"), new Point(70, 405));
+ new GUIWire(submodelModifiable, cpD_401, cell00.getPin("D4"), new Point(75, 415));
+ new GUIWire(submodelModifiable, cpD_101, cell01.getPin("D1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD_201, cell01.getPin("D2"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD_301, cell01.getPin("D3"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD_401, cell01.getPin("D4"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD_101, cpD_110 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD_201, cpD_210 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD_301, cpD_310 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD_401, cpD_410 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD_110, cell10.getPin("D1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD_210, cell10.getPin("D2"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD_310, cell10.getPin("D3"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD_410, cell10.getPin("D4"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD_110, cpD_111 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD_210, cpD_211 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD_310, cpD_311 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD_410, cpD_411 , new Point[0]);
+ new GUIWire(submodelModifiable, cpD_111, cell11.getPin("D1"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD_211, cell11.getPin("D2"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD_311, cell11.getPin("D3"), new Point[0]);
+ new GUIWire(submodelModifiable, cpD_411, cell11.getPin("D4"), new Point[0]);
+ new GUIWire(submodelModifiable, D1, cpD_111 , new Point(60, 950));
+ new GUIWire(submodelModifiable, D2, cpD_211 , new Point(65, 1050));
+ new GUIWire(submodelModifiable, D3, cpD_311 , new Point(70, 1150));
+ new GUIWire(submodelModifiable, D4, cpD_411 , new Point(75, 1250));
+ new GUIWire(submodelModifiable, demuxA.getPin("Y00"), andA00 .getPin("B"), new Point(135, 50), new Point(135, 370));
+ new GUIWire(submodelModifiable, demuxA.getPin("Y01"), andorA01.getPin("B"), new Point(130, 60), new Point(130, 520));
+ new GUIWire(submodelModifiable, demuxA.getPin("Y10"), andorA10.getPin("B"), new Point(125, 70), new Point(125, 670));
+ new GUIWire(submodelModifiable, demuxA.getPin("Y11"), andorA11.getPin("B"), new Point(120, 80), new Point(120, 820));
+ new GUIWire(submodelModifiable, cpB00, andB00 .getPin("B"), new Point(230, 420));
+ new GUIWire(submodelModifiable, cpB01, andorB01.getPin("B"), new Point(225, 570));
+ new GUIWire(submodelModifiable, cpB10, andorB10.getPin("B"), new Point(220, 720));
+ new GUIWire(submodelModifiable, cpB11, andorB11.getPin("B"), new Point(215, 870));
+ new GUIWire(submodelModifiable, cell00.getPin("QB1"), andB00 .getPin("A1"), new Point(140, 375), new Point(140, 380));
+ new GUIWire(submodelModifiable, cell00.getPin("QB2"), andB00 .getPin("A2"), new Point(140, 385), new Point(140, 390));
+ new GUIWire(submodelModifiable, cell00.getPin("QB3"), andB00 .getPin("A3"), new Point(140, 395), new Point(140, 400));
+ new GUIWire(submodelModifiable, cell00.getPin("QB4"), andB00 .getPin("A4"), new Point(140, 405), new Point(140, 410));
+ new GUIWire(submodelModifiable, cell01.getPin("QB1"), andorB01.getPin("A1"), new Point(140, 525), new Point(140, 530));
+ new GUIWire(submodelModifiable, cell01.getPin("QB2"), andorB01.getPin("A2"), new Point(140, 535), new Point(140, 540));
+ new GUIWire(submodelModifiable, cell01.getPin("QB3"), andorB01.getPin("A3"), new Point(140, 545), new Point(140, 550));
+ new GUIWire(submodelModifiable, cell01.getPin("QB4"), andorB01.getPin("A4"), new Point(140, 555), new Point(140, 560));
+ new GUIWire(submodelModifiable, cell10.getPin("QB1"), andorB10.getPin("A1"), new Point(140, 675), new Point(140, 680));
+ new GUIWire(submodelModifiable, cell10.getPin("QB2"), andorB10.getPin("A2"), new Point(140, 685), new Point(140, 690));
+ new GUIWire(submodelModifiable, cell10.getPin("QB3"), andorB10.getPin("A3"), new Point(140, 695), new Point(140, 700));
+ new GUIWire(submodelModifiable, cell10.getPin("QB4"), andorB10.getPin("A4"), new Point(140, 705), new Point(140, 710));
+ new GUIWire(submodelModifiable, cell11.getPin("QB1"), andorB11.getPin("A1"), new Point(140, 825), new Point(140, 830));
+ new GUIWire(submodelModifiable, cell11.getPin("QB2"), andorB11.getPin("A2"), new Point(140, 835), new Point(140, 840));
+ new GUIWire(submodelModifiable, cell11.getPin("QB3"), andorB11.getPin("A3"), new Point(140, 845), new Point(140, 850));
+ new GUIWire(submodelModifiable, cell11.getPin("QB4"), andorB11.getPin("A4"), new Point(140, 855), new Point(140, 860));
+ new GUIWire(submodelModifiable, cell00.getPin("QA1"), andA00 .getPin("A1"), new Point(140, 335), new Point(140, 330));
+ new GUIWire(submodelModifiable, cell00.getPin("QA2"), andA00 .getPin("A2"), new Point(140, 345), new Point(140, 340));
+ new GUIWire(submodelModifiable, cell00.getPin("QA3"), andA00 .getPin("A3"), new Point(140, 355), new Point(140, 350));
+ new GUIWire(submodelModifiable, cell00.getPin("QA4"), andA00 .getPin("A4"), new Point(140, 365), new Point(140, 360));
+ new GUIWire(submodelModifiable, cell01.getPin("QA1"), andorA01.getPin("A1"), new Point(140, 485), new Point(140, 480));
+ new GUIWire(submodelModifiable, cell01.getPin("QA2"), andorA01.getPin("A2"), new Point(140, 495), new Point(140, 490));
+ new GUIWire(submodelModifiable, cell01.getPin("QA3"), andorA01.getPin("A3"), new Point(140, 505), new Point(140, 500));
+ new GUIWire(submodelModifiable, cell01.getPin("QA4"), andorA01.getPin("A4"), new Point(140, 515), new Point(140, 510));
+ new GUIWire(submodelModifiable, cell10.getPin("QA1"), andorA10.getPin("A1"), new Point(140, 635), new Point(140, 630));
+ new GUIWire(submodelModifiable, cell10.getPin("QA2"), andorA10.getPin("A2"), new Point(140, 645), new Point(140, 640));
+ new GUIWire(submodelModifiable, cell10.getPin("QA3"), andorA10.getPin("A3"), new Point(140, 655), new Point(140, 650));
+ new GUIWire(submodelModifiable, cell10.getPin("QA4"), andorA10.getPin("A4"), new Point(140, 665), new Point(140, 660));
+ new GUIWire(submodelModifiable, cell11.getPin("QA1"), andorA11.getPin("A1"), new Point(140, 785), new Point(140, 780));
+ new GUIWire(submodelModifiable, cell11.getPin("QA2"), andorA11.getPin("A2"), new Point(140, 795), new Point(140, 790));
+ new GUIWire(submodelModifiable, cell11.getPin("QA3"), andorA11.getPin("A3"), new Point(140, 805), new Point(140, 800));
+ new GUIWire(submodelModifiable, cell11.getPin("QA4"), andorA11.getPin("A4"), new Point(140, 815), new Point(140, 810));
+ new GUIWire(submodelModifiable, andB00 .getPin("Y1"), andorB01.getPin("C1"), new Point(305, 380), new Point(305, 445), new Point(245, 445), new Point(245, 490));
+ new GUIWire(submodelModifiable, andB00 .getPin("Y2"), andorB01.getPin("C2"), new Point(300, 390), new Point(300, 440), new Point(240, 440), new Point(240, 500));
+ new GUIWire(submodelModifiable, andB00 .getPin("Y3"), andorB01.getPin("C3"), new Point(295, 400), new Point(295, 435), new Point(235, 435), new Point(235, 510));
+ new GUIWire(submodelModifiable, andB00 .getPin("Y4"), andorB01.getPin("C4"), new Point(290, 410), new Point(290, 430), new Point(230, 430), new Point(230, 520));
+ new GUIWire(submodelModifiable, andorB01.getPin("Y1"), andorB10.getPin("C1"), new Point(305, 490), new Point(305, 595), new Point(245, 595), new Point(245, 640));
+ new GUIWire(submodelModifiable, andorB01.getPin("Y2"), andorB10.getPin("C2"), new Point(300, 500), new Point(300, 590), new Point(240, 590), new Point(240, 650));
+ new GUIWire(submodelModifiable, andorB01.getPin("Y3"), andorB10.getPin("C3"), new Point(295, 510), new Point(295, 585), new Point(235, 585), new Point(235, 660));
+ new GUIWire(submodelModifiable, andorB01.getPin("Y4"), andorB10.getPin("C4"), new Point(290, 520), new Point(290, 580), new Point(230, 580), new Point(230, 670));
+ new GUIWire(submodelModifiable, andorB10.getPin("Y1"), andorB11.getPin("C1"), new Point(305, 640), new Point(305, 745), new Point(245, 745), new Point(245, 790));
+ new GUIWire(submodelModifiable, andorB10.getPin("Y2"), andorB11.getPin("C2"), new Point(300, 650), new Point(300, 740), new Point(240, 740), new Point(240, 800));
+ new GUIWire(submodelModifiable, andorB10.getPin("Y3"), andorB11.getPin("C3"), new Point(295, 660), new Point(295, 735), new Point(235, 735), new Point(235, 810));
+ new GUIWire(submodelModifiable, andorB10.getPin("Y4"), andorB11.getPin("C4"), new Point(290, 670), new Point(290, 730), new Point(230, 730), new Point(230, 820));
+ new GUIWire(submodelModifiable, andorB11.getPin("Y1"), QB1 , new Point(330, 790), new Point(330, 450));
+ new GUIWire(submodelModifiable, andorB11.getPin("Y2"), QB2 , new Point(335, 800), new Point(335, 550));
+ new GUIWire(submodelModifiable, andorB11.getPin("Y3"), QB3 , new Point(340, 810), new Point(340, 650));
+ new GUIWire(submodelModifiable, andorB11.getPin("Y4"), QB4 , new Point(345, 820), new Point(345, 750));
+ new GUIWire(submodelModifiable, andA00 .getPin("Y1"), andorA01.getPin("C1"), new Point(210, 330), new Point(210, 430), new Point(150, 430), new Point(150, 440));
+ new GUIWire(submodelModifiable, andA00 .getPin("Y2"), andorA01.getPin("C2"), new Point(205, 340), new Point(205, 425), new Point(145, 425), new Point(145, 450));
+ new GUIWire(submodelModifiable, andA00 .getPin("Y3"), andorA01.getPin("C3"), new Point(200, 350), new Point(200, 420), new Point(140, 420), new Point(140, 460));
+ new GUIWire(submodelModifiable, andA00 .getPin("Y4"), andorA01.getPin("C4"), new Point(195, 360), new Point(195, 415), new Point(135, 415), new Point(135, 470));
+ new GUIWire(submodelModifiable, andorA01.getPin("Y1"), andorA10.getPin("C1"), new Point(210, 440), new Point(210, 580), new Point(150, 580), new Point(150, 590));
+ new GUIWire(submodelModifiable, andorA01.getPin("Y2"), andorA10.getPin("C2"), new Point(205, 450), new Point(205, 575), new Point(145, 575), new Point(145, 600));
+ new GUIWire(submodelModifiable, andorA01.getPin("Y3"), andorA10.getPin("C3"), new Point(200, 460), new Point(200, 570), new Point(140, 570), new Point(140, 610));
+ new GUIWire(submodelModifiable, andorA01.getPin("Y4"), andorA10.getPin("C4"), new Point(195, 470), new Point(195, 565), new Point(135, 565), new Point(135, 620));
+ new GUIWire(submodelModifiable, andorA10.getPin("Y1"), andorA11.getPin("C1"), new Point(210, 590), new Point(210, 730), new Point(150, 730), new Point(150, 740));
+ new GUIWire(submodelModifiable, andorA10.getPin("Y2"), andorA11.getPin("C2"), new Point(205, 600), new Point(205, 725), new Point(145, 725), new Point(145, 750));
+ new GUIWire(submodelModifiable, andorA10.getPin("Y3"), andorA11.getPin("C3"), new Point(200, 610), new Point(200, 720), new Point(140, 720), new Point(140, 760));
+ new GUIWire(submodelModifiable, andorA10.getPin("Y4"), andorA11.getPin("C4"), new Point(195, 620), new Point(195, 715), new Point(135, 715), new Point(135, 770));
+ new GUIWire(submodelModifiable, andorA11.getPin("Y1"), QA1 , new Point(210, 740), new Point(210, 880), new Point(310, 880), new Point(310, 50));
+ new GUIWire(submodelModifiable, andorA11.getPin("Y2"), QA2 , new Point(205, 750), new Point(205, 885), new Point(315, 885), new Point(315, 150));
+ new GUIWire(submodelModifiable, andorA11.getPin("Y3"), QA3 , new Point(200, 760), new Point(200, 890), new Point(320, 890), new Point(320, 250));
+ new GUIWire(submodelModifiable, andorA11.getPin("Y4"), QA4 , new Point(195, 770), new Point(195, 895), new Point(325, 895), new Point(325, 350));
//@formatter:on
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin SA = getInputSubmodelPins().get(0);
- Pin SB = getInputSubmodelPins().get(1);
- Pin A1 = getInputSubmodelPins().get(2);
- Pin A2 = getInputSubmodelPins().get(3);
- Pin A3 = getInputSubmodelPins().get(4);
- Pin A4 = getInputSubmodelPins().get(5);
- Pin B1 = getInputSubmodelPins().get(6);
- Pin B2 = getInputSubmodelPins().get(7);
- Pin B3 = getInputSubmodelPins().get(8);
- Pin B4 = getInputSubmodelPins().get(9);
- Pin Y1 = getOutputSubmodelPins().get(0);
- Pin Y2 = getOutputSubmodelPins().get(1);
- Pin Y3 = getOutputSubmodelPins().get(2);
- Pin Y4 = getOutputSubmodelPins().get(3);
+ Pin SA = getSubmodelPin("SA");
+ Pin SB = getSubmodelPin("SB");
+ Pin A1 = getSubmodelPin("A1");
+ Pin A2 = getSubmodelPin("A2");
+ Pin A3 = getSubmodelPin("A3");
+ Pin A4 = getSubmodelPin("A4");
+ Pin B1 = getSubmodelPin("B1");
+ Pin B2 = getSubmodelPin("B2");
+ Pin B3 = getSubmodelPin("B3");
+ Pin B4 = getSubmodelPin("B4");
+ Pin Y1 = getSubmodelPin("Y1");
+ Pin Y2 = getSubmodelPin("Y2");
+ Pin Y3 = getSubmodelPin("Y3");
+ Pin Y4 = getSubmodelPin("Y4");
GUINandGate nandA1 = new GUINandGate(submodelModifiable, 1);
GUINandGate nandA2 = new GUINandGate(submodelModifiable, 1);
cpA3.moveCenterTo(7.5, 117.5);
cpB3.moveCenterTo(5, 142.5);
- new GUIWire(submodelModifiable, A1, nandA1.getInputPins().get(0), new Point(15, 62.5), new Point(15, 7.5));
- new GUIWire(submodelModifiable, A2, nandA2.getInputPins().get(0), new Point(17.5, 87.5), new Point(17.5, 57.5));
- new GUIWire(submodelModifiable, A3, nandA3.getInputPins().get(0), new Point(17.5, 112.5), new Point(17.5, 107.5));
- new GUIWire(submodelModifiable, A4, nandA4.getInputPins().get(0), new Point(17.5, 137.5), new Point(17.5, 157.5));
- new GUIWire(submodelModifiable, B1, nandB1.getInputPins().get(0), new Point(10, 162.5), new Point(10, 32.5));
- new GUIWire(submodelModifiable, B2, nandB2.getInputPins().get(0), new Point(12.5, 187.5), new Point(12.5, 82.5));
- new GUIWire(submodelModifiable, B3, nandB3.getInputPins().get(0), new Point(15, 212.5), new Point(15, 132.5));
- new GUIWire(submodelModifiable, B4, nandB4.getInputPins().get(0), new Point(10, 237.5), new Point(10, 182.5));
+ new GUIWire(submodelModifiable, A1, nandA1.getPin("A"), new Point(15, 62.5), new Point(15, 7.5));
+ new GUIWire(submodelModifiable, A2, nandA2.getPin("A"), new Point(17.5, 87.5), new Point(17.5, 57.5));
+ new GUIWire(submodelModifiable, A3, nandA3.getPin("A"), new Point(17.5, 112.5), new Point(17.5, 107.5));
+ new GUIWire(submodelModifiable, A4, nandA4.getPin("A"), new Point(17.5, 137.5), new Point(17.5, 157.5));
+ new GUIWire(submodelModifiable, B1, nandB1.getPin("A"), new Point(10, 162.5), new Point(10, 32.5));
+ new GUIWire(submodelModifiable, B2, nandB2.getPin("A"), new Point(12.5, 187.5), new Point(12.5, 82.5));
+ new GUIWire(submodelModifiable, B3, nandB3.getPin("A"), new Point(15, 212.5), new Point(15, 132.5));
+ new GUIWire(submodelModifiable, B4, nandB4.getPin("A"), new Point(10, 237.5), new Point(10, 182.5));
new GUIWire(submodelModifiable, SA, cpA1);
new GUIWire(submodelModifiable, SB, cpB1);
new GUIWire(submodelModifiable, cpA1, cpA2);
- new GUIWire(submodelModifiable, cpA1, nandA1.getInputPins().get(1));
+ new GUIWire(submodelModifiable, cpA1, nandA1.getPin("B"));
new GUIWire(submodelModifiable, cpA2, cpA3);
- new GUIWire(submodelModifiable, cpA2, nandA2.getInputPins().get(1));
- new GUIWire(submodelModifiable, cpA3, nandA3.getInputPins().get(1));
- new GUIWire(submodelModifiable, cpA3, nandA4.getInputPins().get(1), new Point(7.5, 167.5));
+ new GUIWire(submodelModifiable, cpA2, nandA2.getPin("B"));
+ new GUIWire(submodelModifiable, cpA3, nandA3.getPin("B"));
+ new GUIWire(submodelModifiable, cpA3, nandA4.getPin("B"), new Point(7.5, 167.5));
new GUIWire(submodelModifiable, cpB1, cpB2);
- new GUIWire(submodelModifiable, cpB1, nandB1.getInputPins().get(1));
+ new GUIWire(submodelModifiable, cpB1, nandB1.getPin("B"));
new GUIWire(submodelModifiable, cpB2, cpB3);
- new GUIWire(submodelModifiable, cpB2, nandB2.getInputPins().get(1));
- new GUIWire(submodelModifiable, cpB3, nandB3.getInputPins().get(1));
- new GUIWire(submodelModifiable, cpB3, nandB4.getInputPins().get(1), new Point(5, 192.5));
- new GUIWire(submodelModifiable, nandA1.getOutputPin(), nandY1.getInputPins().get(0), new Point(42.5, 12.5), new Point(42.5, 7.5));
- new GUIWire(submodelModifiable, nandB1.getOutputPin(), nandY1.getInputPins().get(1), new Point(45, 37.5), new Point(45, 17.5));
- new GUIWire(submodelModifiable, nandA2.getOutputPin(), nandY2.getInputPins().get(0), new Point(47.5, 62.5), new Point(47.5, 32.5));
- new GUIWire(submodelModifiable, nandB2.getOutputPin(), nandY2.getInputPins().get(1), new Point(50, 87.5), new Point(50, 42.5));
- new GUIWire(submodelModifiable, nandA3.getOutputPin(), nandY3.getInputPins().get(0), new Point(52.5, 112.5), new Point(52.5, 57.5));
- new GUIWire(submodelModifiable, nandB3.getOutputPin(), nandY3.getInputPins().get(1), new Point(55, 137.5), new Point(55, 67.5));
- new GUIWire(submodelModifiable, nandA4.getOutputPin(), nandY4.getInputPins().get(0), new Point(57.5, 162.5), new Point(57.5, 82.5));
- new GUIWire(submodelModifiable, nandB4.getOutputPin(), nandY4.getInputPins().get(1), new Point(60, 187.5), new Point(60, 92.5));
- new GUIWire(submodelModifiable, nandY1.getOutputPin(), Y1, new Point[0]);
- new GUIWire(submodelModifiable, nandY2.getOutputPin(), Y2, new Point[0]);
- new GUIWire(submodelModifiable, nandY3.getOutputPin(), Y3, new Point[0]);
- new GUIWire(submodelModifiable, nandY4.getOutputPin(), Y4, new Point[0]);
+ new GUIWire(submodelModifiable, cpB2, nandB2.getPin("B"));
+ new GUIWire(submodelModifiable, cpB3, nandB3.getPin("B"));
+ new GUIWire(submodelModifiable, cpB3, nandB4.getPin("B"), new Point(5, 192.5));
+ new GUIWire(submodelModifiable, nandA1.getPin("Y"), nandY1.getPin("A"), new Point(42.5, 12.5), new Point(42.5, 7.5));
+ new GUIWire(submodelModifiable, nandB1.getPin("Y"), nandY1.getPin("B"), new Point(45, 37.5), new Point(45, 17.5));
+ new GUIWire(submodelModifiable, nandA2.getPin("Y"), nandY2.getPin("A"), new Point(47.5, 62.5), new Point(47.5, 32.5));
+ new GUIWire(submodelModifiable, nandB2.getPin("Y"), nandY2.getPin("B"), new Point(50, 87.5), new Point(50, 42.5));
+ new GUIWire(submodelModifiable, nandA3.getPin("Y"), nandY3.getPin("A"), new Point(52.5, 112.5), new Point(52.5, 57.5));
+ new GUIWire(submodelModifiable, nandB3.getPin("Y"), nandY3.getPin("B"), new Point(55, 137.5), new Point(55, 67.5));
+ new GUIWire(submodelModifiable, nandA4.getPin("Y"), nandY4.getPin("A"), new Point(57.5, 162.5), new Point(57.5, 82.5));
+ new GUIWire(submodelModifiable, nandB4.getPin("Y"), nandY4.getPin("B"), new Point(60, 187.5), new Point(60, 92.5));
+ new GUIWire(submodelModifiable, nandY1.getPin("Y"), Y1, new Point[0]);
+ new GUIWire(submodelModifiable, nandY2.getPin("Y"), Y2, new Point[0]);
+ new GUIWire(submodelModifiable, nandY3.getPin("Y"), Y3, new Point[0]);
+ new GUIWire(submodelModifiable, nandY4.getPin("Y"), Y4, new Point[0]);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin SA = getInputSubmodelPins().get(0);
- Pin SB = getInputSubmodelPins().get(1);
- Pin SC = getInputSubmodelPins().get(2);
- Pin A1 = getInputSubmodelPins().get(3);
- Pin A2 = getInputSubmodelPins().get(4);
- Pin A3 = getInputSubmodelPins().get(5);
- Pin A4 = getInputSubmodelPins().get(6);
- Pin B1 = getInputSubmodelPins().get(7);
- Pin B2 = getInputSubmodelPins().get(8);
- Pin B3 = getInputSubmodelPins().get(9);
- Pin B4 = getInputSubmodelPins().get(10);
- Pin C1 = getInputSubmodelPins().get(11);
- Pin C2 = getInputSubmodelPins().get(12);
- Pin C3 = getInputSubmodelPins().get(13);
- Pin C4 = getInputSubmodelPins().get(14);
- Pin Y1 = getOutputSubmodelPins().get(0);
- Pin Y2 = getOutputSubmodelPins().get(1);
- Pin Y3 = getOutputSubmodelPins().get(2);
- Pin Y4 = getOutputSubmodelPins().get(3);
+ Pin SA = getSubmodelPin("SA");
+ Pin SB = getSubmodelPin("SB");
+ Pin SC = getSubmodelPin("SC");
+ Pin A1 = getSubmodelPin("A1");
+ Pin A2 = getSubmodelPin("A2");
+ Pin A3 = getSubmodelPin("A3");
+ Pin A4 = getSubmodelPin("A4");
+ Pin B1 = getSubmodelPin("B1");
+ Pin B2 = getSubmodelPin("B2");
+ Pin B3 = getSubmodelPin("B3");
+ Pin B4 = getSubmodelPin("B4");
+ Pin C1 = getSubmodelPin("C1");
+ Pin C2 = getSubmodelPin("C2");
+ Pin C3 = getSubmodelPin("C3");
+ Pin C4 = getSubmodelPin("C4");
+ Pin Y1 = getSubmodelPin("Y1");
+ Pin Y2 = getSubmodelPin("Y2");
+ Pin Y3 = getSubmodelPin("Y3");
+ Pin Y4 = getSubmodelPin("Y4");
GUIsel2_4 sel2_4 = new GUIsel2_4(submodelModifiable);
GUInot4 not4 = new GUInot4(submodelModifiable);
cpSC2.moveCenterTo(30, 635);
cpSC3.moveCenterTo(30, 685);
- new GUIWire(submodelModifiable, SA, sel2_4.getInputPins().get(0), new Point(25, 25), new Point(25, 255));
- new GUIWire(submodelModifiable, SB, sel2_4.getInputPins().get(1), new Point(20, 75), new Point(20, 265));
- new GUIWire(submodelModifiable, A1, sel2_4.getInputPins().get(2), new Point(15, 175), new Point(15, 275));
- new GUIWire(submodelModifiable, A2, sel2_4.getInputPins().get(3), new Point(10, 225), new Point(10, 285));
- new GUIWire(submodelModifiable, A3, sel2_4.getInputPins().get(4), new Point(5, 275), new Point(5, 295));
- new GUIWire(submodelModifiable, A4, sel2_4.getInputPins().get(5), new Point(5, 325), new Point(5, 305));
- new GUIWire(submodelModifiable, B1, sel2_4.getInputPins().get(6), new Point(10, 375), new Point(10, 315));
- new GUIWire(submodelModifiable, B2, sel2_4.getInputPins().get(7), new Point(15, 425), new Point(15, 325));
- new GUIWire(submodelModifiable, B3, sel2_4.getInputPins().get(8), new Point(20, 475), new Point(20, 335));
- new GUIWire(submodelModifiable, B4, sel2_4.getInputPins().get(9), new Point(25, 525), new Point(25, 345));
- new GUIWire(submodelModifiable, sel2_4.getOutputPins().get(0), not4.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, sel2_4.getOutputPins().get(1), not4.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, sel2_4.getOutputPins().get(2), not4.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, sel2_4.getOutputPins().get(3), not4.getInputPins().get(3), new Point[0]);
+ new GUIWire(submodelModifiable, SA, sel2_4.getPin("SA"), new Point(25, 25), new Point(25, 255));
+ new GUIWire(submodelModifiable, SB, sel2_4.getPin("SB"), new Point(20, 75), new Point(20, 265));
+ new GUIWire(submodelModifiable, A1, sel2_4.getPin("A1"), new Point(15, 175), new Point(15, 275));
+ new GUIWire(submodelModifiable, A2, sel2_4.getPin("A2"), new Point(10, 225), new Point(10, 285));
+ new GUIWire(submodelModifiable, A3, sel2_4.getPin("A3"), new Point(5, 275), new Point(5, 295));
+ new GUIWire(submodelModifiable, A4, sel2_4.getPin("A4"), new Point(5, 325), new Point(5, 305));
+ new GUIWire(submodelModifiable, B1, sel2_4.getPin("B1"), new Point(10, 375), new Point(10, 315));
+ new GUIWire(submodelModifiable, B2, sel2_4.getPin("B2"), new Point(15, 425), new Point(15, 325));
+ new GUIWire(submodelModifiable, B3, sel2_4.getPin("B3"), new Point(20, 475), new Point(20, 335));
+ new GUIWire(submodelModifiable, B4, sel2_4.getPin("B4"), new Point(25, 525), new Point(25, 345));
+ new GUIWire(submodelModifiable, sel2_4.getPin("Y1"), not4.getPin("A1"), new Point[0]);
+ new GUIWire(submodelModifiable, sel2_4.getPin("Y2"), not4.getPin("A2"), new Point[0]);
+ new GUIWire(submodelModifiable, sel2_4.getPin("Y3"), not4.getPin("A3"), new Point[0]);
+ new GUIWire(submodelModifiable, sel2_4.getPin("Y4"), not4.getPin("A4"), new Point[0]);
new GUIWire(submodelModifiable, SC, cpSC1, new Point(30, 125));
- new GUIWire(submodelModifiable, cpSC1, nandC1.getInputPins().get(1), new Point[0]);
+ new GUIWire(submodelModifiable, cpSC1, nandC1.getPin("B"), new Point[0]);
new GUIWire(submodelModifiable, cpSC1, cpSC2, new Point(30, 125));
- new GUIWire(submodelModifiable, cpSC2, nandC2.getInputPins().get(1), new Point[0]);
+ new GUIWire(submodelModifiable, cpSC2, nandC2.getPin("B"), new Point[0]);
new GUIWire(submodelModifiable, cpSC2, cpSC3, new Point(30, 125));
- new GUIWire(submodelModifiable, cpSC3, nandC3.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpSC3, nandC4.getInputPins().get(1), new Point(30, 735));
- new GUIWire(submodelModifiable, C1, nandC1.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, C2, nandC2.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, C3, nandC3.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, C4, nandC4.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, not4.getOutputPins().get(0), nandY1.getInputPins().get(0), new Point(115, 255), new Point(115, 20));
- new GUIWire(submodelModifiable, not4.getOutputPins().get(1), nandY2.getInputPins().get(0), new Point(120, 265), new Point(120, 70));
- new GUIWire(submodelModifiable, not4.getOutputPins().get(2), nandY3.getInputPins().get(0), new Point(125, 275),
- new Point(125, 120));
- new GUIWire(submodelModifiable, not4.getOutputPins().get(3), nandY4.getInputPins().get(0), new Point(130, 285),
- new Point(130, 170));
- new GUIWire(submodelModifiable, nandC1.getOutputPin(), nandY1.getInputPins().get(1), new Point(135, 580), new Point(135, 30));
- new GUIWire(submodelModifiable, nandC2.getOutputPin(), nandY2.getInputPins().get(1), new Point(140, 630), new Point(140, 80));
- new GUIWire(submodelModifiable, nandC3.getOutputPin(), nandY3.getInputPins().get(1), new Point(145, 680), new Point(145, 130));
- new GUIWire(submodelModifiable, nandC4.getOutputPin(), nandY4.getInputPins().get(1), new Point(150, 730), new Point(150, 180));
- new GUIWire(submodelModifiable, nandY1.getOutputPin(), Y1, new Point[0]);
- new GUIWire(submodelModifiable, nandY2.getOutputPin(), Y2, new Point[0]);
- new GUIWire(submodelModifiable, nandY3.getOutputPin(), Y3, new Point[0]);
- new GUIWire(submodelModifiable, nandY4.getOutputPin(), Y4, new Point[0]);
+ new GUIWire(submodelModifiable, cpSC3, nandC3.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, cpSC3, nandC4.getPin("B"), new Point(30, 735));
+ new GUIWire(submodelModifiable, C1, nandC1.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, C2, nandC2.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, C3, nandC3.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, C4, nandC4.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, not4.getPin("Y1"), nandY1.getPin("A"), new Point(115, 255), new Point(115, 20));
+ new GUIWire(submodelModifiable, not4.getPin("Y2"), nandY2.getPin("A"), new Point(120, 265), new Point(120, 70));
+ new GUIWire(submodelModifiable, not4.getPin("Y3"), nandY3.getPin("A"), new Point(125, 275), new Point(125, 120));
+ new GUIWire(submodelModifiable, not4.getPin("Y4"), nandY4.getPin("A"), new Point(130, 285), new Point(130, 170));
+ new GUIWire(submodelModifiable, nandC1.getPin("Y"), nandY1.getPin("B"), new Point(135, 580), new Point(135, 30));
+ new GUIWire(submodelModifiable, nandC2.getPin("Y"), nandY2.getPin("B"), new Point(140, 630), new Point(140, 80));
+ new GUIWire(submodelModifiable, nandC3.getPin("Y"), nandY3.getPin("B"), new Point(145, 680), new Point(145, 130));
+ new GUIWire(submodelModifiable, nandC4.getPin("Y"), nandY4.getPin("B"), new Point(150, 730), new Point(150, 180));
+ new GUIWire(submodelModifiable, nandY1.getPin("Y"), Y1, new Point[0]);
+ new GUIWire(submodelModifiable, nandY2.getPin("Y"), Y2, new Point[0]);
+ new GUIWire(submodelModifiable, nandY3.getPin("Y"), Y3, new Point[0]);
+ new GUIWire(submodelModifiable, nandY4.getPin("Y"), Y4, new Point[0]);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin A = getInputSubmodelPins().get(0);
- Pin B = getInputSubmodelPins().get(1);
- Pin Y = getOutputSubmodelPins().get(0);
+ Pin A = getSubmodelPin("A");
+ Pin B = getSubmodelPin("B");
+ Pin Y = getSubmodelPin("Y");
GUINandGate nandAB = new GUINandGate(submodelModifiable, 1);
GUINandGate nandYA = new GUINandGate(submodelModifiable, 1);
new GUIWire(submodelModifiable, A, cpA, new Point[0]);
new GUIWire(submodelModifiable, B, cpB, new Point[0]);
- new GUIWire(submodelModifiable, cpA, nandAB.getInputPins().get(0), new Point(5, 20));
- new GUIWire(submodelModifiable, cpB, nandAB.getInputPins().get(1), new Point(5, 30));
- new GUIWire(submodelModifiable, nandAB.getOutputPin(), cpAB);
- new GUIWire(submodelModifiable, cpAB, nandYA.getInputPins().get(1), new Point(30, 17.5));
- new GUIWire(submodelModifiable, cpAB, nandYB.getInputPins().get(0), new Point(30, 32.5));
- new GUIWire(submodelModifiable, cpA, nandYA.getInputPins().get(0), new Point(5, 7.5));
- new GUIWire(submodelModifiable, cpB, nandYB.getInputPins().get(1), new Point(5, 42.5));
- new GUIWire(submodelModifiable, nandYA.getOutputPin(), nandY.getInputPins().get(0));
- new GUIWire(submodelModifiable, nandYB.getOutputPin(), nandY.getInputPins().get(1));
- new GUIWire(submodelModifiable, nandY.getOutputPin(), Y);
+ new GUIWire(submodelModifiable, cpA, nandAB.getPin("A"), new Point(5, 20));
+ new GUIWire(submodelModifiable, cpB, nandAB.getPin("B"), new Point(5, 30));
+ new GUIWire(submodelModifiable, nandAB.getPin("Y"), cpAB);
+ new GUIWire(submodelModifiable, cpAB, nandYA.getPin("B"), new Point(30, 17.5));
+ new GUIWire(submodelModifiable, cpAB, nandYB.getPin("A"), new Point(30, 32.5));
+ new GUIWire(submodelModifiable, cpA, nandYA.getPin("A"), new Point(5, 7.5));
+ new GUIWire(submodelModifiable, cpB, nandYB.getPin("B"), new Point(5, 42.5));
+ new GUIWire(submodelModifiable, nandYA.getPin("Y"), nandY.getPin("A"));
+ new GUIWire(submodelModifiable, nandYB.getPin("Y"), nandY.getPin("B"));
+ new GUIWire(submodelModifiable, nandY.getPin("Y"), Y);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin I5 = getInputSubmodelPins().get(0);
- Pin I4 = getInputSubmodelPins().get(1);
- Pin I3 = getInputSubmodelPins().get(2);
- Pin CinE = getOutputSubmodelPins().get(0);
- Pin L = getOutputSubmodelPins().get(1);
- Pin SBE = getOutputSubmodelPins().get(2);
+ Pin I5 = getSubmodelPin("I5");
+ Pin I4 = getSubmodelPin("I4");
+ Pin I3 = getSubmodelPin("I3");
+ Pin CinE = getSubmodelPin("CinE");
+ Pin L = getSubmodelPin("L");
+ Pin SBE = getSubmodelPin("SBE");
GUINandGate notI5 = new GUINandGate(submodelModifiable, 1);
GUINandGate notI4 = new GUINandGate(submodelModifiable, 1);
cpNotI52.moveCenterTo(40, 35);
new GUIWire(submodelModifiable, I5, cpI51, new Point[0]);
- new GUIWire(submodelModifiable, cpI51, notI5.getInputPins().get(0), new Point(5, 15));
+ new GUIWire(submodelModifiable, cpI51, notI5.getPin("A"), new Point(5, 15));
new GUIWire(submodelModifiable, cpI51, cpI52, new Point[0]);
- new GUIWire(submodelModifiable, cpI52, notI5.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpI52, nandI5NotI4.getInputPins().get(0), new Point(5, 45), new Point(45, 45), new Point(45, 50));
+ new GUIWire(submodelModifiable, cpI52, notI5.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, cpI52, nandI5NotI4.getPin("A"), new Point(5, 45), new Point(45, 45), new Point(45, 50));
new GUIWire(submodelModifiable, I4, cpI41, new Point[0]);
new GUIWire(submodelModifiable, cpI41, cpI42, new Point[0]);
- new GUIWire(submodelModifiable, cpI42, nandI4I3NotI5.getInputPins().get(0), new Point(10, 40), new Point(45, 40),
- new Point(45, 15));
- new GUIWire(submodelModifiable, cpI42, notI4.getInputPins().get(0), new Point[0]);
+ new GUIWire(submodelModifiable, cpI42, nandI4I3NotI5.getPin("A"), new Point(10, 40), new Point(45, 40), new Point(45, 15));
+ new GUIWire(submodelModifiable, cpI42, notI4.getPin("A"), new Point[0]);
new GUIWire(submodelModifiable, cpI41, cpI43, new Point[0]);
- new GUIWire(submodelModifiable, cpI43, notI4.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpI43, nandI3I4.getInputPins().get(1), new Point(10, 85));
+ new GUIWire(submodelModifiable, cpI43, notI4.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, cpI43, nandI3I4.getPin("B"), new Point(10, 85));
new GUIWire(submodelModifiable, I3, cpI3, new Point(50, 100));
- new GUIWire(submodelModifiable, cpI3, nandI4I3NotI5.getInputPins().get(1), new Point(50, 25));
- new GUIWire(submodelModifiable, cpI3, nandI3I4.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, notI5.getOutputPin(), cpNotI51, new Point[0]);
+ new GUIWire(submodelModifiable, cpI3, nandI4I3NotI5.getPin("B"), new Point(50, 25));
+ new GUIWire(submodelModifiable, cpI3, nandI3I4.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, notI5.getPin("Y"), cpNotI51, new Point[0]);
new GUIWire(submodelModifiable, cpNotI51, CinE, new Point(40, 5), new Point(115, 5), new Point(115, 20));
new GUIWire(submodelModifiable, cpNotI51, cpNotI52, new Point[0]);
- new GUIWire(submodelModifiable, cpNotI52, nandI4I3NotI5.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, cpNotI52, andSBE.getInputPins().get(1), new Point(40, 110));
- new GUIWire(submodelModifiable, notI4.getOutputPin(), nandI5NotI4.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, nandI4I3NotI5.getOutputPins().get(0), nandL.getInputPins().get(0));
- new GUIWire(submodelModifiable, nandI5NotI4.getOutputPin(), nandL.getInputPins().get(1));
- new GUIWire(submodelModifiable, nandI3I4.getOutputPin(), andSBE.getInputPins().get(0));
- new GUIWire(submodelModifiable, nandL.getOutputPin(), L, new Point[0]);
- new GUIWire(submodelModifiable, andSBE.getOutputPins().get(0), SBE, new Point[0]);
+ new GUIWire(submodelModifiable, cpNotI52, nandI4I3NotI5.getPin("C"), new Point[0]);
+ new GUIWire(submodelModifiable, cpNotI52, andSBE.getPin("B"), new Point(40, 110));
+ new GUIWire(submodelModifiable, notI4.getPin("Y"), nandI5NotI4.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, nandI4I3NotI5.getPin("Y"), nandL.getPin("A"));
+ new GUIWire(submodelModifiable, nandI5NotI4.getPin("Y"), nandL.getPin("B"));
+ new GUIWire(submodelModifiable, nandI3I4.getPin("Y"), andSBE.getPin("A"));
+ new GUIWire(submodelModifiable, nandL.getPin("Y"), L, new Point[0]);
+ new GUIWire(submodelModifiable, andSBE.getPin("Y"), SBE, new Point[0]);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin I5 = getInputSubmodelPins().get(0);
- Pin I4 = getInputSubmodelPins().get(1);
- Pin I3 = getInputSubmodelPins().get(2);
- Pin Cn = getInputSubmodelPins().get(3);
- Pin R1 = getInputSubmodelPins().get(4);
- Pin R2 = getInputSubmodelPins().get(5);
- Pin R3 = getInputSubmodelPins().get(6);
- Pin R4 = getInputSubmodelPins().get(7);
- Pin S1 = getInputSubmodelPins().get(8);
- Pin S2 = getInputSubmodelPins().get(9);
- Pin S3 = getInputSubmodelPins().get(10);
- Pin S4 = getInputSubmodelPins().get(11);
- Pin F1 = getOutputSubmodelPins().get(0);
- Pin F2 = getOutputSubmodelPins().get(1);
- Pin F3 = getOutputSubmodelPins().get(2);
- Pin F4 = getOutputSubmodelPins().get(3);
- Pin Cnplus4 = getOutputSubmodelPins().get(4);
- Pin OVR = getOutputSubmodelPins().get(5);
+ Pin I5 = getSubmodelPin("I5");
+ Pin I4 = getSubmodelPin("I4");
+ Pin I3 = getSubmodelPin("I3");
+ Pin Cn = getSubmodelPin("Cn");
+ Pin R1 = getSubmodelPin("R1");
+ Pin R2 = getSubmodelPin("R2");
+ Pin R3 = getSubmodelPin("R3");
+ Pin R4 = getSubmodelPin("R4");
+ Pin S1 = getSubmodelPin("S1");
+ Pin S2 = getSubmodelPin("S2");
+ Pin S3 = getSubmodelPin("S3");
+ Pin S4 = getSubmodelPin("S4");
+ Pin F1 = getSubmodelPin("F1");
+ Pin F2 = getSubmodelPin("F2");
+ Pin F3 = getSubmodelPin("F3");
+ Pin F4 = getSubmodelPin("F4");
+ Pin Cnplus4 = getSubmodelPin("Cnplus4");
+ Pin OVR = getSubmodelPin("OVR");
GUIAm2901ALUFuncDecode funcDecode = new GUIAm2901ALUFuncDecode(submodelModifiable);
GUIAm2901ALUOneBit alu1 = new GUIAm2901ALUOneBit(submodelModifiable);
cpCnplus4.moveCenterTo(85, 385);
new GUIWire(submodelModifiable, I5, cpI5, new Point[0]);
- new GUIWire(submodelModifiable, cpI5, funcDecode.getInputPins().get(0), new Point(5, 30));
+ new GUIWire(submodelModifiable, cpI5, funcDecode.getPin("I5"), new Point(5, 30));
new GUIWire(submodelModifiable, I4, cpI4, new Point[0]);
- new GUIWire(submodelModifiable, cpI4, funcDecode.getInputPins().get(1), new Point(5, 40));
+ new GUIWire(submodelModifiable, cpI4, funcDecode.getPin("I4"), new Point(5, 40));
new GUIWire(submodelModifiable, I3, cpI3, new Point(10, 100));
- new GUIWire(submodelModifiable, cpI3, funcDecode.getInputPins().get(2), new Point(10, 50));
- new GUIWire(submodelModifiable, funcDecode.getOutputPins().get(2), cpCoutE1, new Point(52.5, 50), new Point(52.5, 57.5),
+ new GUIWire(submodelModifiable, cpI3, funcDecode.getPin("I3"), new Point(10, 50));
+ new GUIWire(submodelModifiable, funcDecode.getPin("SBE"), cpCoutE1, new Point(52.5, 50), new Point(52.5, 57.5),
new Point(25, 57.5));
new GUIWire(submodelModifiable, cpCoutE1, cpCoutE2, new Point[0]);
new GUIWire(submodelModifiable, cpCoutE2, cpCoutE3, new Point[0]);
- new GUIWire(submodelModifiable, cpCoutE1, alu1.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpCoutE2, alu2.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpCoutE3, alu3.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpCoutE3, alu4.getInputPins().get(1), new Point(25, 395));
- new GUIWire(submodelModifiable, funcDecode.getOutputPins().get(0), cpCinE1, new Point(57.5, 30), new Point(57.5, 62.5),
+ new GUIWire(submodelModifiable, cpCoutE1, alu1.getPin("CoutE"), new Point[0]);
+ new GUIWire(submodelModifiable, cpCoutE2, alu2.getPin("CoutE"), new Point[0]);
+ new GUIWire(submodelModifiable, cpCoutE3, alu3.getPin("CoutE"), new Point[0]);
+ new GUIWire(submodelModifiable, cpCoutE3, alu4.getPin("CoutE"), new Point(25, 395));
+ new GUIWire(submodelModifiable, funcDecode.getPin("CinE"), cpCinE1, new Point(57.5, 30), new Point(57.5, 62.5),
new Point(27.5, 62.5));
new GUIWire(submodelModifiable, cpCinE1, cpCinE2, new Point[0]);
new GUIWire(submodelModifiable, cpCinE2, cpCinE3, new Point[0]);
- new GUIWire(submodelModifiable, cpCinE1, alu1.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, cpCinE2, alu2.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, cpCinE3, alu3.getInputPins().get(2), new Point[0]);
- new GUIWire(submodelModifiable, cpCinE3, alu4.getInputPins().get(2), new Point(27.5, 405));
+ new GUIWire(submodelModifiable, cpCinE1, alu1.getPin("CinE"), new Point[0]);
+ new GUIWire(submodelModifiable, cpCinE2, alu2.getPin("CinE"), new Point[0]);
+ new GUIWire(submodelModifiable, cpCinE3, alu3.getPin("CinE"), new Point[0]);
+ new GUIWire(submodelModifiable, cpCinE3, alu4.getPin("CinE"), new Point(27.5, 405));
new GUIWire(submodelModifiable, cpI3, cpRN1, new Point(30, 65));
new GUIWire(submodelModifiable, cpRN1, cpRN2, new Point[0]);
new GUIWire(submodelModifiable, cpRN2, cpRN3, new Point[0]);
- new GUIWire(submodelModifiable, cpRN1, alu1.getInputPins().get(4), new Point[0]);
- new GUIWire(submodelModifiable, cpRN2, alu2.getInputPins().get(4), new Point[0]);
- new GUIWire(submodelModifiable, cpRN3, alu3.getInputPins().get(4), new Point[0]);
- new GUIWire(submodelModifiable, cpRN3, alu4.getInputPins().get(4), new Point(30, 425));
+ new GUIWire(submodelModifiable, cpRN1, alu1.getPin("RN"), new Point[0]);
+ new GUIWire(submodelModifiable, cpRN2, alu2.getPin("RN"), new Point[0]);
+ new GUIWire(submodelModifiable, cpRN3, alu3.getPin("RN"), new Point[0]);
+ new GUIWire(submodelModifiable, cpRN3, alu4.getPin("RN"), new Point(30, 425));
new GUIWire(submodelModifiable, cpI4, cpSN1, new Point(32.5, 60));
new GUIWire(submodelModifiable, cpSN1, cpSN2, new Point[0]);
new GUIWire(submodelModifiable, cpSN2, cpSN3, new Point[0]);
- new GUIWire(submodelModifiable, cpSN1, alu1.getInputPins().get(6), new Point[0]);
- new GUIWire(submodelModifiable, cpSN2, alu2.getInputPins().get(6), new Point[0]);
- new GUIWire(submodelModifiable, cpSN3, alu3.getInputPins().get(6), new Point[0]);
- new GUIWire(submodelModifiable, cpSN3, alu4.getInputPins().get(6), new Point(32.5, 445));
+ new GUIWire(submodelModifiable, cpSN1, alu1.getPin("SN"), new Point[0]);
+ new GUIWire(submodelModifiable, cpSN2, alu2.getPin("SN"), new Point[0]);
+ new GUIWire(submodelModifiable, cpSN3, alu3.getPin("SN"), new Point[0]);
+ new GUIWire(submodelModifiable, cpSN3, alu4.getPin("SN"), new Point(32.5, 445));
new GUIWire(submodelModifiable, cpI5, cpFN1, new Point(60, 20), new Point(60, 65), new Point(35, 65));
new GUIWire(submodelModifiable, cpFN1, cpFN2, new Point[0]);
new GUIWire(submodelModifiable, cpFN2, cpFN3, new Point[0]);
- new GUIWire(submodelModifiable, cpFN1, alu1.getInputPins().get(7), new Point[0]);
- new GUIWire(submodelModifiable, cpFN2, alu2.getInputPins().get(7), new Point[0]);
- new GUIWire(submodelModifiable, cpFN3, alu3.getInputPins().get(7), new Point[0]);
- new GUIWire(submodelModifiable, cpFN3, alu4.getInputPins().get(7), new Point(35, 455));
- new GUIWire(submodelModifiable, funcDecode.getOutputPins().get(1), cpL1, new Point(55, 40), new Point(55, 60), new Point(37.5, 60));
+ new GUIWire(submodelModifiable, cpFN1, alu1.getPin("FN"), new Point[0]);
+ new GUIWire(submodelModifiable, cpFN2, alu2.getPin("FN"), new Point[0]);
+ new GUIWire(submodelModifiable, cpFN3, alu3.getPin("FN"), new Point[0]);
+ new GUIWire(submodelModifiable, cpFN3, alu4.getPin("FN"), new Point(35, 455));
+ new GUIWire(submodelModifiable, funcDecode.getPin("L"), cpL1, new Point(55, 40), new Point(55, 60), new Point(37.5, 60));
new GUIWire(submodelModifiable, cpL1, cpL2, new Point[0]);
new GUIWire(submodelModifiable, cpL2, cpL3, new Point[0]);
- new GUIWire(submodelModifiable, cpL1, alu1.getInputPins().get(8), new Point[0]);
- new GUIWire(submodelModifiable, cpL2, alu2.getInputPins().get(8), new Point[0]);
- new GUIWire(submodelModifiable, cpL3, alu3.getInputPins().get(8), new Point[0]);
- new GUIWire(submodelModifiable, cpL3, alu4.getInputPins().get(8), new Point(37.5, 465));
- new GUIWire(submodelModifiable, R1, alu1.getInputPins().get(3), new Point(10, 180), new Point(10, 115));
- new GUIWire(submodelModifiable, R2, alu2.getInputPins().get(3), new Point(10, 220), new Point(10, 215));
- new GUIWire(submodelModifiable, R3, alu3.getInputPins().get(3), new Point(10, 260), new Point(10, 315));
- new GUIWire(submodelModifiable, R4, alu4.getInputPins().get(3), new Point(20, 300), new Point(20, 415));
- new GUIWire(submodelModifiable, S1, alu1.getInputPins().get(5), new Point(15, 340), new Point(15, 135));
- new GUIWire(submodelModifiable, S2, alu2.getInputPins().get(5), new Point(5, 380), new Point(5, 235));
- new GUIWire(submodelModifiable, S3, alu3.getInputPins().get(5), new Point(10, 420), new Point(10, 335));
- new GUIWire(submodelModifiable, S4, alu4.getInputPins().get(5), new Point(10, 460), new Point(10, 435));
- new GUIWire(submodelModifiable, Cn, alu1.getInputPins().get(0), new Point(5, 140), new Point(5, 85));
- new GUIWire(submodelModifiable, alu1.getOutputPins().get(0), alu2.getInputPins().get(0), new Point(85, 85), new Point(85, 175),
- new Point(40, 175), new Point(40, 185));
- new GUIWire(submodelModifiable, alu2.getOutputPins().get(0), alu3.getInputPins().get(0), new Point(85, 185), new Point(85, 275),
- new Point(40, 275), new Point(40, 285));
- new GUIWire(submodelModifiable, alu3.getOutputPins().get(0), cpCnplus3, new Point(85, 285));
- new GUIWire(submodelModifiable, cpCnplus3, alu4.getInputPins().get(0), new Point(40, 375), new Point(40, 385));
- new GUIWire(submodelModifiable, alu4.getOutputPins().get(0), cpCnplus4, new Point[0]);
- new GUIWire(submodelModifiable, alu1.getOutputPins().get(1), F1, new Point(90, 95), new Point(90, 20));
- new GUIWire(submodelModifiable, alu2.getOutputPins().get(1), F2, new Point(95, 195), new Point(95, 60));
- new GUIWire(submodelModifiable, alu3.getOutputPins().get(1), F3, new Point(100, 295), new Point(100, 100));
- new GUIWire(submodelModifiable, alu4.getOutputPins().get(1), F4, new Point(105, 395), new Point(105, 140));
- new GUIWire(submodelModifiable, cpCnplus3, xorOVR.getInputPins().get(0), new Point(90, 375), new Point(90, 405));
- new GUIWire(submodelModifiable, cpCnplus4, xorOVR.getInputPins().get(1), new Point(85, 415));
+ new GUIWire(submodelModifiable, cpL1, alu1.getPin("L"), new Point[0]);
+ new GUIWire(submodelModifiable, cpL2, alu2.getPin("L"), new Point[0]);
+ new GUIWire(submodelModifiable, cpL3, alu3.getPin("L"), new Point[0]);
+ new GUIWire(submodelModifiable, cpL3, alu4.getPin("L"), new Point(37.5, 465));
+ new GUIWire(submodelModifiable, R1, alu1.getPin("R"), new Point(10, 180), new Point(10, 115));
+ new GUIWire(submodelModifiable, R2, alu2.getPin("R"), new Point(10, 220), new Point(10, 215));
+ new GUIWire(submodelModifiable, R3, alu3.getPin("R"), new Point(10, 260), new Point(10, 315));
+ new GUIWire(submodelModifiable, R4, alu4.getPin("R"), new Point(20, 300), new Point(20, 415));
+ new GUIWire(submodelModifiable, S1, alu1.getPin("S"), new Point(15, 340), new Point(15, 135));
+ new GUIWire(submodelModifiable, S2, alu2.getPin("S"), new Point(5, 380), new Point(5, 235));
+ new GUIWire(submodelModifiable, S3, alu3.getPin("S"), new Point(10, 420), new Point(10, 335));
+ new GUIWire(submodelModifiable, S4, alu4.getPin("S"), new Point(10, 460), new Point(10, 435));
+ new GUIWire(submodelModifiable, Cn, alu1.getPin("Cin"), new Point(5, 140), new Point(5, 85));
+ new GUIWire(submodelModifiable, alu1.getPin("Cout"), alu2.getPin("Cin"), new Point(85, 85), new Point(85, 175), new Point(40, 175),
+ new Point(40, 185));
+ new GUIWire(submodelModifiable, alu2.getPin("Cout"), alu3.getPin("Cin"), new Point(85, 185), new Point(85, 275), new Point(40, 275),
+ new Point(40, 285));
+ new GUIWire(submodelModifiable, alu3.getPin("Cout"), cpCnplus3, new Point(85, 285));
+ new GUIWire(submodelModifiable, cpCnplus3, alu4.getPin("Cin"), new Point(40, 375), new Point(40, 385));
+ new GUIWire(submodelModifiable, alu4.getPin("Cout"), cpCnplus4, new Point[0]);
+ new GUIWire(submodelModifiable, alu1.getPin("F"), F1, new Point(90, 95), new Point(90, 20));
+ new GUIWire(submodelModifiable, alu2.getPin("F"), F2, new Point(95, 195), new Point(95, 60));
+ new GUIWire(submodelModifiable, alu3.getPin("F"), F3, new Point(100, 295), new Point(100, 100));
+ new GUIWire(submodelModifiable, alu4.getPin("F"), F4, new Point(105, 395), new Point(105, 140));
+ new GUIWire(submodelModifiable, cpCnplus3, xorOVR.getPin("A"), new Point(90, 375), new Point(90, 405));
+ new GUIWire(submodelModifiable, cpCnplus4, xorOVR.getPin("B"), new Point(85, 415));
new GUIWire(submodelModifiable, cpCnplus4, Cnplus4, new Point(130, 385), new Point(130, 180));
- new GUIWire(submodelModifiable, xorOVR.getOutputPins().get(0), OVR);
+ new GUIWire(submodelModifiable, xorOVR.getPin("Y"), OVR);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin Cin = getInputSubmodelPins().get(0);
- Pin CoutE = getInputSubmodelPins().get(1);
- Pin CinE = getInputSubmodelPins().get(2);
- Pin R = getInputSubmodelPins().get(3);
- Pin RN = getInputSubmodelPins().get(4);
- Pin S = getInputSubmodelPins().get(5);
- Pin SN = getInputSubmodelPins().get(6);
- Pin FN = getInputSubmodelPins().get(7);
- Pin L = getInputSubmodelPins().get(8);
- Pin Cout = getOutputSubmodelPins().get(0);
- Pin F = getOutputSubmodelPins().get(1);
+ Pin Cin = getSubmodelPin("Cin");
+ Pin CoutE = getSubmodelPin("CoutE");
+ Pin CinE = getSubmodelPin("CinE");
+ Pin R = getSubmodelPin("R");
+ Pin RN = getSubmodelPin("RN");
+ Pin S = getSubmodelPin("S");
+ Pin SN = getSubmodelPin("SN");
+ Pin FN = getSubmodelPin("FN");
+ Pin L = getSubmodelPin("L");
+ Pin Cout = getSubmodelPin("Cout");
+ Pin F = getSubmodelPin("F");
GUIand Cinand = new GUIand(submodelModifiable);
GUIxor Rxor = new GUIxor(submodelModifiable);
cpRXored.moveCenterTo(50, 60);
cpSXored.moveCenterTo(55, 70);
- new GUIWire(submodelModifiable, Cin, Cinand.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, CoutE, Coutand.getInputPins().get(0), new Point(5, 75), new Point(5, 10), new Point(130, 10),
+ new GUIWire(submodelModifiable, Cin, Cinand.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, CoutE, Coutand.getPin("A"), new Point(5, 75), new Point(5, 10), new Point(130, 10),
new Point(130, 25));
- new GUIWire(submodelModifiable, CinE, Cinand.getInputPins().get(1), new Point(7.5, 125), new Point(7.5, 35));
- new GUIWire(submodelModifiable, R, Rxor.getInputPins().get(0));
- new GUIWire(submodelModifiable, RN, Rxor.getInputPins().get(1));
- new GUIWire(submodelModifiable, S, Sxor.getInputPins().get(0));
- new GUIWire(submodelModifiable, SN, Sxor.getInputPins().get(1));
- new GUIWire(submodelModifiable, FN, Fxor.getInputPins().get(1), new Point(130, 375), new Point(130, 85));
- new GUIWire(submodelModifiable, L, Fsel.getInputPins().get(0), new Point(87.5, 425), new Point(87.5, 75));
- new GUIWire(submodelModifiable, Cinand.getOutputPins().get(0), add.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, Rxor.getOutputPins().get(0), cpRXored, new Point(50, 195));
- new GUIWire(submodelModifiable, cpRXored, add.getInputPins().get(1), new Point(50, 35));
- new GUIWire(submodelModifiable, cpRXored, nand.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, Sxor.getOutputPins().get(0), cpSXored, new Point(55, 295));
- new GUIWire(submodelModifiable, cpSXored, add.getInputPins().get(2), new Point(55, 45));
- new GUIWire(submodelModifiable, cpSXored, nand.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, add.getOutputPins().get(0), Fsel.getInputPins().get(1), new Point(100, 25), new Point(100, 65),
- new Point(85, 65), new Point(85, 85));
- new GUIWire(submodelModifiable, add.getOutputPins().get(1), Coutand.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, nand.getOutputPin(), Fsel.getInputPins().get(2), new Point(82.5, 65), new Point(82.5, 95));
- new GUIWire(submodelModifiable, Fsel.getOutputPins().get(0), Fxor.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, Coutand.getOutputPins().get(0), Cout, new Point[0]);
- new GUIWire(submodelModifiable, Fxor.getOutputPins().get(0), F, new Point[0]);
+ new GUIWire(submodelModifiable, CinE, Cinand.getPin("B"), new Point(7.5, 125), new Point(7.5, 35));
+ new GUIWire(submodelModifiable, R, Rxor.getPin("A"));
+ new GUIWire(submodelModifiable, RN, Rxor.getPin("B"));
+ new GUIWire(submodelModifiable, S, Sxor.getPin("A"));
+ new GUIWire(submodelModifiable, SN, Sxor.getPin("B"));
+ new GUIWire(submodelModifiable, FN, Fxor.getPin("B"), new Point(130, 375), new Point(130, 85));
+ new GUIWire(submodelModifiable, L, Fsel.getPin("S0"), new Point(87.5, 425), new Point(87.5, 75));
+ new GUIWire(submodelModifiable, Cinand.getPin("Y"), add.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, Rxor.getPin("Y"), cpRXored, new Point(50, 195));
+ new GUIWire(submodelModifiable, cpRXored, add.getPin("B"), new Point(50, 35));
+ new GUIWire(submodelModifiable, cpRXored, nand.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, Sxor.getPin("Y"), cpSXored, new Point(55, 295));
+ new GUIWire(submodelModifiable, cpSXored, add.getPin("C"), new Point(55, 45));
+ new GUIWire(submodelModifiable, cpSXored, nand.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, add.getPin("Y"), Fsel.getPin("I0"), new Point(100, 25), new Point(100, 65), new Point(85, 65),
+ new Point(85, 85));
+ new GUIWire(submodelModifiable, add.getPin("Z"), Coutand.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, nand.getPin("Y"), Fsel.getPin("I1"), new Point(82.5, 65), new Point(82.5, 95));
+ new GUIWire(submodelModifiable, Fsel.getPin("Y"), Fxor.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, Coutand.getPin("Y"), Cout, new Point[0]);
+ new GUIWire(submodelModifiable, Fxor.getPin("Y"), F, new Point[0]);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin I8 = getInputSubmodelPins().get(0);
- Pin I7 = getInputSubmodelPins().get(1);
- Pin I6 = getInputSubmodelPins().get(2);
- Pin NSH = getOutputSubmodelPins().get(0);
- Pin RSH = getOutputSubmodelPins().get(1);
- Pin RAMWE = getOutputSubmodelPins().get(2);
- Pin YF = getOutputSubmodelPins().get(3);
- Pin LSH = getOutputSubmodelPins().get(4);
- Pin QWE = getOutputSubmodelPins().get(5);
+ Pin I8 = getSubmodelPin("I8");
+ Pin I7 = getSubmodelPin("I7");
+ Pin I6 = getSubmodelPin("I6");
+ Pin NSH = getSubmodelPin("NSH");
+ Pin RSH = getSubmodelPin("RSH");
+ Pin RAMWE = getSubmodelPin("RAMWE");
+ Pin YF = getSubmodelPin("YF");
+ Pin LSH = getSubmodelPin("LSH");
+ Pin QWE = getSubmodelPin("QWE");
GUINandGate notI8 = new GUINandGate(submodelModifiable, 1);
GUINandGate notI7 = new GUINandGate(submodelModifiable, 1);
new GUIWire(submodelModifiable, I8, cpI81, new Point[0]);
new GUIWire(submodelModifiable, cpI81, cpI82, new Point[0]);
new GUIWire(submodelModifiable, cpI81, cpI83, new Point[0]);
- new GUIWire(submodelModifiable, cpI82, notI8.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpI83, notI8.getInputPins().get(1), new Point[0]);
+ new GUIWire(submodelModifiable, cpI82, notI8.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, cpI83, notI8.getPin("B"), new Point[0]);
new GUIWire(submodelModifiable, I7, cpI71, new Point[0]);
- new GUIWire(submodelModifiable, cpI71, notI7.getInputPins().get(0), new Point(10, 55));
+ new GUIWire(submodelModifiable, cpI71, notI7.getPin("A"), new Point(10, 55));
new GUIWire(submodelModifiable, cpI71, cpI72, new Point[0]);
- new GUIWire(submodelModifiable, cpI72, notI7.getInputPins().get(1), new Point[0]);
+ new GUIWire(submodelModifiable, cpI72, notI7.getPin("B"), new Point[0]);
new GUIWire(submodelModifiable, cpI72, cpI73, new Point[0]);
- new GUIWire(submodelModifiable, cpI73, nandI8I7.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpI83, nandI8I7.getInputPins().get(0), new Point(5, 95));
+ new GUIWire(submodelModifiable, cpI73, nandI8I7.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, cpI83, nandI8I7.getPin("A"), new Point(5, 95));
new GUIWire(submodelModifiable, I6, cpI6, new Point(5, 100));
- new GUIWire(submodelModifiable, cpI6, notI6.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpI6, notI6.getInputPins().get(1), new Point(5, 165));
- new GUIWire(submodelModifiable, cpI82, nandRSH.getInputPins().get(0), new Point(5, 5), new Point(40, 5), new Point(40, 15));
- new GUIWire(submodelModifiable, notI7.getOutputPin(), cpNotI7, new Point[0]);
- new GUIWire(submodelModifiable, cpNotI7, nandRSH.getInputPins().get(1), new Point(40, 25));
- new GUIWire(submodelModifiable, cpNotI7, nandRAMWE.getInputPins().get(1), new Point(40, 65));
- new GUIWire(submodelModifiable, notI8.getOutputPin(), cpNotI81, new Point[0]);
+ new GUIWire(submodelModifiable, cpI6, notI6.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, cpI6, notI6.getPin("B"), new Point(5, 165));
+ new GUIWire(submodelModifiable, cpI82, nandRSH.getPin("A"), new Point(5, 5), new Point(40, 5), new Point(40, 15));
+ new GUIWire(submodelModifiable, notI7.getPin("Y"), cpNotI7, new Point[0]);
+ new GUIWire(submodelModifiable, cpNotI7, nandRSH.getPin("B"), new Point(40, 25));
+ new GUIWire(submodelModifiable, cpNotI7, nandRAMWE.getPin("B"), new Point(40, 65));
+ new GUIWire(submodelModifiable, notI8.getPin("Y"), cpNotI81, new Point[0]);
new GUIWire(submodelModifiable, cpNotI81, NSH, new Point(45, 5), new Point(135, 5), new Point(135, 20));
new GUIWire(submodelModifiable, cpNotI81, cpNotI82, new Point[0]);
- new GUIWire(submodelModifiable, cpNotI82, nandRAMWE.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpNotI82, nandI7NotI8.getInputPins().get(0), new Point(45, 95));
- new GUIWire(submodelModifiable, cpI73, nandI7NotI8.getInputPins().get(1), new Point(10, 115), new Point(45, 115),
+ new GUIWire(submodelModifiable, cpNotI82, nandRAMWE.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, cpNotI82, nandI7NotI8.getPin("A"), new Point(45, 95));
+ new GUIWire(submodelModifiable, cpI73, nandI7NotI8.getPin("B"), new Point(10, 115), new Point(45, 115),
new Point(45, 105));
- new GUIWire(submodelModifiable, nandI8I7.getOutputPin(), cpNandI8I7, new Point(40, 100));
- new GUIWire(submodelModifiable, cpNandI8I7, nandLSH.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpNandI8I7, nandLSH.getInputPins().get(1), new Point(40, 145));
- new GUIWire(submodelModifiable, nandRSH.getOutputPin(), cpNotRSH, new Point[0]);
- new GUIWire(submodelModifiable, cpNotRSH, notRSH.getInputPins().get(0), new Point(75, 15));
- new GUIWire(submodelModifiable, cpNotRSH, notRSH.getInputPins().get(1), new Point(75, 25));
- new GUIWire(submodelModifiable, nandRAMWE.getOutputPin(), RAMWE, new Point(125, 60), new Point(125, 100));
- new GUIWire(submodelModifiable, nandI7NotI8.getOutputPin(), cpNandI7NotI81, new Point[0]);
- new GUIWire(submodelModifiable, cpNandI7NotI81, andI7NotI8.getInputPins().get(0), new Point(75, 95));
+ new GUIWire(submodelModifiable, nandI8I7.getPin("Y"), cpNandI8I7, new Point(40, 100));
+ new GUIWire(submodelModifiable, cpNandI8I7, nandLSH.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, cpNandI8I7, nandLSH.getPin("B"), new Point(40, 145));
+ new GUIWire(submodelModifiable, nandRSH.getPin("Y"), cpNotRSH, new Point[0]);
+ new GUIWire(submodelModifiable, cpNotRSH, notRSH.getPin("A"), new Point(75, 15));
+ new GUIWire(submodelModifiable, cpNotRSH, notRSH.getPin("B"), new Point(75, 25));
+ new GUIWire(submodelModifiable, nandRAMWE.getPin("Y"), RAMWE, new Point(125, 60), new Point(125, 100));
+ new GUIWire(submodelModifiable, nandI7NotI8.getPin("Y"), cpNandI7NotI81, new Point[0]);
+ new GUIWire(submodelModifiable, cpNandI7NotI81, andI7NotI8.getPin("A"), new Point(75, 95));
new GUIWire(submodelModifiable, cpNandI7NotI81, cpNandI7NotI82, new Point[0]);
- new GUIWire(submodelModifiable, cpNandI7NotI82, andI7NotI8.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, nandLSH.getOutputPin(), LSH, new Point(125, 140), new Point(125, 180));
- new GUIWire(submodelModifiable, cpNandI7NotI82, nandQWE.getInputPins().get(0), new Point(75, 150));
- new GUIWire(submodelModifiable, notI6.getOutputPin(), cpNotI6, new Point[0]);
- new GUIWire(submodelModifiable, cpNotI6, nandQWE.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, notRSH.getOutputPin(), RSH, new Point(130, 20), new Point(130, 60));
- new GUIWire(submodelModifiable, andI7NotI8.getOutputPin(), nandYF.getInputPins().get(0));
- new GUIWire(submodelModifiable, cpNotI6, nandYF.getInputPins().get(1), new Point(75, 170), new Point(105, 170),
+ new GUIWire(submodelModifiable, cpNandI7NotI82, andI7NotI8.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, nandLSH.getPin("Y"), LSH, new Point(125, 140), new Point(125, 180));
+ new GUIWire(submodelModifiable, cpNandI7NotI82, nandQWE.getPin("A"), new Point(75, 150));
+ new GUIWire(submodelModifiable, notI6.getPin("Y"), cpNotI6, new Point[0]);
+ new GUIWire(submodelModifiable, cpNotI6, nandQWE.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, notRSH.getPin("Y"), RSH, new Point(130, 20), new Point(130, 60));
+ new GUIWire(submodelModifiable, andI7NotI8.getPin("Y"), nandYF.getPin("A"));
+ new GUIWire(submodelModifiable, cpNotI6, nandYF.getPin("B"), new Point(75, 170), new Point(105, 170),
new Point(105, 120));
- new GUIWire(submodelModifiable, nandQWE.getOutputPin(), cpNandQWE, new Point(110, 155));
- new GUIWire(submodelModifiable, cpNandQWE, notQWE.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpNandQWE, notQWE.getInputPins().get(1), new Point(110, 225));
- new GUIWire(submodelModifiable, nandYF.getOutputPin(), YF);
- new GUIWire(submodelModifiable, notQWE.getOutputPin(), QWE, new Point[0]);
+ new GUIWire(submodelModifiable, nandQWE.getPin("Y"), cpNandQWE, new Point(110, 155));
+ new GUIWire(submodelModifiable, cpNandQWE, notQWE.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, cpNandQWE, notQWE.getPin("B"), new Point(110, 225));
+ new GUIWire(submodelModifiable, nandYF.getPin("Y"), YF);
+ new GUIWire(submodelModifiable, notQWE.getPin("Y"), QWE, new Point[0]);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin C = getInputSubmodelPins().get(0);
- Pin WE = getInputSubmodelPins().get(1);
- Pin D1 = getInputSubmodelPins().get(2);
- Pin D2 = getInputSubmodelPins().get(3);
- Pin D3 = getInputSubmodelPins().get(4);
- Pin D4 = getInputSubmodelPins().get(5);
- Pin Q1 = getOutputSubmodelPins().get(0);
- Pin Q2 = getOutputSubmodelPins().get(1);
- Pin Q3 = getOutputSubmodelPins().get(2);
- Pin Q4 = getOutputSubmodelPins().get(3);
+ Pin C = getSubmodelPin("C");
+ Pin WE = getSubmodelPin("WE");
+ Pin D1 = getSubmodelPin("D1");
+ Pin D2 = getSubmodelPin("D2");
+ Pin D3 = getSubmodelPin("D3");
+ Pin D4 = getSubmodelPin("D4");
+ Pin Q1 = getSubmodelPin("Q1");
+ Pin Q2 = getSubmodelPin("Q2");
+ Pin Q3 = getSubmodelPin("Q3");
+ Pin Q4 = getSubmodelPin("Q4");
GUIand and = new GUIand(submodelModifiable);
GUIdff dff1 = new GUIdff(submodelModifiable);
cpC2.moveCenterTo(42.5, 37.5);
cpC3.moveCenterTo(42.5, 62.5);
- new GUIWire(submodelModifiable, C, and.getInputPins().get(0));
- new GUIWire(submodelModifiable, WE, and.getInputPins().get(1));
- new GUIWire(submodelModifiable, and.getOutputPins().get(0), cpC1, new Point[0]);
- new GUIWire(submodelModifiable, cpC1, dff1.getInputPins().get(0), new Point(42.5, 12.5));
+ new GUIWire(submodelModifiable, C, and.getPin("A"));
+ new GUIWire(submodelModifiable, WE, and.getPin("B"));
+ new GUIWire(submodelModifiable, and.getPin("Y"), cpC1, new Point[0]);
+ new GUIWire(submodelModifiable, cpC1, dff1.getPin("C"), new Point(42.5, 12.5));
new GUIWire(submodelModifiable, cpC1, cpC2, new Point[0]);
- new GUIWire(submodelModifiable, cpC2, dff2.getInputPins().get(0), new Point[0]);
+ new GUIWire(submodelModifiable, cpC2, dff2.getPin("C"), new Point[0]);
new GUIWire(submodelModifiable, cpC2, cpC3, new Point[0]);
- new GUIWire(submodelModifiable, cpC3, dff3.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpC3, dff4.getInputPins().get(0), new Point(42.5, 87.5));
- new GUIWire(submodelModifiable, D1, dff1.getInputPins().get(1), new Point(17.5, 62.5), new Point(17.5, 42.5), new Point(45, 42.5),
+ new GUIWire(submodelModifiable, cpC3, dff3.getPin("C"), new Point[0]);
+ new GUIWire(submodelModifiable, cpC3, dff4.getPin("C"), new Point(42.5, 87.5));
+ new GUIWire(submodelModifiable, D1, dff1.getPin("D"), new Point(17.5, 62.5), new Point(17.5, 42.5), new Point(45, 42.5),
new Point(45, 22.5));
- new GUIWire(submodelModifiable, D2, dff2.getInputPins().get(1), new Point(22.5, 87.5), new Point(22.5, 47.5));
- new GUIWire(submodelModifiable, D3, dff3.getInputPins().get(1), new Point(27.5, 112.5), new Point(27.5, 72.5));
- new GUIWire(submodelModifiable, D4, dff4.getInputPins().get(1), new Point(32.5, 137.5), new Point(32.5, 97.5));
- new GUIWire(submodelModifiable, dff1.getOutputPins().get(0), Q1, new Point[0]);
- new GUIWire(submodelModifiable, dff2.getOutputPins().get(0), Q2, new Point[0]);
- new GUIWire(submodelModifiable, dff3.getOutputPins().get(0), Q3, new Point[0]);
- new GUIWire(submodelModifiable, dff4.getOutputPins().get(0), Q4, new Point[0]);
+ new GUIWire(submodelModifiable, D2, dff2.getPin("D"), new Point(22.5, 87.5), new Point(22.5, 47.5));
+ new GUIWire(submodelModifiable, D3, dff3.getPin("D"), new Point(27.5, 112.5), new Point(27.5, 72.5));
+ new GUIWire(submodelModifiable, D4, dff4.getPin("D"), new Point(32.5, 137.5), new Point(32.5, 97.5));
+ new GUIWire(submodelModifiable, dff1.getPin("Q"), Q1, new Point[0]);
+ new GUIWire(submodelModifiable, dff2.getPin("Q"), Q2, new Point[0]);
+ new GUIWire(submodelModifiable, dff3.getPin("Q"), Q3, new Point[0]);
+ new GUIWire(submodelModifiable, dff4.getPin("Q"), Q4, new Point[0]);
}
}
\ No newline at end of file
@SuppressWarnings("unused") // for GUIWires being created
private void initSubmodelComponents()
{
- Pin I2 = getInputSubmodelPins().get(0);
- Pin I1 = getInputSubmodelPins().get(1);
- Pin I0 = getInputSubmodelPins().get(2);
- Pin SQ = getOutputSubmodelPins().get(0);
- Pin RA = getOutputSubmodelPins().get(1);
- Pin SB = getOutputSubmodelPins().get(2);
- Pin SA = getOutputSubmodelPins().get(3);
- Pin RD = getOutputSubmodelPins().get(4);
+ Pin I2 = getSubmodelPin("I2");
+ Pin I1 = getSubmodelPin("I1");
+ Pin I0 = getSubmodelPin("I0");
+ Pin SQ = getSubmodelPin("SQ");
+ Pin RA = getSubmodelPin("RA");
+ Pin SB = getSubmodelPin("SB");
+ Pin SA = getSubmodelPin("SA");
+ Pin RD = getSubmodelPin("RD");
GUINandGate notI2 = new GUINandGate(submodelModifiable, 1);
GUINandGate notI1 = new GUINandGate(submodelModifiable, 1);
cpNand35.moveCenterTo(95, 180);
new GUIWire(submodelModifiable, I2, cpI21, new Point[0]);
- new GUIWire(submodelModifiable, cpI21, nand21.getInputPins().get(0), new Point(5, 5), new Point(35, 5), new Point(35, 15));
+ new GUIWire(submodelModifiable, cpI21, nand21.getPin("A"), new Point(5, 5), new Point(35, 5), new Point(35, 15));
new GUIWire(submodelModifiable, cpI21, cpI22, new Point[0]);
- new GUIWire(submodelModifiable, cpI22, notI2.getInputPins().get(0), new Point(7.5, 15));
- new GUIWire(submodelModifiable, cpI22, notI2.getInputPins().get(1), new Point(7.5, 25));
+ new GUIWire(submodelModifiable, cpI22, notI2.getPin("A"), new Point(7.5, 15));
+ new GUIWire(submodelModifiable, cpI22, notI2.getPin("B"), new Point(7.5, 25));
new GUIWire(submodelModifiable, cpI21, cpI23, new Point[0]);
- new GUIWire(submodelModifiable, cpI23, nand24.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpI23, nand35.getInputPins().get(1), new Point(5, 195), new Point(65, 195), new Point(65, 185));
+ new GUIWire(submodelModifiable, cpI23, nand24.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, cpI23, nand35.getPin("B"), new Point(5, 195), new Point(65, 195), new Point(65, 185));
new GUIWire(submodelModifiable, I1, cpI1, new Point[0]);
- new GUIWire(submodelModifiable, cpI1, notI1.getInputPins().get(0), new Point(7.5, 55));
- new GUIWire(submodelModifiable, cpI1, notI1.getInputPins().get(1), new Point(7.5, 65));
+ new GUIWire(submodelModifiable, cpI1, notI1.getPin("A"), new Point(7.5, 55));
+ new GUIWire(submodelModifiable, cpI1, notI1.getPin("B"), new Point(7.5, 65));
new GUIWire(submodelModifiable, I0, cpI01, new Point[0]);
- new GUIWire(submodelModifiable, cpI01, notI0.getInputPins().get(0), new Point(7.5, 95));
+ new GUIWire(submodelModifiable, cpI01, notI0.getPin("A"), new Point(7.5, 95));
new GUIWire(submodelModifiable, cpI01, cpI02, new Point[0]);
- new GUIWire(submodelModifiable, cpI02, notI0.getInputPins().get(1), new Point[0]);
- new GUIWire(submodelModifiable, cpI02, nand23.getInputPins().get(1), new Point(7.5, 112.5), new Point(32.5, 112.5),
+ new GUIWire(submodelModifiable, cpI02, notI0.getPin("B"), new Point[0]);
+ new GUIWire(submodelModifiable, cpI02, nand23.getPin("B"), new Point(7.5, 112.5), new Point(32.5, 112.5),
new Point(32.5, 105));
- new GUIWire(submodelModifiable, notI2.getOutputPin(), cpNotI2, new Point(32.5, 20));
- new GUIWire(submodelModifiable, cpNotI2, nand22.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpNotI2, nand23.getInputPins().get(0), new Point(32.5, 95));
- new GUIWire(submodelModifiable, notI1.getOutputPin(), cpNotI11, new Point[0]);
- new GUIWire(submodelModifiable, cpNotI11, nand21.getInputPins().get(1), new Point(35, 25));
+ new GUIWire(submodelModifiable, notI2.getPin("Y"), cpNotI2, new Point(32.5, 20));
+ new GUIWire(submodelModifiable, cpNotI2, nand22.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, cpNotI2, nand23.getPin("A"), new Point(32.5, 95));
+ new GUIWire(submodelModifiable, notI1.getPin("Y"), cpNotI11, new Point[0]);
+ new GUIWire(submodelModifiable, cpNotI11, nand21.getPin("B"), new Point(35, 25));
new GUIWire(submodelModifiable, cpNotI11, cpNotI12, new Point[0]);
- new GUIWire(submodelModifiable, cpNotI12, nand22.getInputPins().get(1), new Point[0]);
+ new GUIWire(submodelModifiable, cpNotI12, nand22.getPin("B"), new Point[0]);
new GUIWire(submodelModifiable, cpNotI12, cpNotI13, new Point[0]);
- new GUIWire(submodelModifiable, cpNotI13, nand24.getInputPins().get(0), new Point[0]);
- new GUIWire(submodelModifiable, cpNotI13, nand25.getInputPins().get(0), new Point(35, 175));
- new GUIWire(submodelModifiable, notI0.getOutputPin(), cpNotI0, new Point[0]);
- new GUIWire(submodelModifiable, cpNotI0, nand31.getInputPins().get(1), new Point(37.5, 35), new Point(65, 35), new Point(65, 25));
- new GUIWire(submodelModifiable, cpNotI0, nand25.getInputPins().get(1), new Point(37.5, 185));
- new GUIWire(submodelModifiable, nand21.getOutputPin(), nand31.getInputPins().get(0));
- new GUIWire(submodelModifiable, nand22.getOutputPin(), cpNand22, new Point[0]);
- new GUIWire(submodelModifiable, cpNand22, nand32.getInputPins().get(0), new Point(65, 55));
- new GUIWire(submodelModifiable, cpNand22, nand32.getInputPins().get(1), new Point(65, 65));
- new GUIWire(submodelModifiable, nand23.getOutputPin(), cpNand23, new Point[0]);
- new GUIWire(submodelModifiable, cpNand23, nand33.getInputPins().get(0), new Point(65, 95));
- new GUIWire(submodelModifiable, cpNand23, nand33.getInputPins().get(1), new Point(65, 105));
- new GUIWire(submodelModifiable, nand24.getOutputPin(), cpNand24, new Point[0]);
- new GUIWire(submodelModifiable, cpNand24, nand34.getInputPins().get(0), new Point(65, 135));
- new GUIWire(submodelModifiable, cpNand24, nand34.getInputPins().get(1), new Point(65, 145));
- new GUIWire(submodelModifiable, nand25.getOutputPin(), nand35.getInputPins().get(0));
- new GUIWire(submodelModifiable, nand31.getOutputPin(), cpNand31, new Point[0]);
- new GUIWire(submodelModifiable, cpNand31, nand41.getInputPins().get(0), new Point(95, 15));
- new GUIWire(submodelModifiable, cpNand31, nand41.getInputPins().get(1), new Point(95, 25));
- new GUIWire(submodelModifiable, nand32.getOutputPin(), RA, new Point[0]);
- new GUIWire(submodelModifiable, nand33.getOutputPin(), SB, new Point[0]);
- new GUIWire(submodelModifiable, nand34.getOutputPin(), SA, new Point[0]);
- new GUIWire(submodelModifiable, nand35.getOutputPin(), cpNand35, new Point[0]);
- new GUIWire(submodelModifiable, cpNand35, nand42.getInputPins().get(0), new Point(95, 175));
- new GUIWire(submodelModifiable, cpNand35, nand42.getInputPins().get(1), new Point(95, 185));
- new GUIWire(submodelModifiable, nand41.getOutputPin(), SQ, new Point[0]);
- new GUIWire(submodelModifiable, nand42.getOutputPin(), RD, new Point[0]);
+ new GUIWire(submodelModifiable, cpNotI13, nand24.getPin("A"), new Point[0]);
+ new GUIWire(submodelModifiable, cpNotI13, nand25.getPin("A"), new Point(35, 175));
+ new GUIWire(submodelModifiable, notI0.getPin("Y"), cpNotI0, new Point[0]);
+ new GUIWire(submodelModifiable, cpNotI0, nand31.getPin("B"), new Point(37.5, 35), new Point(65, 35), new Point(65, 25));
+ new GUIWire(submodelModifiable, cpNotI0, nand25.getPin("B"), new Point(37.5, 185));
+ new GUIWire(submodelModifiable, nand21.getPin("Y"), nand31.getPin("A"));
+ new GUIWire(submodelModifiable, nand22.getPin("Y"), cpNand22, new Point[0]);
+ new GUIWire(submodelModifiable, cpNand22, nand32.getPin("A"), new Point(65, 55));
+ new GUIWire(submodelModifiable, cpNand22, nand32.getPin("B"), new Point(65, 65));
+ new GUIWire(submodelModifiable, nand23.getPin("Y"), cpNand23, new Point[0]);
+ new GUIWire(submodelModifiable, cpNand23, nand33.getPin("A"), new Point(65, 95));
+ new GUIWire(submodelModifiable, cpNand23, nand33.getPin("B"), new Point(65, 105));
+ new GUIWire(submodelModifiable, nand24.getPin("Y"), cpNand24, new Point[0]);
+ new GUIWire(submodelModifiable, cpNand24, nand34.getPin("A"), new Point(65, 135));
+ new GUIWire(submodelModifiable, cpNand24, nand34.getPin("B"), new Point(65, 145));
+ new GUIWire(submodelModifiable, nand25.getPin("Y"), nand35.getPin("A"));
+ new GUIWire(submodelModifiable, nand31.getPin("Y"), cpNand31, new Point[0]);
+ new GUIWire(submodelModifiable, cpNand31, nand41.getPin("A"), new Point(95, 15));
+ new GUIWire(submodelModifiable, cpNand31, nand41.getPin("B"), new Point(95, 25));
+ new GUIWire(submodelModifiable, nand32.getPin("Y"), RA, new Point[0]);
+ new GUIWire(submodelModifiable, nand33.getPin("Y"), SB, new Point[0]);
+ new GUIWire(submodelModifiable, nand34.getPin("Y"), SA, new Point[0]);
+ new GUIWire(submodelModifiable, nand35.getPin("Y"), cpNand35, new Point[0]);
+ new GUIWire(submodelModifiable, cpNand35, nand42.getPin("A"), new Point(95, 175));
+ new GUIWire(submodelModifiable, cpNand35, nand42.getPin("B"), new Point(95, 185));
+ new GUIWire(submodelModifiable, nand41.getPin("Y"), SQ, new Point[0]);
+ new GUIWire(submodelModifiable, nand42.getPin("Y"), RD, new Point[0]);
}
}
\ No newline at end of file
if (guiComp instanceof SubmodelComponent)
{
SubmodelComponent guiCompCasted = (SubmodelComponent) guiComp;
- Map<Pin, Pin> supermodelPinsPerSubmodelPin = guiCompCasted.getSupermodelPinsPerSubmodelPin();
- Map<Pin, Wire> externalWiresForSubmodel = supermodelPinsPerSubmodelPin.entrySet().stream()
- .collect(Collectors.toMap(Entry::getKey, e -> logicWiresPerPin.get(e.getValue())));
+ Map<String, Pin> supermodelPins = guiCompCasted.getSupermodelPins();
+ Map<Pin, Wire> externalWiresForSubmodel = supermodelPins.entrySet().stream()
+ .collect(Collectors.toMap(e -> guiCompCasted.getSubmodelPin(e.getKey()), e -> logicWiresPerPin.get(e.getValue())));
convert(guiCompCasted.submodel, params, timeline, externalWiresForSubmodel);
} else if (guiComp instanceof WireCrossPoint)
{
public void createAndLinkComponent(Timeline timeline, LogicModelParameters params, AtomicAm2901NANDBased guiComponent,
Map<Pin, Wire> logicWiresPerPin)
{
- Wire w00 = logicWiresPerPin.get(guiComponent.getPins().get(0));
- Wire w01 = logicWiresPerPin.get(guiComponent.getPins().get(1));
- Wire w02 = logicWiresPerPin.get(guiComponent.getPins().get(2));
- Wire w03 = logicWiresPerPin.get(guiComponent.getPins().get(3));
- Wire w04 = logicWiresPerPin.get(guiComponent.getPins().get(4));
- Wire w05 = logicWiresPerPin.get(guiComponent.getPins().get(5));
- Wire w06 = logicWiresPerPin.get(guiComponent.getPins().get(6));
- Wire w07 = logicWiresPerPin.get(guiComponent.getPins().get(7));
- Wire w08 = logicWiresPerPin.get(guiComponent.getPins().get(8));
- Wire w09 = logicWiresPerPin.get(guiComponent.getPins().get(9));
- Wire w10 = logicWiresPerPin.get(guiComponent.getPins().get(10));
- Wire w11 = logicWiresPerPin.get(guiComponent.getPins().get(11));
- Wire w12 = logicWiresPerPin.get(guiComponent.getPins().get(12));
- Wire w13 = logicWiresPerPin.get(guiComponent.getPins().get(13));
- Wire w14 = logicWiresPerPin.get(guiComponent.getPins().get(14));
- Wire w15 = logicWiresPerPin.get(guiComponent.getPins().get(15));
- Wire w16 = logicWiresPerPin.get(guiComponent.getPins().get(16));
- Wire w17 = logicWiresPerPin.get(guiComponent.getPins().get(17));
- Wire w18 = logicWiresPerPin.get(guiComponent.getPins().get(18));
- Wire w19 = logicWiresPerPin.get(guiComponent.getPins().get(19));
- Wire w20 = logicWiresPerPin.get(guiComponent.getPins().get(20));
- Wire w21 = logicWiresPerPin.get(guiComponent.getPins().get(21));
- Wire w22 = logicWiresPerPin.get(guiComponent.getPins().get(22));
- Wire w23 = logicWiresPerPin.get(guiComponent.getPins().get(23));
- Wire w24 = logicWiresPerPin.get(guiComponent.getPins().get(24));
- Wire w25 = logicWiresPerPin.get(guiComponent.getPins().get(25));
- Wire w26 = logicWiresPerPin.get(guiComponent.getPins().get(26));
- Wire w27 = logicWiresPerPin.get(guiComponent.getPins().get(27));
- Wire w28 = logicWiresPerPin.get(guiComponent.getPins().get(28));
- Wire w29 = logicWiresPerPin.get(guiComponent.getPins().get(29));
- Wire w30 = logicWiresPerPin.get(guiComponent.getPins().get(30));
- Wire w31 = logicWiresPerPin.get(guiComponent.getPins().get(31));
- Wire w32 = logicWiresPerPin.get(guiComponent.getPins().get(32));
- Wire w33 = logicWiresPerPin.get(guiComponent.getPins().get(33));
- Wire w34 = logicWiresPerPin.get(guiComponent.getPins().get(34));
- Wire w35 = logicWiresPerPin.get(guiComponent.getPins().get(35));
- Wire w36 = logicWiresPerPin.get(guiComponent.getPins().get(36));
- Wire w37 = logicWiresPerPin.get(guiComponent.getPins().get(37));
+ Wire w00 = logicWiresPerPin.get(guiComponent.getPin("I8"));
+ Wire w01 = logicWiresPerPin.get(guiComponent.getPin("I7"));
+ Wire w02 = logicWiresPerPin.get(guiComponent.getPin("I6"));
+ Wire w03 = logicWiresPerPin.get(guiComponent.getPin("I5"));
+ Wire w04 = logicWiresPerPin.get(guiComponent.getPin("I4"));
+ Wire w05 = logicWiresPerPin.get(guiComponent.getPin("I3"));
+ Wire w06 = logicWiresPerPin.get(guiComponent.getPin("I2"));
+ Wire w07 = logicWiresPerPin.get(guiComponent.getPin("I1"));
+ Wire w08 = logicWiresPerPin.get(guiComponent.getPin("I0"));
+ Wire w09 = logicWiresPerPin.get(guiComponent.getPin("C"));
+ Wire w10 = logicWiresPerPin.get(guiComponent.getPin("Cn"));
+ Wire w11 = logicWiresPerPin.get(guiComponent.getPin("D1"));
+ Wire w12 = logicWiresPerPin.get(guiComponent.getPin("D2"));
+ Wire w13 = logicWiresPerPin.get(guiComponent.getPin("D3"));
+ Wire w14 = logicWiresPerPin.get(guiComponent.getPin("D4"));
+ Wire w15 = logicWiresPerPin.get(guiComponent.getPin("A0"));
+ Wire w16 = logicWiresPerPin.get(guiComponent.getPin("A1"));
+ Wire w17 = logicWiresPerPin.get(guiComponent.getPin("A2"));
+ Wire w18 = logicWiresPerPin.get(guiComponent.getPin("A3"));
+ Wire w19 = logicWiresPerPin.get(guiComponent.getPin("B0"));
+ Wire w20 = logicWiresPerPin.get(guiComponent.getPin("B1"));
+ Wire w21 = logicWiresPerPin.get(guiComponent.getPin("B2"));
+ Wire w22 = logicWiresPerPin.get(guiComponent.getPin("B3"));
+ Wire w23 = logicWiresPerPin.get(guiComponent.getPin("IRAMn"));
+ Wire w24 = logicWiresPerPin.get(guiComponent.getPin("IRAMn+3"));
+ Wire w25 = logicWiresPerPin.get(guiComponent.getPin("IQn"));
+ Wire w26 = logicWiresPerPin.get(guiComponent.getPin("IQn+3"));
+ Wire w27 = logicWiresPerPin.get(guiComponent.getPin("Y1"));
+ Wire w28 = logicWiresPerPin.get(guiComponent.getPin("Y2"));
+ Wire w29 = logicWiresPerPin.get(guiComponent.getPin("Y3"));
+ Wire w30 = logicWiresPerPin.get(guiComponent.getPin("Y4"));
+ Wire w31 = logicWiresPerPin.get(guiComponent.getPin("F=0"));
+ Wire w32 = logicWiresPerPin.get(guiComponent.getPin("Cn+4"));
+ Wire w33 = logicWiresPerPin.get(guiComponent.getPin("OVR"));
+ Wire w34 = logicWiresPerPin.get(guiComponent.getPin("F3_ORAMn+3"));
+ Wire w35 = logicWiresPerPin.get(guiComponent.getPin("ORAMn"));
+ Wire w36 = logicWiresPerPin.get(guiComponent.getPin("OQn"));
+ Wire w37 = logicWiresPerPin.get(guiComponent.getPin("OQn+3"));
+
createAm2901(timeline, params, w00, w01, w02, w03, w04, w05, w06, w07, w08, w09, w10, w11, w12, w13, w14, w15, w16, w17, w18, w19,
w20, w21, w22, w23, w24, w25, w26, w27, w28, w29, w30, w31, w32, w33, w34, w35, w36, w37);
}
package net.mograsim.logic.ui.modeladapter.componentadapters;
-import java.util.List;
import java.util.Map;
import net.mograsim.logic.core.components.Component;
@Override
public void createAndLinkComponent(Timeline timeline, LogicModelParameters params, G guiComponent, Map<Pin, Wire> logicWiresPerPin)
{
- ReadWriteEnd out = logicWiresPerPin.get(guiComponent.getOutputPin()).createReadWriteEnd();
- List<Pin> inputPins = guiComponent.getInputPins();
- ReadEnd[] ins = new ReadEnd[inputPins.size()];
- for (int i = 0; i < inputPins.size(); i++)
- ins[i] = logicWiresPerPin.get(inputPins.get(i)).createReadOnlyEnd();
+ ReadWriteEnd out = logicWiresPerPin.get(guiComponent.getPin("Y")).createReadWriteEnd();
+
+ // TODO can we do this prettier?
+ int inputPinCount = guiComponent.getPins().size() - 1;
+ ReadEnd[] ins = new ReadEnd[inputPinCount];
+ for (int i = 0; i < inputPinCount; i++)
+ ins[i] = logicWiresPerPin.get(guiComponent.getPin(String.valueOf((char) ('A' + i)))).createReadOnlyEnd();
+
constructor.newComponent(timeline, params.gateProcessTime, out, ins);
}