Class FixedThumbnail
- java.lang.Object
-
- org.eclipse.draw2d.Figure
-
- org.eclipse.graphiti.ui.internal.fixed.FixedThumbnail
-
- All Implemented Interfaces:
org.eclipse.draw2d.IFigure,org.eclipse.draw2d.UpdateListener
- Direct Known Subclasses:
FixedScrollableThumbnail
public class FixedThumbnail extends org.eclipse.draw2d.Figure implements org.eclipse.draw2d.UpdateListenerThe Class FixedThumbnail.
-
-
Constructor Summary
Constructors Constructor Description FixedThumbnail()Creates a new Thumbnail.FixedThumbnail(org.eclipse.draw2d.IFigure fig)Creates a new Thumbnail with the given IFigure as its source figure.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddeactivate()Deactivates this Thumbnail.org.eclipse.draw2d.geometry.DimensiongetPreferredSize(int wHint, int hHint)Returns the preferred size of this Thumbnail.protected floatgetScaleX()Returns the scale factor on the X-axis.protected floatgetScaleY()Returns the scale factor on the Y-axis.protected org.eclipse.draw2d.IFiguregetSource()Returns the source figure being used to generate a thumbnail.protected org.eclipse.draw2d.geometry.RectanglegetSourceRectangle()Returns the rectangular region relative to the source figure which will be the basis of the thumbnail.protected org.eclipse.swt.graphics.ImagegetThumbnailImage()Returns the scaled Image of the source Figure.protected booleanisDirty()Returnstrueif the source figure has changed.voidnotifyPainting(org.eclipse.draw2d.geometry.Rectangle damage, java.util.Map dirtyRegions)Notify painting.voidnotifyValidating()Notify validating.protected voidpaintFigure(org.eclipse.draw2d.Graphics graphics)Paint figure.voidsetDirty(boolean value)Sets the dirty flag.protected voidsetScales(float x, float y)Sets the X and Y scales for the Thumbnail.voidsetSource(org.eclipse.draw2d.IFigure fig)Sets the source Figure.-
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, 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 Detail
-
FixedThumbnail
public FixedThumbnail()
Creates a new Thumbnail. The source Figure must be set separately if you use this constructor.
-
FixedThumbnail
public FixedThumbnail(org.eclipse.draw2d.IFigure fig)
Creates a new Thumbnail with the given IFigure as its source figure.- Parameters:
fig- The source figure
-
-
Method Detail
-
deactivate
public void deactivate()
Deactivates this Thumbnail.
-
getPreferredSize
public org.eclipse.draw2d.geometry.Dimension getPreferredSize(int wHint, int hHint)Returns 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 interfaceorg.eclipse.draw2d.IFigure- Overrides:
getPreferredSizein classorg.eclipse.draw2d.Figure- Parameters:
wHint- The width hinthHint- The height hint- Returns:
- The preferred size
-
getScaleX
protected float getScaleX()
Returns the scale factor on the X-axis.- Returns:
- X scale
-
getScaleY
protected float getScaleY()
Returns the scale factor on the Y-axis.- Returns:
- Y scale
-
getSource
protected org.eclipse.draw2d.IFigure getSource()
Returns the source figure being used to generate a thumbnail.- Returns:
- the source figure
-
getSourceRectangle
protected org.eclipse.draw2d.geometry.Rectangle getSourceRectangle()
Returns 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
-
getThumbnailImage
protected org.eclipse.swt.graphics.Image getThumbnailImage()
Returns the scaled Image of the source Figure. If the Image needs to be updated, the ThumbnailUpdater will notified.- Returns:
- The thumbnail image
-
isDirty
protected boolean isDirty()
Returnstrueif the source figure has changed.- Returns:
trueif the source figure has changed
-
notifyPainting
public void notifyPainting(org.eclipse.draw2d.geometry.Rectangle damage, java.util.Map dirtyRegions)Notify painting.- Specified by:
notifyPaintingin interfaceorg.eclipse.draw2d.UpdateListener- Parameters:
damage- the damagedirtyRegions- the dirty regions- See Also:
UpdateListener.notifyPainting(Rectangle, Map)
-
notifyValidating
public void notifyValidating()
Notify validating.- Specified by:
notifyValidatingin interfaceorg.eclipse.draw2d.UpdateListener- See Also:
UpdateListener.notifyValidating()
-
paintFigure
protected void paintFigure(org.eclipse.draw2d.Graphics graphics)
Paint figure.- Overrides:
paintFigurein classorg.eclipse.draw2d.Figure- Parameters:
graphics- the graphics- See Also:
Figure.paintFigure(Graphics)
-
setDirty
public void setDirty(boolean value)
Sets the dirty flag.- Parameters:
value- The dirty value
-
setScales
protected 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 scaley- The Y scale
-
setSource
public void setSource(org.eclipse.draw2d.IFigure fig)
Sets the source Figure. Also sets the scales and creates the necessary update manager.- Parameters:
fig- The source figure
-
-