public void setPaint(Paint paint) { if (paint == null) return; if (paint.equals(getPaint())) return; if (paint instanceof Color) { setColor((Color) paint); } else { super.setPaint(paint); hostGraphics.setPaint(paint); } }
protected void setHostGraphics(Graphics graphics) { hostGraphics = (Graphics2D) graphics; resolution = (graphics instanceof PrinterGraphics) ? 0 : 1; tagHandler = new GenericTagHandler(hostGraphics); super.setBackground(hostGraphics.getBackground()); super.setColor(hostGraphics.getColor()); super.setPaint(hostGraphics.getPaint()); super.setFont(hostGraphics.getFont()); Stroke s = hostGraphics.getStroke(); if (s instanceof BasicStroke) { lineWidth = ((BasicStroke) s).getLineWidth(); } webColor = WebColor.create(getColor()); setRenderingHint(KEY_SYMBOL_BLIT, VALUE_SYMBOL_BLIT_ON); }