public final void drawGhost(ComponentDrawContext context, Color color,
int x, int y, AttributeSet attrs) {
InstancePainter painter = context.getInstancePainter();
Graphics g = painter.getGraphics();
g.setColor(color);
g.translate(x, y);
painter.setFactory(this, attrs);
paintGhost(painter);
g.translate(-x, -y);
if (painter.getFactory() == null) {
super.drawGhost(context, color, x, y, attrs);