/** * Overloaded methods that do actual drawing need to enter the gdk threads and also do certain * things before and after. */ public void draw(Shape s) { if (comp == null || comp instanceof AlphaComposite) super.draw(s); else { createBuffer(); Graphics2D g2d = (Graphics2D) buffer.getGraphics(); g2d.setStroke(this.getStroke()); g2d.setColor(this.getColor()); g2d.draw(s); drawComposite(s.getBounds2D(), null); } }