Package org.eclipse.draw2d.parts
Class Thumbnail
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.draw2d.parts.Thumbnail
- All Implemented Interfaces:
- IFigure,- UpdateListener
- Direct Known Subclasses:
- ScrollableThumbnail
A Thumbnail is a Figure that displays an image of its source Figure at a
 smaller size. The Thumbnail will maintain the aspect ratio of the source
 Figure.
- 
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.UpdateListenerUpdateListener.Stub
- 
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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidDeactivates this Thumbnail.getPreferredSize(int wHint, int hHint) Returns the preferred size of this Thumbnail.protected floatReturns the scale factor on the X-axis.protected floatReturns the scale factor on the Y-axis.protected IFigureReturns the source figure being used to generate a thumbnail.protected RectangleReturns the rectangular region relative to the source figure which will be the basis of the thumbnail.protected DimensionReturns the target size of the thumbnail.protected ImageReturns the scaled Image of the source Figure.protected booleanisDirty()Returnstrueif the source figure has changed.voidnotifyPainting(Rectangle damage, Map<IFigure, Rectangle> dirtyRegions) Notifies the listener that the listened to object is painting.voidNotifies the listener that the listened to object is validating.protected voidpaintFigure(Graphics graphics) Paints this Figure's primary representation, or background.voidsetDirty(boolean value) Sets the dirty flag.voidsetRefreshRate(int refreshRate) Sets the rate with which the thumbnail is updated.protected voidsetScales(float x, float y) Sets the X and Y scales for the Thumbnail.voidSets the source Figure.Methods 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, validate
- 
Constructor Details- 
Thumbnailpublic Thumbnail()Creates a new Thumbnail. The source Figure must be set separately if you use this constructor.
- 
ThumbnailCreates a new Thumbnail with the given IFigure as its source figure.- Parameters:
- fig- The source figure
 
 
- 
- 
Method Details- 
deactivatepublic void deactivate()Deactivates this Thumbnail.
- 
getPreferredSizeReturns the preferred size of this Thumbnail. The preferred size will be calculated in a way that maintains the source Figure's aspect ratio.- Specified by:
- getPreferredSizein interface- IFigure
- Overrides:
- getPreferredSizein class- Figure
- Parameters:
- wHint- The width hint
- hHint- The height hint
- Returns:
- The preferred size
- See Also:
 
- 
getScaleXprotected float getScaleX()Returns the scale factor on the X-axis.- Returns:
- X scale
 
- 
getScaleYprotected float getScaleY()Returns the scale factor on the Y-axis.- Returns:
- Y scale
 
- 
getSourceReturns the source figure being used to generate a thumbnail.- Returns:
- the source figure
 
- 
getSourceRectangleReturns the rectangular region relative to the source figure which will be the basis of the thumbnail. The value may be returned by reference and should not be modified by the caller.- Returns:
- the region of the source figure being used for the thumbnail
- Since:
- 3.1
 
- 
getThumbnailImageReturns the scaled Image of the source Figure. If the Image needs to be updated, the ThumbnailUpdater will notified.- Returns:
- The thumbnail image
 
- 
isDirtyprotected boolean isDirty()Returnstrueif the source figure has changed.- Returns:
- trueif the source figure has changed
 
- 
notifyPaintingDescription copied from interface:UpdateListenerNotifies the listener that the listened to object is painting. The damage rectangle may be null or empty. This indicates the dirty regions were clipped or not visible. But for objects such as theThumbnail, notification still needs to occur. The map of dirty regions is passed to allow the listener to determine if it needs to update, for instance when a particular figure is painting.- Specified by:
- notifyPaintingin interface- UpdateListener
- Parameters:
- damage- The area being painted
- dirtyRegions- a Map of figures to their dirty regions
- See Also:
 
- 
notifyValidatingpublic void notifyValidating()Description copied from interface:UpdateListenerNotifies the listener that the listened to object is validating.- Specified by:
- notifyValidatingin interface- UpdateListener
- 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:
 
- 
setDirtypublic void setDirty(boolean value) Sets the dirty flag.- Parameters:
- value- The dirty value
 
- 
setScalesprotected void setScales(float x, float y) Sets the X and Y scales for the Thumbnail. These scales represent the ratio between the source figure and the Thumbnail.- Parameters:
- x- The X scale
- y- The Y scale
 
- 
setSourceSets the source Figure. Also sets the scales and creates the necessary update manager.- Parameters:
- fig- The source figure
 
- 
getTargetSizeReturns the target size of the thumbnail.- Returns:
- the target size
- Since:
- 3.14
 
- 
setRefreshRatepublic void setRefreshRate(int refreshRate) Sets the rate with which the thumbnail is updated. If set to either0or a negative value, the update is done as fast as possible (default behavior), otherwise everyrefreshRatems. Example:setRefreshRate(500); // Update every 500ms - Parameters:
- refreshRate- The rate with which the thumbnail is updated.
- Since:
- 3.18
 
 
-