Package org.eclipse.graphiti.ui.internal.util.gef

# Class ZoomManagerWithAnimation

java.lang.Object
org.eclipse.draw2d.zoom.AbstractZoomManager
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.

## Field Summary

### Fields inherited from class org.eclipse.gef.editparts.ZoomManager

`FIT_ALL, FIT_HEIGHT, FIT_WIDTH`

### Fields inherited from class org.eclipse.draw2d.zoom.AbstractZoomManager

`ANIMATE_NEVER, ANIMATE_ZOOM_IN_OUT`

## 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

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, getPane, isFitAll, isFitHeight, isFitWidth, removeZoomListener`

### Methods inherited from class org.eclipse.draw2d.zoom.AbstractZoomManager

`addZoomListener, canZoomIn, canZoomOut, fireZoomChanged, getMaxZoom, getMinZoom, getNextZoomLevel, getPreviousZoomLevel, getScalableFigure, getUIMultiplier, getViewport, getZoom, getZoomAsText, getZoomLevelContributions, getZoomLevels, getZoomLevelsAsText, removeZoomListener, setScrollPolicy, setUIMultiplier, setViewLocation, setZoom, setZoomAnimationStyle, setZoomAsText, setZoomLevelContributions, setZoomLevels, zoomIn, zoomOut, zoomTo`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ZoomManagerWithAnimation

public ZoomManagerWithAnimation(org.eclipse.draw2d.ScalableFigure pane, org.eclipse.draw2d.Viewport viewport, org.eclipse.gef.ui.parts.ScrollingGraphicalViewer viewer)
Creates a new ZoomManagerWithAnimation.

## Method Details

### primSetZoom

protected void primSetZoom(double zoom)
Sets many zoom-levels to create the animation-effect.

Overrides:
  `primSetZoom` in class `org.eclipse.draw2d.zoom.AbstractZoomManager`
See Also:
  - `AbstractZoomManager.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 class `org.eclipse.draw2d.zoom.AbstractZoomManager`
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 class `org.eclipse.draw2d.zoom.AbstractZoomManager`
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 class `org.eclipse.draw2d.zoom.AbstractZoomManager`
Returns:
  zoom setting required to fit the scalable figure vertically on the screen