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

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
    ZoomManager(org.eclipse.draw2d.ScalableFigure pane, org.eclipse.draw2d.Viewport viewport)
    Creates a new ZoomManager.
    ZoomManager(org.eclipse.draw2d.ScalableFigure pane, org.eclipse.draw2d.Viewport viewport, org.eclipse.draw2d.zoom.IZoomScrollPolicy scrollPolicy)
    Creates a new ZoomManager.
    ZoomManager(org.eclipse.draw2d.ScalableFreeformLayeredPane pane, org.eclipse.draw2d.Viewport viewport)
    Deprecated.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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.
    org.eclipse.draw2d.ScalableFreeformLayeredPane
    Deprecated.
    Use AbstractZoomManager.getScalableFigure() instead.
    protected boolean
    isFitAll(String zoomString)
     
    protected boolean
    isFitHeight(String zoomString)
     
    protected boolean
    isFitWidth(String zoomString)
     
    void
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • FIT_HEIGHT

      public static final String 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

      public static final String 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

      public static final String 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

      public ZoomManager(org.eclipse.draw2d.ScalableFigure pane, org.eclipse.draw2d.Viewport viewport)
      Creates a new ZoomManager.
      Parameters:
      pane - The ScalableFigure associated with this ZoomManager
      viewport - The Viewport associated with this ZoomManager
    • ZoomManager

      public ZoomManager(org.eclipse.draw2d.ScalableFreeformLayeredPane pane, org.eclipse.draw2d.Viewport viewport)
      Deprecated.
      Use ZoomManager(ScalableFigure, Viewport) instead. Creates a new ZoomManager
      Parameters:
      pane - The ScalableFreeformLayeredPane associated with this ZoomManager
      viewport - The Viewport associated with this viewport
    • ZoomManager

      public ZoomManager(org.eclipse.draw2d.ScalableFigure pane, org.eclipse.draw2d.Viewport viewport, org.eclipse.draw2d.zoom.IZoomScrollPolicy scrollPolicy)
      Creates a new ZoomManager.
      Parameters:
      pane - The ScalableFigure associated with this ZoomManager
      viewport - The Viewport associated with this ZoomManager
      scrollPolicy - The zoom scroll policy to be used with this ZoomManager
      Since:
      3.13
  • Method Details

    • getPane

      public org.eclipse.draw2d.ScalableFreeformLayeredPane getPane()
      Deprecated.
      Use AbstractZoomManager.getScalableFigure() instead. Returns the pane.
      Returns:
      the pane
    • addZoomListener

      @Deprecated(since="3.13", forRemoval=true) public void 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.
      Adds the given ZoomListener to this ZoomManager's list of listeners.
      Parameters:
      listener - the ZoomListener to be added
    • removeZoomListener

      @Deprecated(since="3.13", forRemoval=true) public 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.
      Removes the given ZoomListener from this ZoomManager's list of listeners.
      Parameters:
      listener - the ZoomListener to be removed
    • isFitWidth

      protected boolean isFitWidth(String zoomString)
      Specified by:
      isFitWidth in class org.eclipse.draw2d.zoom.AbstractZoomManager
    • isFitAll

      protected boolean isFitAll(String zoomString)
      Specified by:
      isFitAll in class org.eclipse.draw2d.zoom.AbstractZoomManager
    • isFitHeight

      protected boolean isFitHeight(String zoomString)
      Specified by:
      isFitHeight in class org.eclipse.draw2d.zoom.AbstractZoomManager