Search in sources :

Example 36 with Vector

use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.

the class SevenSegShape method getPins.

@Override
public Pins getPins() {
    if (pins == null) {
        pins = new Pins();
        pins.add(new Pin(new Vector(0, 0), inputPins.get(0)));
        pins.add(new Pin(new Vector(SIZE, 0), inputPins.get(1)));
        pins.add(new Pin(new Vector(SIZE * 2, 0), inputPins.get(2)));
        pins.add(new Pin(new Vector(SIZE * 3, 0), inputPins.get(3)));
        pins.add(new Pin(new Vector(0, SIZE * HEIGHT), inputPins.get(4)));
        pins.add(new Pin(new Vector(SIZE, SIZE * HEIGHT), inputPins.get(5)));
        pins.add(new Pin(new Vector(SIZE * 2, SIZE * HEIGHT), inputPins.get(6)));
        pins.add(new Pin(new Vector(SIZE * 3, SIZE * HEIGHT), inputPins.get(7)));
        if (commonCatode)
            pins.add(new Pin(new Vector(SIZE * 4, SIZE * HEIGHT), inputPins.get(8)));
    }
    return pins;
}
Also used : Pin(de.neemann.digital.draw.elements.Pin) Pins(de.neemann.digital.draw.elements.Pins) Vector(de.neemann.digital.draw.graphics.Vector)

Example 37 with Vector

use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.

the class SwitchShape method drawTo.

@Override
public void drawTo(Graphic graphic, Style highLight) {
    int yOffs = 0;
    if (closed) {
        graphic.drawLine(new Vector(0, 0), new Vector(SIZE * 2, 0), Style.NORMAL);
    } else {
        yOffs = SIZE2 / 2;
        graphic.drawLine(new Vector(0, 0), new Vector(SIZE * 2 - 4, -yOffs * 2), Style.NORMAL);
    }
    graphic.drawLine(new Vector(SIZE, -yOffs), new Vector(SIZE, -yOffs - SIZE), Style.THIN);
    graphic.drawLine(new Vector(SIZE2, -yOffs - SIZE), new Vector(SIZE + SIZE2, -yOffs - SIZE), Style.THIN);
    if (label != null && label.length() > 0)
        graphic.drawText(new Vector(SIZE, 4), new Vector(SIZE * 2, 4), label, Orientation.CENTERTOP, Style.SHAPE_PIN);
}
Also used : Vector(de.neemann.digital.draw.graphics.Vector)

Example 38 with Vector

use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.

the class VDDShape method drawTo.

@Override
public void drawTo(Graphic graphic, Style heighLight) {
    graphic.drawPolygon(new Polygon(false).add(-SIZE2, DOWNSHIFT).add(0, DOWNSHIFT - SIZE * 2 / 3).add(SIZE2, DOWNSHIFT), Style.NORMAL);
    graphic.drawLine(new Vector(0, -SIZE2 + DOWNSHIFT), new Vector(0, 0), Style.NORMAL);
}
Also used : Polygon(de.neemann.digital.draw.graphics.Polygon) Vector(de.neemann.digital.draw.graphics.Vector)

Example 39 with Vector

use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.

the class IEEENotShape method getPins.

@Override
public Pins getPins() {
    if (pins == null) {
        pins = new Pins();
        pins.add(new Pin(new Vector(0, 0), inputs.get(0)));
        pins.add(new Pin(new Vector(SIZE * 2, 0), outputs.get(0)));
    }
    return pins;
}
Also used : Pin(de.neemann.digital.draw.elements.Pin) Pins(de.neemann.digital.draw.elements.Pins) Vector(de.neemann.digital.draw.graphics.Vector)

Example 40 with Vector

use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.

the class IEEEOrShape method drawIEEE.

@Override
protected void drawIEEE(Graphic graphic) {
    graphic.drawLine(new Vector(0, 0), new Vector(4, 0), Style.WIRE);
    graphic.drawLine(new Vector(0, SIZE * 2), new Vector(4, SIZE * 2), Style.WIRE);
    if (center)
        graphic.drawLine(new Vector(0, SIZE), new Vector(7, SIZE), Style.WIRE);
    graphic.drawPolygon(POLYGON, Style.NORMAL);
}
Also used : 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