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;
}
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;
}