public Graphics2D getGraphics() { if (graphics != null) return graphics; else return panel.getGraphics(); }