diva.gui.toolbox
Class FigureIcon
java.lang.Object
javax.swing.ImageIcon
diva.gui.toolbox.FigureIcon
- All Implemented Interfaces:
- Serializable, Accessible, Icon
public class FigureIcon
- extends ImageIcon
An icon that looks like a diva figure. This class renders the figure into
a buffered image and then points the icon at the buffer. This process is
rather slow, so you might want to cache the returned icon somehow to
avoid repeating it, especially if you have a large number of icons to
render such as in a TreeCellRenderer.
- Version:
- $Revision: 1.6 $
- Author:
- Steve Neuendorffer (neuendor@eecs.berkeley.edu)
- See Also:
- Serialized Form
Constructor Summary |
FigureIcon(Figure figure)
Create a new icon that looks like the given figure. |
FigureIcon(Figure figure,
boolean antialias)
Create a new icon that looks like the given figure. |
FigureIcon(Figure figure,
int x,
int y)
Create a new icon that looks like the given figure. |
FigureIcon(Figure figure,
int x,
int y,
int border,
boolean antialias)
Create a new icon that looks like the given figure. |
Methods inherited from class javax.swing.ImageIcon |
getAccessibleContext, getDescription, getIconHeight, getIconWidth, getImage, getImageLoadStatus, getImageObserver, loadImage, paintIcon, setDescription, setImage, setImageObserver, toString |
FigureIcon
public FigureIcon(Figure figure)
- Create a new icon that looks like the given figure. The icon will
have the size of the bounds of the figure.
The figure will be rendered into the icon with antialiasing turned off.
FigureIcon
public FigureIcon(Figure figure,
boolean antialias)
- Create a new icon that looks like the given figure. The icon will
have the size of the bounds of the figure.
The figure will be rendered into the icon with antialiasing according
to the given flag.
- Parameters:
antialias
- True if antialiasing should be used.
FigureIcon
public FigureIcon(Figure figure,
int x,
int y)
- Create a new icon that looks like the given figure. The figure will be
scaled to fit inside the given size, with any excess size filled
with a transparent background color.
The figure will be rendered into the icon with antialiasing turned off.
FigureIcon
public FigureIcon(Figure figure,
int x,
int y,
int border,
boolean antialias)
- Create a new icon that looks like the given figure. The icon will be
made the given size, and
given a border of the given number of pixels. The rendition of the
figure will be scaled to fit inside the border,
with any excess size filled with a transparent background color.
The figure will be rendered into the icon with antialiasing according
to the given flag.
- Parameters:
antialias
- True if antialiasing should be used.
Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.