public void draw(ComponentDrawContext context) { CircuitState state = context.getCircuitState(); Graphics g = context.getGraphics(); GraphicsUtil.switchToWidth(g, WIDTH); g.setColor(state.getValue(e0).getColor()); g.drawLine(e0.getX(), e0.getY(), e1.getX(), e1.getY()); }
public void propagate(CircuitState state) { // Normally this is handled by CircuitWires, and so it won't get // called. The exception is when a wire is added or removed state.markPointAsDirty(e0); state.markPointAsDirty(e1); }