Search in sources :

Example 61 with Vector

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;
        }
    }
}
Also used : VisualElement(de.neemann.digital.draw.elements.VisualElement) Wire(de.neemann.digital.draw.elements.Wire) Vector(de.neemann.digital.draw.graphics.Vector)

Example 62 with Vector

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());
}
Also used : Vector(de.neemann.digital.draw.graphics.Vector)

Example 63 with Vector

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));
}
Also used : Wire(de.neemann.digital.draw.elements.Wire) Vector(de.neemann.digital.draw.graphics.Vector)

Aggregations

Vector (de.neemann.digital.draw.graphics.Vector)63 Wire (de.neemann.digital.draw.elements.Wire)13 Polygon (de.neemann.digital.draw.graphics.Polygon)12 VisualElement (de.neemann.digital.draw.elements.VisualElement)9 Style (de.neemann.digital.draw.graphics.Style)8 Circuit (de.neemann.digital.draw.elements.Circuit)6 Pin (de.neemann.digital.draw.elements.Pin)3 Pins (de.neemann.digital.draw.elements.Pins)3 ArrayList (java.util.ArrayList)3 Rotation (de.neemann.digital.core.element.Rotation)2 ElementLibrary (de.neemann.digital.draw.library.ElementLibrary)2 ElementNotFoundException (de.neemann.digital.draw.library.ElementNotFoundException)2 ShapeFactory (de.neemann.digital.draw.shapes.ShapeFactory)2 IOException (java.io.IOException)2 NodeException (de.neemann.digital.core.NodeException)1 ObservableValue (de.neemann.digital.core.ObservableValue)1 Movable (de.neemann.digital.draw.elements.Movable)1 GraphicMinMax (de.neemann.digital.draw.graphics.GraphicMinMax)1 Orientation (de.neemann.digital.draw.graphics.Orientation)1 Transform (de.neemann.digital.draw.graphics.Transform)1