}
static void drawLegacy(ComponentDrawContext context, SplitterAttributes attrs,
Location origin) {
Graphics g = context.getGraphics();
CircuitState state = context.getCircuitState();
Direction facing = attrs.facing;
int fanout = attrs.fanout;
SplitterParameters parms = attrs.getParameters();
g.setColor(Color.BLACK);
int x0 = origin.getX();
int y0 = origin.getY();
int x1 = x0 + parms.getEnd0X();
int y1 = y0 + parms.getEnd0Y();
int dx = parms.getEndToEndDeltaX();
int dy = parms.getEndToEndDeltaY();
if (facing == Direction.NORTH || facing == Direction.SOUTH) {
int ySpine = (y0 + y1) / 2;
GraphicsUtil.switchToWidth(g, Wire.WIDTH);
g.drawLine(x0, y0, x0, ySpine);
int xi = x1;
int yi = y1;
for (int i = 1; i <= fanout; i++) {
if (context.getShowState()) {
g.setColor(state.getValue(Location.create(xi, yi)).getColor());
}
int xSpine = xi + (xi == x0 ? 0 : (xi < x0 ? 10 : -10));
g.drawLine(xi, yi, xSpine, ySpine);
xi += dx;
yi += dy;
}
if (fanout > 3) {
GraphicsUtil.switchToWidth(g, SPINE_WIDTH);
g.setColor(Color.BLACK);
g.drawLine(x1 + dx, ySpine, x1 + (fanout - 2) * dx, ySpine);
} else {
g.setColor(Color.BLACK);
g.fillOval(x0 - SPINE_DOT / 2, ySpine - SPINE_DOT / 2,
SPINE_DOT, SPINE_DOT);
}
} else {
int xSpine = (x0 + x1) / 2;
GraphicsUtil.switchToWidth(g, Wire.WIDTH);
g.drawLine(x0, y0, xSpine, y0);
int xi = x1;
int yi = y1;
for (int i = 1; i <= fanout; i++) {
if (context.getShowState()) {
g.setColor(state.getValue(Location.create(xi, yi)).getColor());
}
int ySpine = yi + (yi == y0 ? 0 : (yi < y0 ? 10 : -10));
g.drawLine(xi, yi, xSpine, ySpine);
xi += dx;
yi += dy;