use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class CircuitBuilder method addNetConnections.
private void addNetConnections(Circuit circuit, int xPos, int y) {
for (Variable name : sequentialVars) {
String oName = name.getIdentifier();
if (oName.endsWith("n")) {
oName = oName.substring(0, oName.length() - 1);
if (oName.endsWith("_") || oName.endsWith("^"))
oName = oName.substring(0, oName.length() - 1);
}
if (!combinatorialOutputs.containsKey(oName)) {
VisualElement t = new VisualElement(Tunnel.DESCRIPTION.getName()).setShapeFactory(shapeFactory);
t.getElementAttributes().set(Keys.NETNAME, name.getIdentifier());
t.setPos(new Vector(xPos, y));
t.setRotation(2);
circuit.add(t);
VisualElement o = new VisualElement(Out.DESCRIPTION.getName()).setShapeFactory(shapeFactory);
o.getElementAttributes().set(Keys.LABEL, oName);
o.setPos(new Vector(xPos + SIZE, y));
checkPinNumber(o);
circuit.add(o);
circuit.add(new Wire(new Vector(xPos, y), new Vector(xPos + SIZE, y)));
y += SIZE * 2;
}
}
}
use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class FragmentSameInValue method doLayout.
@Override
public Box doLayout() {
fragment.setPos(new Vector(SIZE * 2, 0));
Box b = fragment.doLayout();
return new Box(2 * SIZE + b.getWidth(), b.getHeight());
}
use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class ModifySplitWire method modify.
@Override
public void modify(Circuit circuit, ElementLibrary library) {
Wire w = getWire(circuit);
Vector p = w.p2;
w.setP2(newPoint);
circuit.add(new Wire(newPoint, p));
}
Aggregations