Search in sources :

Example 6 with Pins

use of de.neemann.digital.draw.elements.Pins in project Digital by hneemann.

the class BusSplitterShape method getPins.

@Override
public Pins getPins() {
    if (pins == null) {
        pins = new Pins();
        pins.add(new Pin(new Vector(0, 0), outputs.get(0)));
        pins.add(new Pin(new Vector(0, SIZE), inputs.get(0)));
        for (int i = 0; i < outputs.size() - 1; i++) pins.add(new Pin(new Vector(SIZE, i * spreading * SIZE), outputs.get(i + 1)));
    }
    return pins;
}
Also used : Pin(de.neemann.digital.draw.elements.Pin) Pins(de.neemann.digital.draw.elements.Pins)

Example 7 with Pins

use of de.neemann.digital.draw.elements.Pins in project Digital by hneemann.

the class DemuxerShape method getPins.

@Override
public Pins getPins() {
    if (pins == null) {
        pins = new Pins();
        pins.add(new Pin(new Vector(SIZE, flip ? 0 : height), inputs.get(0)));
        if (outputCount == 2) {
            pins.add(new Pin(new Vector(SIZE * 2, 0 * SIZE), outputs.get(0)));
            pins.add(new Pin(new Vector(SIZE * 2, 2 * SIZE), outputs.get(1)));
        } else
            for (int i = 0; i < outputCount; i++) {
                pins.add(new Pin(new Vector(SIZE * 2, i * SIZE), outputs.get(i)));
            }
        if (hasInput)
            pins.add(new Pin(new Vector(0, (outputCount / 2) * SIZE), inputs.get(1)));
    }
    return pins;
}
Also used : Pin(de.neemann.digital.draw.elements.Pin) Pins(de.neemann.digital.draw.elements.Pins)

Aggregations

Pin (de.neemann.digital.draw.elements.Pin)7 Pins (de.neemann.digital.draw.elements.Pins)7 Vector (de.neemann.digital.draw.graphics.Vector)3