use of de.neemann.digital.draw.graphics.Polygon in project Digital by hneemann.
the class TestCaseShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style highLight) {
if (!graphic.isFlagSet(Graphic.LATEX)) {
Polygon pol = new Polygon(true).add(SIZE2, SIZE2).add(SIZE2 + SIZE * 4, SIZE2).add(SIZE2 + SIZE * 4, SIZE * 2 + SIZE2).add(SIZE2, SIZE * 2 + SIZE2);
graphic.drawPolygon(pol, TESTSTYLE);
graphic.drawPolygon(pol, Style.THIN);
graphic.drawText(new Vector(SIZE2 + SIZE * 2, SIZE + SIZE2), new Vector(SIZE * 4, SIZE + SIZE2), "Test", Orientation.CENTERCENTER, Style.NORMAL);
graphic.drawText(new Vector(SIZE2 + SIZE * 2, 0), new Vector(SIZE * 4, 0), label, Orientation.CENTERBOTTOM, Style.NORMAL);
}
}
use of de.neemann.digital.draw.graphics.Polygon in project Digital by hneemann.
the class IEEENotShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style highLight) {
graphic.drawPolygon(new Polygon(true).add(1, -SIZE2 - 2).add(SIZE - 1, 0).add(1, SIZE2 + 2), Style.NORMAL);
graphic.drawCircle(new Vector(SIZE + 1, -SIZE2 + 1), new Vector(SIZE * 2 - 1, SIZE2 - 1), Style.NORMAL);
}
use of de.neemann.digital.draw.graphics.Polygon in project Digital by hneemann.
the class RotEncoderShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style heighLight) {
graphic.drawPolygon(new Polygon(true).add(0, -SIZE).add(0, SIZE * 2).add(-SIZE * 3, SIZE * 2).add(-SIZE * 3, -SIZE), Style.NORMAL);
final int r = SIZE;
graphic.drawCircle(CENTER.add(-r, -r), CENTER.add(r, r), KNOB);
final double alpha = state / 16.0 * Math.PI;
int x = (int) Math.round(SIZE * Math.cos(alpha));
int y = (int) Math.round(SIZE * Math.sin(alpha));
graphic.drawLine(CENTER, CENTER.add(x, y), MARKER);
Vector textPos = CENTER.add(0, SIZE2 * 3 + 4);
graphic.drawText(textPos, textPos.add(1, 0), label, Orientation.CENTERTOP, Style.NORMAL);
}
use of de.neemann.digital.draw.graphics.Polygon in project Digital by hneemann.
the class SixteenShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style highLight) {
graphic.drawPolygon(SevenShape.FRAME, Style.NORMAL);
int bits = -1;
if (inValue != null)
bits = (int) inValue.getValue();
int mask = 1;
for (Polygon p : POLYGONS) {
Style s = onStyle;
if ((bits & mask) == 0)
s = offStyle;
graphic.drawPolygon(p, s);
mask <<= 1;
}
Style s = onStyle;
if (dpValue != null && !dpValue.getBool())
s = offStyle;
graphic.drawCircle(DOT, DOT.add(8, 8), s);
}
use of de.neemann.digital.draw.graphics.Polygon in project Digital by hneemann.
the class FGFETShapeN method drawTo.
@Override
public void drawTo(Graphic graphic, Style highLight) {
super.drawTo(graphic, highLight);
if (programmed)
graphic.drawLine(new Vector(6, 2 * SIZE - 4), new Vector(6, 4), CHARGED_GATE);
else
graphic.drawLine(new Vector(6, 2 * SIZE - 4), new Vector(6, 4), Style.THIN);
// the arrow
graphic.drawLine(new Vector(SIZE2 + 8, SIZE), new Vector(SIZE + 3, SIZE), Style.THIN);
graphic.drawPolygon(new Polygon(true).add(SIZE2 + 5, SIZE).add(SIZE - SIZE2 / 3 + 3, SIZE - SIZE2 / 4).add(SIZE - SIZE2 / 3 + 3, SIZE + SIZE2 / 4), Style.THIN_FILLED);
}