/** Returns a DebugGraphics for use in buffering window. */ private Graphics debugGraphics() { DebugGraphics debugGraphics; DebugGraphicsInfo info = info(); JFrame debugFrame; if (info.debugFrame == null) { info.debugFrame = new JFrame(); info.debugFrame.setSize(500, 500); } debugFrame = info.debugFrame; debugFrame.show(); debugGraphics = new DebugGraphics(debugFrame.getGraphics()); debugGraphics.setFont(getFont()); debugGraphics.setColor(getColor()); debugGraphics.translate(xOffset, yOffset); debugGraphics.setClip(getClipBounds()); if (debugFlash()) { debugGraphics.setDebugOptions(FLASH_OPTION); } return debugGraphics; }