use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class OutputShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style highLight) {
if (graphic.isFlagSet(Graphic.LATEX)) {
Vector center = new Vector(LATEX_RAD.x, 0);
graphic.drawCircle(center.sub(LATEX_RAD), center.add(LATEX_RAD), Style.NORMAL);
Vector textPos = new Vector(SIZE2 + LATEX_RAD.x, 0);
graphic.drawText(textPos, textPos.add(1, 0), label, Orientation.LEFTCENTER, Style.INOUT);
} else {
Style style = Style.NORMAL;
if (value != null) {
style = Style.getWireStyle(value);
if (value.getBits() > 1) {
Vector textPos = new Vector(1 + SIZE, -4 - SIZE);
graphic.drawText(textPos, textPos.add(1, 0), format.formatToView(value), Orientation.CENTERBOTTOM, Style.NORMAL);
}
}
Vector center = new Vector(1 + SIZE, 0);
graphic.drawCircle(center.sub(RAD), center.add(RAD), style);
graphic.drawCircle(center.sub(RADL), center.add(RADL), Style.NORMAL);
Vector textPos = new Vector(SIZE * 3, 0);
graphic.drawText(textPos, textPos.add(1, 0), label, Orientation.LEFTCENTER, Style.INOUT);
}
}
use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class PullDownShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style highLight) {
graphic.drawPolygon(new Polygon(true).add(-WIDTH2, 1).add(-WIDTH2, HEIGHT).add(WIDTH2, HEIGHT).add(WIDTH2, 1), Style.NORMAL);
graphic.drawLine(new Vector(0, HEIGHT), new Vector(0, SIZE * 2), Style.NORMAL);
graphic.drawLine(new Vector(-SIZE2, SIZE * 2), new Vector(SIZE2, SIZE * 2), Style.THICK);
}
use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class PullUpShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style highLight) {
graphic.drawPolygon(new Polygon(true).add(-WIDTH2, -1).add(-WIDTH2, -HEIGHT).add(WIDTH2, -HEIGHT).add(WIDTH2, -1), Style.NORMAL);
graphic.drawLine(new Vector(0, -HEIGHT), new Vector(0, DOWNSHIFT - SIZE * 2 - SIZE2), Style.NORMAL);
graphic.drawPolygon(new Polygon(false).add(-SIZE2, DOWNSHIFT - SIZE * 2).add(0, DOWNSHIFT - SIZE * 2 - SIZE * 2 / 3).add(SIZE2, DOWNSHIFT - SIZE * 2), Style.NORMAL);
}
use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class DiodeShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style highLight) {
Style style = blown ? Style.DASH : Style.NORMAL;
graphic.drawPolygon(new Polygon(true).add(-SIZE2, -SIZE + 1).add(SIZE2, -SIZE + 1).add(0, -1), style);
graphic.drawLine(new Vector(-SIZE2, -1), new Vector(SIZE2, -1), style);
}
use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class DriverShape method getPins.
@Override
public Pins getPins() {
if (pins == null) {
pins = new Pins();
pins.add(new Pin(new Vector(-SIZE, 0), inputs.get(0)));
pins.add(new Pin(new Vector(0, bottom ? SIZE : -SIZE), inputs.get(1)));
pins.add(new Pin(new Vector(SIZE, 0), outputs.get(0)));
}
return pins;
}
Aggregations