Package org.eclipse.draw2d
Class ImageFigure
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.draw2d.AbstractImageFigure
org.eclipse.draw2d.ImageFigure
- All Implemented Interfaces:
- IFigure,- IImageFigure
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 SummaryNested classes/interfaces inherited from class org.eclipse.draw2d.FigureFigure.FigureIterator, Figure.IdentitySearch, Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigureIFigure.NoInsetsNested classes/interfaces inherited from interface org.eclipse.draw2d.IImageFigureIImageFigure.ImageChangedListener
- 
Field SummaryFields inherited from class org.eclipse.draw2d.FigurebgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.IFigureMAX_DIMENSION, MIN_DIMENSION, NO_INSETS
- 
Constructor SummaryConstructorsConstructorDescriptionConstructor
 The default alignment isPositionConstants.CENTER.ImageFigure(Image image) Constructor
 The default alignment isPositionConstants.CENTER.ImageFigure(Image image, int alignment) Constructor
- 
Method SummaryModifier and TypeMethodDescriptiongetImage()Returns the SWT Image contained by the figuregetPreferredSize(int wHint, int hHint) Calculates the necessary size to display the Image within the figure's client area.protected voidpaintFigure(Graphics graphics) Paints this Figure's primary representation, or background.voidsetAlignment(int flag) Sets the alignment of the Image within this Figure.voidSets the Image that this ImageFigure displays.Methods inherited from class org.eclipse.draw2d.AbstractImageFigureaddImageChangedListener, notifyImageChanged, removeImageChangedListenerMethods inherited from class org.eclipse.draw2d.Figureadd, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getChildrenRevIterable, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getListenersIterable, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, handleMouseWheelScrolled, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, optimizeClip, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validateMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.draw2d.IFigureadd, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, handleMouseWheelScrolled, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isOpaque, isRequestFocusEnabled, isShowing, isVisible, paint, remove, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setClippingStrategy, setConstraint, setCursor, setEnabled, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
- 
Constructor Details- 
ImageFigurepublic ImageFigure()Constructor
 The default alignment isPositionConstants.CENTER.
- 
ImageFigureConstructor
 The default alignment isPositionConstants.CENTER.- Parameters:
- image- The Image to be displayed
 
- 
ImageFigureConstructor- Parameters:
- image- The Image to be displayed
- alignment- A PositionConstant indicating the alignment
- See Also:
 
 
- 
- 
Method Details- 
getImageDescription copied from interface:IImageFigureReturns the SWT Image contained by the figure- Returns:
- The Image that this Figure displays
 
- 
getPreferredSizeCalculates the necessary size to display the Image within the figure's client area.- Specified by:
- getPreferredSizein interface- IFigure
- Overrides:
- getPreferredSizein class- Figure
- Parameters:
- wHint- a width hint
- hHint- a height hint
- Returns:
- The preferred size
- See Also:
 
- 
paintFigureDescription copied from class:FigurePaints this Figure's primary representation, or background. Changes made to the graphics to the graphics current state will not affect the subsequent calls toFigure.paintClientArea(Graphics)andFigure.paintBorder(Graphics). Furthermore, it is safe to callgraphics.restoreState()within this method, and doing so will restore the graphics to its original state upon entry.- Overrides:
- paintFigurein class- Figure
- Parameters:
- graphics- The Graphics used to paint
- See Also:
 
- 
setAlignmentpublic void setAlignment(int flag) Sets the alignment of the Image within this Figure. The alignment comes into play when the ImageFigure is larger than the Image. The alignment could be any valid combination of the following:- PositionConstants.NORTH
- PositionConstants.SOUTH
- PositionConstants.EAST
- PositionConstants.WEST
- PositionConstants.CENTER or PositionConstants.NONE
 - Parameters:
- flag- A constant indicating the alignment
 
- 
setImageSets the Image that this ImageFigure displays.IMPORTANT: Note that it is the client's responsibility to dispose the given image. - Parameters:
- image- The Image to be displayed. It can be- null.
 
 
-