|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot.PictureImageIcon
public class PictureImageIcon
Adapter class that makes a Picture usable as an Icon, suitable for use in a pixel (non-vector) context. Rendering is done to an off-screen volatile image for performance. This rendered image is optionally cached for subsequent use.
Constructor Summary | |
---|---|
PictureImageIcon(Picture picture,
boolean caching)
Constructs an icon with default transparency. |
|
PictureImageIcon(Picture picture,
boolean caching,
int transparency)
Constructs an icon with specific transparency characteristics. |
Method Summary | |
---|---|
void |
cacheImage(GraphicsConfiguration gc,
Color bg)
Forces creation of a cached image for display. |
static BufferedImage |
createImage(Picture picture,
GraphicsConfiguration gc,
Color bg,
Integer transparency)
Creates an image containing the graphic content of this icon, suitable for caching or painting to a graphics context. |
int |
getIconHeight()
|
int |
getIconWidth()
|
void |
paintIcon(Component c,
Graphics g,
int x,
int y)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PictureImageIcon(Picture picture, boolean caching, int transparency)
picture
- picture to paintcaching
- true iff painted image is cached rather than
just drawn off-screen every timetransparency
- transparency modeTransparency.OPAQUE
,
Transparency.BITMASK
,
Transparency.TRANSLUCENT
public PictureImageIcon(Picture picture, boolean caching)
picture
- picture to paintcaching
- true iff painted image is cached rather than
just drawn off-screen every timeMethod Detail |
---|
public int getIconWidth()
getIconWidth
in interface Icon
public int getIconHeight()
getIconHeight
in interface Icon
public void paintIcon(Component c, Graphics g, int x, int y)
paintIcon
in interface Icon
public void cacheImage(GraphicsConfiguration gc, Color bg)
gc
- graphics config in which this icon will be displayedbg
- background colour for image; null is legal but may
lead to unpredictable effects.public static BufferedImage createImage(Picture picture, GraphicsConfiguration gc, Color bg, Integer transparency)
picture
- picture to paint on the imagegc
- graphics config in which this icon will be displayedbg
- background colour for image; null is legal but may
lead to unpredictable effects.transparency
- integer value of Transparency code, or null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |