use of de.neemann.digital.draw.graphics.Polygon in project Digital by hneemann.
the class ClockShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style heighLight) {
graphic.drawPolygon(new Polygon(true).add(-SIZE * 2 - 1, -SIZE).add(-1, -SIZE).add(-1, SIZE).add(-SIZE * 2 - 1, SIZE), Style.NORMAL);
graphic.drawPolygon(new Polygon(false).add(POS).add(POS.add(WI, 0)).add(POS.add(WI, -WI * 2)).add(POS.add(2 * WI, -WI * 2)).add(POS.add(2 * WI, 0)).add(POS.add(3 * WI, 0)).add(POS.add(3 * WI, -WI * 2)).add(POS.add(4 * WI, -WI * 2)), Style.THIN);
Vector textPos = new Vector(-SIZE * 3, 0);
graphic.drawText(textPos, textPos.add(1, 0), label, Orientation.RIGHTCENTER, Style.NORMAL);
}
use of de.neemann.digital.draw.graphics.Polygon in project Digital by hneemann.
the class DelayShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style heighLight) {
graphic.drawPolygon(new Polygon(true).add(1, -SIZE2).add(SIZE * 2 - 1, -SIZE2).add(SIZE * 2 - 1, SIZE2).add(1, SIZE2), Style.NORMAL);
graphic.drawLine(new Vector(SIZE2, 0), new Vector(SIZE * 2 - SIZE2, 0), Style.THIN);
int bar = SIZE2 / 2;
graphic.drawLine(new Vector(SIZE2, bar), new Vector(SIZE2, -bar), Style.THIN);
graphic.drawLine(new Vector(SIZE * 2 - SIZE2, bar), new Vector(SIZE * 2 - SIZE2, -bar), Style.THIN);
}
use of de.neemann.digital.draw.graphics.Polygon 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);
}
use of de.neemann.digital.draw.graphics.Polygon in project Digital by hneemann.
the class ButtonShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style heighLight) {
boolean isPressed = false;
if (button != null)
isPressed = button.isPressed();
if (isPressed) {
graphic.drawPolygon(new Polygon(true).add(-SIZE * 2 - 1, -SIZE).add(-1, -SIZE).add(-1, SIZE).add(-SIZE * 2 - 1, SIZE), Style.NORMAL);
} else {
int t = Style.NORMAL.getThickness() / 4;
graphic.drawPolygon(new Polygon(true).add(-SIZE * 2 - 1 - HEIGHT, -SIZE - HEIGHT).add(-1 - HEIGHT, -SIZE - HEIGHT).add(-1, -SIZE).add(-1, SIZE).add(-SIZE * 2 - 1, SIZE).add(-SIZE * 2 - 1 - HEIGHT, SIZE - HEIGHT), Style.NORMAL);
graphic.drawPolygon(new Polygon(false).add(-1 - HEIGHT, -SIZE + t - HEIGHT).add(-1 - HEIGHT, SIZE - HEIGHT).add(t - SIZE * 2 - 1 - HEIGHT, SIZE - HEIGHT), Style.NORMAL);
graphic.drawLine(new Vector(-1 - HEIGHT, SIZE - HEIGHT), new Vector(-1 - t, SIZE - t), Style.NORMAL);
}
Vector textPos = new Vector(-SIZE * 3, -4);
graphic.drawText(textPos, textPos.add(1, 0), label, Orientation.RIGHTCENTER, Style.NORMAL);
}
use of de.neemann.digital.draw.graphics.Polygon in project Digital by hneemann.
the class DiodeBackwardShape 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);
}