use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class NetListTest method testTunnel.
public void testTunnel() throws Exception {
Circuit c = new Circuit();
c.add(new Wire(new Vector(1, 1), new Vector(2, 1)));
addTunnel(c, new Vector(2, 1), "A");
c.add(new Wire(new Vector(3, 1), new Vector(4, 1)));
addTunnel(c, new Vector(3, 1), "A");
NetList ns = new NetList(c);
assertEquals(1, ns.size());
}
use of de.neemann.digital.draw.graphics.Vector 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);
}
use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class FGFETShapeP 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 + 1, SIZE), new Vector(SIZE2 + 7, SIZE), Style.THIN);
graphic.drawPolygon(new Polygon(true).add(SIZE - SIZE2 / 3 + 5, SIZE).add(SIZE2 + 7, SIZE - SIZE2 / 4).add(SIZE2 + 7, SIZE + SIZE2 / 4), Style.THIN_FILLED);
}
use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class LEDShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style heighLight) {
boolean fill = true;
if (value != null) {
fill = false;
if (!value.isHighZ() && (value.getValue() != 0))
fill = true;
}
Vector rad = new Vector(size - 2, size - 2);
Vector radL = new Vector(size, size);
Vector center = new Vector(1 + size, 0);
graphic.drawCircle(center.sub(radL), center.add(radL), Style.FILLED);
if (fill)
graphic.drawCircle(center.sub(rad), center.add(rad), onStyle);
Vector textPos = new Vector(2 * size + SIZE, 0);
graphic.drawText(textPos, textPos.add(1, 0), label, Orientation.LEFTCENTER, Style.NORMAL);
}
use of de.neemann.digital.draw.graphics.Vector in project Digital by hneemann.
the class LightBulbShape method drawTo.
@Override
public void drawTo(Graphic graphic, Style highLight) {
if (a != null && b != null) {
boolean on = !a.isHighZ() && !b.isHighZ() && (a.getBool() != b.getBool());
if (on)
graphic.drawCircle(new Vector(-SIZE + BORDER + 1, BORDER + 1), new Vector(SIZE - BORDER - 1, 2 * SIZE - BORDER - 1), style);
} else {
graphic.drawLine(CENTER.add(-RAD, -RAD), CENTER.add(RAD, RAD), Style.NORMAL);
graphic.drawLine(CENTER.add(-RAD, RAD), CENTER.add(RAD, -RAD), Style.NORMAL);
}
graphic.drawCircle(new Vector(-SIZE + BORDER, BORDER), new Vector(SIZE - BORDER, 2 * SIZE - BORDER), Style.NORMAL);
}
Aggregations