|
Draw2d 3.9.0.201308190730 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.draw2d.Figure
org.eclipse.draw2d.AbstractImageFigure
org.eclipse.draw2d.ImageFigure
public class ImageFigure
A Figure that simply contains an Image. Use this Figure, instead of a Label, when displaying Images without any accompanying text. This figure is not intended to have a layout mananger or children.
Note that it is the client's responsibility to dispose the given image. There is no "free" resource management in draw2d.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.draw2d.Figure |
---|
Figure.FigureIterator, Figure.IdentitySearch |
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IImageFigure |
---|
IImageFigure.ImageChangedListener |
Nested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure |
---|
IFigure.NoInsets |
Field Summary |
---|
Fields inherited from class org.eclipse.draw2d.Figure |
---|
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip |
Fields inherited from interface org.eclipse.draw2d.IFigure |
---|
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS |
Constructor Summary | |
---|---|
ImageFigure()
Constructor The default alignment is PositionConstants.CENTER . |
|
ImageFigure(Image image)
Constructor The default alignment is PositionConstants.CENTER . |
|
ImageFigure(Image image,
int alignment)
Constructor |
Method Summary | |
---|---|
Image |
getImage()
Returns the SWT Image contained by the figure |
Dimension |
getPreferredSize(int wHint,
int hHint)
Calculates the necessary size to display the Image within the figure's client area. |
protected void |
paintFigure(Graphics graphics)
Paints this Figure's primary representation, or background. |
void |
setAlignment(int flag)
Sets the alignment of the Image within this Figure. |
void |
setImage(Image image)
Sets the Image that this ImageFigure displays. |
Methods inherited from class org.eclipse.draw2d.AbstractImageFigure |
---|
addImageChangedListener, notifyImageChanged, removeImageChangedListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImageFigure()
PositionConstants.CENTER
.
public ImageFigure(Image image)
PositionConstants.CENTER
.
image
- The Image to be displayedpublic ImageFigure(Image image, int alignment)
image
- The Image to be displayedalignment
- A PositionConstant indicating the alignmentsetImage(Image)
,
setAlignment(int)
Method Detail |
---|
public Image getImage()
IImageFigure
public Dimension getPreferredSize(int wHint, int hHint)
getPreferredSize
in interface IFigure
getPreferredSize
in class Figure
wHint
- a width hinthHint
- a height hint
Figure.getPreferredSize(int, int)
protected void paintFigure(Graphics graphics)
Figure
Figure.paintClientArea(Graphics)
and
Figure.paintBorder(Graphics)
. Furthermore, it is safe to call
graphics.restoreState()
within this method, and doing so
will restore the graphics to its original state upon entry.
paintFigure
in class Figure
graphics
- The Graphics used to paintFigure.paintFigure(Graphics)
public void setAlignment(int flag)
flag
- A constant indicating the alignmentpublic void setImage(Image image)
IMPORTANT: Note that it is the client's responsibility to dispose the given image.
image
- The Image to be displayed. It can be null
.
|
Draw2d 3.9.0.201308190730 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |