Class ZoomManagerWithAnimation
- java.lang.Object
-
- org.eclipse.gef.editparts.ZoomManager
-
- org.eclipse.graphiti.ui.internal.util.gef.ZoomManagerWithAnimation
-
public class ZoomManagerWithAnimation extends org.eclipse.gef.editparts.ZoomManager
Enhances the default ZoomManager by animating the change of the zoom. This is done by implicitly replacing every change of the zoom by a sequence of changes, which range from the old zoom to the new zoom.
-
-
Constructor Summary
Constructors Constructor Description ZoomManagerWithAnimation(org.eclipse.draw2d.ScalableFigure pane, org.eclipse.draw2d.Viewport viewport, org.eclipse.gef.ui.parts.ScrollingGraphicalViewer viewer)
Creates a new ZoomManagerWithAnimation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
getFitHeightZoomLevel()
Returns the zoomLevel needed so that the diagram shapes fit vertically on the screen.protected double
getFitPageZoomLevel()
Returns the zoomLevel needed so that the diagram shapes fit on the screen.protected double
getFitWidthZoomLevel()
Returns the zoomLevel needed so that the diagram shapes fit horizontally on the screen.int
getTotalSteps()
Returns the total number of steps.protected void
primSetZoom(double zoom)
Sets many zoom-levels to create the animation-effect.void
stepPerformed()
Is called after each performed step.-
Methods inherited from class org.eclipse.gef.editparts.ZoomManager
addZoomListener, canZoomIn, canZoomOut, fireZoomChanged, getMaxZoom, getMinZoom, getNextZoomLevel, getPane, getPreviousZoomLevel, getScalableFigure, getUIMultiplier, getViewport, getZoom, getZoomAsText, getZoomLevelContributions, getZoomLevels, getZoomLevelsAsText, removeZoomListener, setUIMultiplier, setViewLocation, setZoom, setZoomAnimationStyle, setZoomAsText, setZoomLevelContributions, setZoomLevels, zoomIn, zoomOut, zoomTo
-
-
-
-
Method Detail
-
primSetZoom
protected void primSetZoom(double zoom)
Sets many zoom-levels to create the animation-effect.- Overrides:
primSetZoom
in classorg.eclipse.gef.editparts.ZoomManager
- See Also:
ZoomManager.primSetZoom(double)
-
getFitPageZoomLevel
protected double getFitPageZoomLevel()
Returns the zoomLevel needed so that the diagram shapes fit on the screen. In order to calculate the correct size, the invisible corner pixels which we need to have the scroll bars always present, are removed and added later again. If this is not the GFFigureCanvas, the corresponding super method is called.- Overrides:
getFitPageZoomLevel
in classorg.eclipse.gef.editparts.ZoomManager
- Returns:
- zoom setting required to fit the entire scalable figure on the screen
-
stepPerformed
public void stepPerformed()
Is called after each performed step.By default it dispatches all pending events of the current Display. This is important, because typically the steps do something which shall be visible to the user. By dispatching the events all updates to the UI will be performed.
-
getTotalSteps
public int getTotalSteps()
Returns the total number of steps. Should be called on every execute() and undo(), so that always the last preference-value is used.- Returns:
- The total number of steps.
-
getFitWidthZoomLevel
protected double getFitWidthZoomLevel()
Returns the zoomLevel needed so that the diagram shapes fit horizontally on the screen. In order to calculate the correct size, the invisible corner pixels which we need to have the scroll bars always present, are removed and added later again. If this is not the GFFigureCanvas, the corresponding super method is called.- Overrides:
getFitWidthZoomLevel
in classorg.eclipse.gef.editparts.ZoomManager
- Returns:
- zoom setting required to fit the scalable figure horizontally on the screen
-
getFitHeightZoomLevel
protected double getFitHeightZoomLevel()
Returns the zoomLevel needed so that the diagram shapes fit vertically on the screen. In order to calculate the correct size, the invisible corner pixels which we need to have the scroll bars always present, are removed and added later again. If this is not the GFFigureCanvas, the corresponding super method is called.- Overrides:
getFitHeightZoomLevel
in classorg.eclipse.gef.editparts.ZoomManager
- Returns:
- zoom setting required to fit the scalable figure vertically on the screen
-
-