|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.beans.AbstractBean
org.jdesktop.swingx.painter.AbstractPainter<T>
org.jdesktop.swingx.painter.AbstractLayoutPainter<T>
org.jdesktop.swingx.painter.AbstractAreaPainter<java.lang.Object>
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.ScaleType
|
| Nested classes/interfaces inherited from class org.jdesktop.swingx.painter.AbstractAreaPainter |
|---|
AbstractAreaPainter.Style |
| Nested classes/interfaces inherited from class org.jdesktop.swingx.painter.AbstractLayoutPainter |
|---|
AbstractLayoutPainter.HorizontalAlignment, AbstractLayoutPainter.VerticalAlignment |
| Nested classes/interfaces inherited from class org.jdesktop.swingx.painter.AbstractPainter |
|---|
AbstractPainter.Interpolation |
| Constructor Summary | |
|---|---|
ImagePainter()
Create a new ImagePainter. |
|
ImagePainter(java.awt.image.BufferedImage image)
Create a new ImagePainter with the specified image and the Style Style.CENTERED |
|
ImagePainter(java.awt.image.BufferedImage image,
AbstractLayoutPainter.HorizontalAlignment horizontal,
AbstractLayoutPainter.VerticalAlignment vertical)
Create a new ImagePainter with the specified image and alignment. |
|
ImagePainter(java.net.URL url)
Deprecated. (pre-1.6.2) no replacement, see Issue 1023 |
|
ImagePainter(java.net.URL url,
AbstractLayoutPainter.HorizontalAlignment horizontal,
AbstractLayoutPainter.VerticalAlignment vertical)
Deprecated. (pre-1.6.2) no replacement, see Issue 1023 |
|
| Method Summary | |
|---|---|
protected void |
doPaint(java.awt.Graphics2D g,
java.lang.Object component,
int width,
int height)
Subclasses must implement this method and perform custom painting operations here. |
java.awt.image.BufferedImage |
getImage()
Gets the current image used for painting. |
double |
getImageScale()
Gets the current scaling factor used when drawing an image. |
java.lang.String |
getImageString()
Deprecated. (pre-1.6.2) no replacement, see Issue 1023 |
ImagePainter.ScaleType |
getScaleType()
|
boolean |
isHorizontalRepeat()
Indicates if the image will be repeated horizontally. |
boolean |
isScaleToFit()
|
boolean |
isVerticalRepeat()
Indicates if the image will be repeated vertically. |
protected java.awt.Shape |
provideShape(java.awt.Graphics2D g,
java.lang.Object comp,
int width,
int height)
Returns the outline shape of this painter. |
void |
setHorizontalRepeat(boolean horizontalRepeat)
Sets if the image should be repeated horizontally. |
void |
setImage(java.awt.image.BufferedImage image)
Sets the image to paint with. |
void |
setImageScale(double imageScale)
Sets the scaling factor used when drawing the image |
void |
setImageString(java.lang.String imageString)
Deprecated. (pre-1.6.2) no replacement, see Issue 1023 |
void |
setScaleToFit(boolean scaleToFit)
|
void |
setScaleType(ImagePainter.ScaleType scaleType)
|
void |
setVerticalRepeat(boolean verticalRepeat)
Sets if the image should be repeated vertically. |
| Methods inherited from class org.jdesktop.swingx.painter.AbstractAreaPainter |
|---|
getAreaEffects, getBorderPaint, getBorderWidth, getFillPaint, getStyle, isPaintStretched, setAreaEffects, setBorderPaint, setBorderWidth, setFillPaint, setPaintStretched, setStyle |
| Methods inherited from class org.jdesktop.swingx.painter.AbstractLayoutPainter |
|---|
calculateLayout, getHorizontalAlignment, getInsets, getVerticalAlignment, isFillHorizontal, isFillVertical, setFillHorizontal, setFillVertical, setHorizontalAlignment, setInsets, setVerticalAlignment |
| Methods inherited from class org.jdesktop.swingx.painter.AbstractPainter |
|---|
clearCache, configureGraphics, getFilters, getInterpolation, isAntialiasing, isCacheable, isDirty, isVisible, paint, setAntialiasing, setCacheable, setDirty, setFilters, setInterpolation, setVisible, shouldUseCache, validate |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ImagePainter()
public ImagePainter(java.awt.image.BufferedImage image)
image - the image to be painted
public ImagePainter(java.awt.image.BufferedImage image,
AbstractLayoutPainter.HorizontalAlignment horizontal,
AbstractLayoutPainter.VerticalAlignment vertical)
horizontal - the horizontal alignmentvertical - the vertical alignmentimage - the image to be painted
@Deprecated
public ImagePainter(java.net.URL url)
throws java.io.IOException
java.io.IOException
@Deprecated
public ImagePainter(java.net.URL url,
AbstractLayoutPainter.HorizontalAlignment horizontal,
AbstractLayoutPainter.VerticalAlignment vertical)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
public void setImage(java.awt.image.BufferedImage image)
image - if null, clears the image. Otherwise, this will set the
image to be painted.public java.awt.image.BufferedImage getImage()
protected void doPaint(java.awt.Graphics2D g,
java.lang.Object component,
int width,
int height)
doPaint in class AbstractPainter<java.lang.Object>g - The Graphics2D object in which to paintpublic void setScaleToFit(boolean scaleToFit)
public boolean isScaleToFit()
public void setImageScale(double imageScale)
imageScale - the new image scaling factorpublic double getImageScale()
@Deprecated public java.lang.String getImageString()
@Deprecated public void setImageString(java.lang.String imageString)
public boolean isHorizontalRepeat()
public void setHorizontalRepeat(boolean horizontalRepeat)
horizontalRepeat - the new horizontal repeat valuepublic boolean isVerticalRepeat()
public void setVerticalRepeat(boolean verticalRepeat)
verticalRepeat - new value for the vertical repeat
protected java.awt.Shape provideShape(java.awt.Graphics2D g,
java.lang.Object comp,
int width,
int height)
AbstractAreaPainter
provideShape in class AbstractAreaPainter<java.lang.Object>g - graphicscomp - The Object this painter will be painted on.width - the width to paintheight - the height to paint
public ImagePainter.ScaleType getScaleType()
public void setScaleType(ImagePainter.ScaleType scaleType)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||