A shadow is generated as a BufferedImage
from another BufferedImage
. Once the renderer is set up, you must call {@link #createShadow} to actually generate the shadow:
ShadowRenderer renderer = new ShadowRenderer(); // renderer setup BufferedImage shadow = renderer.createShadow(bufferedImage);
The generated image dimensions are computed as following:
width = imageWidth + 2 * shadowSize height = imageHeight + 2 * shadowSize
This renderer allows to register property change listeners with {@link #addPropertyChangeListener}. Listening to properties changes is very useful when you emebed the renderer in a graphical component and give the API user the ability to access the renderer. By listening to properties changes, you can easily repaint the component when needed.
ShadowRenderer
is not guaranteed to be thread-safe.
|
|