|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdiva.canvas.AbstractFigure
diva.canvas.toolbox.ImageFigure
public class ImageFigure
A figure which draws a user-specified image.
| Field Summary | |
|---|---|
private boolean |
_centered
Indicator of whether this figure should be centered on its origin. |
private int |
_height
The height of the figure. |
private java.awt.Image |
_image
The image of this figure. |
private int |
_width
The width of the figure. |
private java.awt.geom.AffineTransform |
_xf
The local transform |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ImageFigure()
Create an empty image figure. |
|
ImageFigure(java.awt.Image i)
Create an image figure displaying the given image. |
|
| Method Summary | |
|---|---|
java.awt.Image |
getImage()
Return the figure's image. |
java.awt.geom.Point2D |
getOrigin()
Return the origin of the figure in the enclosing transform context. |
java.awt.Shape |
getShape()
Return the rectangular shape of the image, or a small rectangle if the image is null. |
boolean |
imageUpdate(java.awt.Image image,
int infoflags,
int x,
int y,
int width,
int height)
This method, which is required by the ImageObserver interface, is called if something has changed in a background loading of the image. |
boolean |
isCentered()
Return whether the figure should be centered on its origin. |
void |
paint(java.awt.Graphics2D g)
Paint the figure's image. |
void |
setCentered(boolean centered)
Specify whether the figure should be centered on its origin. |
void |
setImage(java.awt.Image i)
Set the figure's image. |
void |
transform(java.awt.geom.AffineTransform t)
Perform an affine transform on this image. |
| Methods inherited from class diva.canvas.AbstractFigure |
|---|
contains, getBounds, getInteractor, getLayer, getParent, getToolTipText, getTransformContext, getUserObject, hit, intersects, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible, translate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private boolean _centered
private int _height
private java.awt.Image _image
private int _width
private java.awt.geom.AffineTransform _xf
| Constructor Detail |
|---|
public ImageFigure()
public ImageFigure(java.awt.Image i)
| Method Detail |
|---|
public java.awt.Image getImage()
public java.awt.geom.Point2D getOrigin()
getOrigin in interface FiguregetOrigin in class AbstractFigureAbstractFigure.getBounds()public java.awt.Shape getShape()
getShape in interface FiguregetShape in class AbstractFigure
public boolean imageUpdate(java.awt.Image image,
int infoflags,
int x,
int y,
int width,
int height)
imageUpdate in interface java.awt.image.ImageObserverimage - The image being observed.infoflags - The bitwise inclusive OR of the following flags:
WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR,
ABORT.x - The x coordinate of the image.y - The y coordinate of the image.width - The width of the image.height - The height of the image.
public boolean isCentered()
getOrigin(),
setCentered(boolean)public void paint(java.awt.Graphics2D g)
paint in interface VisibleComponentpaint in class AbstractFigurepublic void setCentered(boolean centered)
centered - False to make the origin of the figure, as
returned by getOrigin(), be the upper left corner.getOrigin()public void setImage(java.awt.Image i)
i - The image.public void transform(java.awt.geom.AffineTransform t)
transform in interface Figuretransform in class AbstractFigure
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||