javax.swing.Icon
public class PictureImageIcon
extends java.lang.Object
implements javax.swing.Icon
Constructor | Description |
---|---|
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.
|
Modifier and Type | Method | Description |
---|---|---|
void |
cacheImage(java.awt.GraphicsConfiguration gc,
java.awt.Color bg) |
Forces creation of a cached image for display.
|
static java.awt.image.BufferedImage |
createImage(Picture picture,
java.awt.GraphicsConfiguration gc,
java.awt.Color bg,
java.lang.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(java.awt.Component c,
java.awt.Graphics g,
int x,
int y) |
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 timepublic int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
paintIcon
in interface javax.swing.Icon
public void cacheImage(java.awt.GraphicsConfiguration gc, java.awt.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 java.awt.image.BufferedImage createImage(Picture picture, java.awt.GraphicsConfiguration gc, java.awt.Color bg, java.lang.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 nullCopyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.