}
}
@Override
public void paintInstance(InstancePainter painter) {
Color onColor = painter.getAttributeValue(Io.ATTR_ON_COLOR);
Color offColor = painter.getAttributeValue(Io.ATTR_OFF_COLOR);
boolean drawSquare = painter.getAttributeValue(ATTR_DOT_SHAPE) == SHAPE_SQUARE;
State data = getState(painter);
long ticks = painter.getTickCount();
Bounds bds = painter.getBounds();
boolean showState = painter.getShowState();
Graphics g = painter.getGraphics();
int rows = data.rows;
int cols = data.cols;
for (int j = 0; j < rows; j++) {
for (int i = 0; i < cols; i++) {
int x = bds.getX() + 10 * i;
int y = bds.getY() + 10 * j;
if (showState) {
Value val = data.get(j, i, ticks);
Color c;
if (val == Value.TRUE) c = onColor;
else if (val == Value.FALSE) c = offColor;
else c = Value.ERROR_COLOR;
g.setColor(c);