/** * Gets the current image used for painting. * @return the image used for painting */ public BufferedImage getImage() { if(img == null && imageURL != null) { loadImage(); } return img; }
/** * Used by the persistence mechanism. */ public void setImageString(String imageString) { log.fine("setting image string to: " + imageString); String old = this.getImageString(); this.imageString = imageString; loadImage(); setDirty(true); firePropertyChange("imageString",old,imageString); } /*
/** * {@inheritDoc} */ protected void doPaint(Graphics2D g, Object component, int width, int height) { if (img == null && imageURL != null) { loadImage(); } Shape shape = provideShape(g, component,width,height); switch (getStyle()) { case BOTH: drawBackground(g,shape,width,height); drawBorder(g,shape,width,height); break; case FILLED: drawBackground(g,shape,width,height); break; case OUTLINE: drawBorder(g,shape,width,height); break; case NONE: break; } }