drawAnd(g, x0, y0, 130, 90);
drawOr(g, x0, y0, 220, 60);
}
private void drawWires(Graphics g, int x0, int y0) {
Value upperNot = upper.not();
Value lowerNot = lower.not();
Value upperAnd = upperNot.and(lower);
Value lowerAnd = lowerNot.and(upper);
Value out = upperAnd.or(lowerAnd);
int x;
int y;
g.setColor(upper.getColor());
x = toX(x0, 20);
y = toY(y0, 10);
g.fillOval(x - 7, y - 7, 14, 14);
g.drawLine(toX(x0, 0), y, toX(x0, 40), y);
g.drawLine(x, y, x, toY(y0, 70));
y = toY(y0, 70);
g.drawLine(x, y, toX(x0, 80), y);
g.setColor(upperNot.getColor());
y = toY(y0, 10);
g.drawLine(toX(x0, 70), y, toX(x0, 80), y);
g.setColor(lower.getColor());
x = toX(x0, 30);
y = toY(y0, 110);
g.fillOval(x - 7, y - 7, 14, 14);
g.drawLine(toX(x0, 0), y, toX(x0, 40), y);
g.drawLine(x, y, x, toY(y0, 50));
y = toY(y0, 50);
g.drawLine(x, y, toX(x0, 80), y);
g.setColor(lowerNot.getColor());
y = toY(y0, 110);
g.drawLine(toX(x0, 70), y, toX(x0, 80), y);
g.setColor(upperAnd.getColor());
x = toX(x0, 150);
y = toY(y0, 30);
g.drawLine(toX(x0, 130), y, x, y);
g.drawLine(x, y, x, toY(y0, 45));
y = toY(y0, 45);
g.drawLine(x, y, toX(x0, 174), y);
g.setColor(lowerAnd.getColor());
y = toY(y0, 90);
g.drawLine(toX(x0, 130), y, x, y);
g.drawLine(x, y, x, toY(y0, 75));
y = toY(y0, 75);
g.drawLine(x, y, toX(x0, 174), y);
g.setColor(out.getColor());
y = toY(y0, 60);
g.drawLine(toX(x0, 220), y, toX(x0, 240), y);
}