|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.JavaBean
org.jdesktop.swingx.painter.AbstractPainter
org.jdesktop.swingx.painter.ImagePainter
public class ImagePainter
A Painter instance that paints an image. Any Image is acceptable. This Painter also allows the developer to specify a "Style" -- CENTERED, TILED, SCALED, POSITIONED, and CSS_POSITIONED; with the following meanings:
Nested Class Summary | |
---|---|
static class |
ImagePainter.Style
An enumeration of Styles supported by the ImagePainter. |
Constructor Summary | |
---|---|
ImagePainter()
Create a new ImagePainter. |
|
ImagePainter(Image image)
Create a new ImagePainter with the specified image and the Style Style.CENTERED |
|
ImagePainter(Image image,
ImagePainter.Style style)
Create a new ImagePainter with the specified image and style. |
Method Summary | |
---|---|
Image |
getImage()
|
Point2D |
getImagePosition()
|
ImagePainter.Style |
getStyle()
|
void |
paintBackground(Graphics2D g,
JComponent component)
Subclasses should implement this method and perform custom painting operations here. |
void |
setImage(Image image)
Sets the image to use for the background of this panel. |
void |
setImagePosition(Point2D imagePosition)
|
void |
setImageScale(double imageScale)
|
void |
setStyle(ImagePainter.Style s)
Sets what style to use when painting the image |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImagePainter()
public ImagePainter(Image image)
image
- the image to be paintedpublic ImagePainter(Image image, ImagePainter.Style style)
image
- the image to be paintedstyle
- the style of the imageMethod Detail |
---|
public void setImage(Image image)
image
- if null, clears the image. Otherwise, this will set the
image to be painted. If the preferred size has not been explicitly set,
then the image dimensions will alter the preferred size of the panel.public Image getImage()
public void setStyle(ImagePainter.Style s)
s
- The style constant to apply to the image.public ImagePainter.Style getStyle()
public void paintBackground(Graphics2D g, JComponent component)
AbstractPainter
paintBackground
in class AbstractPainter
g
- The Graphics2D object in which to paintcomponent
- The JComponent that the Painter is delegate for.public void setImagePosition(Point2D imagePosition)
public Point2D getImagePosition()
public void setImageScale(double imageScale)
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |