Package org.eclipse.gef.editparts
Class ZoomManager
java.lang.Object
org.eclipse.draw2d.zoom.AbstractZoomManager
org.eclipse.gef.editparts.ZoomManager
public class ZoomManager
extends org.eclipse.draw2d.zoom.AbstractZoomManager
Manage the primary zoom function in a graphical viewer. This class is used by
the zoom contribution items, including:
A ZoomManager controls how zoom in and zoom out are performed. It also
determines the list of choices the user sees in the drop-down Combo on the
toolbar. The zoom manager controls a ScalableFigure
, which
performs the actual zoom, and also a Viewport
. The viewport is
needed so that the scrolled location is preserved as the zoom level changes.
NOTE: For the settings of Page
, Width
and Height
to work properly, the given
Viewport
should have its scrollbars always visible or never
visible. Otherwise, these settings may cause undesired effects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
String constant for the "Page" zoom level.static final String
String constant for the "Height" zoom level.static final String
String constant for the "Width" zoom level.Fields inherited from class org.eclipse.draw2d.zoom.AbstractZoomManager
ANIMATE_NEVER, ANIMATE_ZOOM_IN_OUT
-
Constructor Summary
ConstructorsConstructorDescriptionZoomManager
(ScalableFigure pane, Viewport viewport) Creates a new ZoomManager.ZoomManager
(ScalableFigure pane, Viewport viewport, org.eclipse.draw2d.zoom.IZoomScrollPolicy scrollPolicy) Creates a new ZoomManager.ZoomManager
(ScalableFreeformLayeredPane pane, Viewport viewport) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addZoomListener
(ZoomListener listener) Deprecated, for removal: This API element is subject to removal in a future version.Use {@link #org.eclipse.draw2d.zoom.ZoomManager.addZoomListener(ZoomListener listener)} instead.getPane()
Deprecated.UseAbstractZoomManager.getScalableFigure()
instead.protected boolean
protected boolean
isFitHeight
(String zoomString) protected boolean
isFitWidth
(String zoomString) void
removeZoomListener
(ZoomListener listener) Deprecated, for removal: This API element is subject to removal in a future version.Use {@link #org.eclipse.draw2d.zoom.ZoomManager.removeZoomListener(ZoomListener listener)} instead.Methods inherited from class org.eclipse.draw2d.zoom.AbstractZoomManager
addZoomListener, canZoomIn, canZoomOut, fireZoomChanged, getFitHeightZoomLevel, getFitPageZoomLevel, getFitWidthZoomLevel, getMaxZoom, getMinZoom, getNextZoomLevel, getPreviousZoomLevel, getScalableFigure, getUIMultiplier, getViewport, getZoom, getZoomAsText, getZoomLevelContributions, getZoomLevels, getZoomLevelsAsText, primSetZoom, removeZoomListener, setScrollPolicy, setUIMultiplier, setViewLocation, setZoom, setZoomAnimationStyle, setZoomAsText, setZoomLevelContributions, setZoomLevels, zoomIn, zoomOut, zoomTo
-
Field Details
-
FIT_HEIGHT
String constant for the "Height" zoom level. At this zoom level, the zoom manager will adopt a zoom setting such that the entire height of the diagram will be visible on the screen. -
FIT_WIDTH
String constant for the "Width" zoom level. At this zoom level, the zoom manager will adopt a zoom setting such that the entire width of the diagram will be visible on the screen. -
FIT_ALL
String constant for the "Page" zoom level. At this zoom level, the zoom manager will adopt a zoom setting such that the entire diagram will be visible on the screen.
-
-
Constructor Details
-
ZoomManager
Creates a new ZoomManager.- Parameters:
pane
- The ScalableFigure associated with this ZoomManagerviewport
- The Viewport associated with this ZoomManager
-
ZoomManager
Deprecated.UseZoomManager(ScalableFigure, Viewport)
instead. Creates a new ZoomManager- Parameters:
pane
- The ScalableFreeformLayeredPane associated with this ZoomManagerviewport
- The Viewport associated with this viewport
-
ZoomManager
public ZoomManager(ScalableFigure pane, Viewport viewport, org.eclipse.draw2d.zoom.IZoomScrollPolicy scrollPolicy) Creates a new ZoomManager.- Parameters:
pane
- The ScalableFigure associated with this ZoomManagerviewport
- The Viewport associated with this ZoomManagerscrollPolicy
- The zoom scroll policy to be used with this ZoomManager- Since:
- 3.13
-
-
Method Details
-
getPane
Deprecated.UseAbstractZoomManager.getScalableFigure()
instead. Returns the pane.- Returns:
- the pane
-
addZoomListener
Deprecated, for removal: This API element is subject to removal in a future version.Use {@link #org.eclipse.draw2d.zoom.ZoomManager.addZoomListener(ZoomListener listener)} instead.Adds the given ZoomListener to this ZoomManager's list of listeners.- Parameters:
listener
- the ZoomListener to be added
-
removeZoomListener
Deprecated, for removal: This API element is subject to removal in a future version.Use {@link #org.eclipse.draw2d.zoom.ZoomManager.removeZoomListener(ZoomListener listener)} instead.Removes the given ZoomListener from this ZoomManager's list of listeners.- Parameters:
listener
- the ZoomListener to be removed
-
isFitWidth
- Specified by:
isFitWidth
in classorg.eclipse.draw2d.zoom.AbstractZoomManager
-
isFitAll
- Specified by:
isFitAll
in classorg.eclipse.draw2d.zoom.AbstractZoomManager
-
isFitHeight
- Specified by:
isFitHeight
in classorg.eclipse.draw2d.zoom.AbstractZoomManager
-
ZoomManager(ScalableFigure, Viewport)
instead.