// next "if" suggested roughly by Kevin Walsh of Cornell to take care of
// repaint problems on OpenJDK under Ubuntu
int x = lastX;
int y = lastY;
if (x == INVALID_COORD || y == INVALID_COORD) return;
ComponentFactory source = getFactory();
if (source == null) return;
if (state == SHOW_GHOST) {
source.drawGhost(context, Color.GRAY, x, y, getBaseAttributes());
} else if (state == SHOW_ADD) {
source.drawGhost(context, Color.BLACK, x, y, getBaseAttributes());
}
}