Class ScalableRootEditPart

  • All Implemented Interfaces:
    IAdaptable, EditPart, LayerManager, GraphicalEditPart, LayerConstants, RequestConstants, RootEditPart

    public class ScalableRootEditPart
    extends SimpleRootEditPart
    implements LayerConstants, LayerManager
    A graphical root composed of regular Layers. The layers are added to LayeredPane or ScalableLayeredPane. All layers are positioned by StackLayouts, which means that the diagrams preferred size is the union of the preferred size of each layer, and all layers will be positioned to fill the entire diagram.

    IMPORTANTScalableRootEditPart uses a Viewport as its primary figure. It must be used with a ScrollingGraphicalViewer. The viewport gets installed into that viewer's FigureCanvas, which provides native scrollbars for scrolling the viewport.

    The layer structure (top-to-bottom) for this root is:

    Root Layered Pane
     Guide Layer
     Feedback Layer
     Handle Layer
     Scalable Layers (ScalableLayeredPane)
       Scaled Feedback Layer
       Printable Layers
        ├ Connection Layer
        └ Primary Layer  
       Grid Layer
    Since:
    2.1.1
    • Constructor Detail

      • ScalableRootEditPart

        public ScalableRootEditPart()
        Constructor for ScalableFreeformRootEditPart
    • Method Detail

      • createZoomManager

        protected ZoomManager createZoomManager​(org.eclipse.draw2d.ScalableFigure scalableFigure,
                                                org.eclipse.draw2d.Viewport viewport)
        Responsible of creating a ZoomManager to be used by this ScalableRootEditPart.
        Returns:
        A new ZoomManager bound to the given ScalableFigure and Viewport.
        Since:
        3.10
      • createGridLayer

        protected GridLayer createGridLayer()
        Creates a grid. Sub-classes can override this method to customize the appearance of the grid. The grid layer should be the first layer (i.e., beneath the primary layer) if it is not to cover up parts on the primary layer. In that case, the primary layer should be transparent so that the grid is visible.
        Returns:
        the newly created GridLayer
      • createLayers

        protected void createLayers​(org.eclipse.draw2d.LayeredPane layeredPane)
        Creates the top-most set of layers on the given layered pane
        Parameters:
        layeredPane - the parent for the created layers
      • createPrintableLayers

        protected org.eclipse.draw2d.LayeredPane createPrintableLayers()
        Creates a layered pane and the layers that should be printed.
        Returns:
        a new LayeredPane containing the printable layers
        See Also:
        PrintGraphicalViewerOperation
      • createScaledLayers

        protected org.eclipse.draw2d.ScalableLayeredPane createScaledLayers()
        Creates a scalable layered pane and the layers that should be scaled.
        Returns:
        a new ScalableLayeredPane containing the scalable layers
      • createViewport

        protected org.eclipse.draw2d.Viewport createViewport()
        Constructs the viewport that will be used to contain all of the layers.
        Returns:
        a new Viewport
      • getModel

        public java.lang.Object getModel()
        The root editpart does not have a real model. The LayerManager ID is returned so that this editpart gets registered using that key.
        Specified by:
        getModel in interface EditPart
        Overrides:
        getModel in class AbstractEditPart
        Returns:
        null or the primary model object
        See Also:
        EditPart.getModel()
      • getPrintableLayers

        protected org.eclipse.draw2d.LayeredPane getPrintableLayers()
        Returns the LayeredPane that should be used during printing. This layer will be identified using LayerConstants.PRINTABLE_LAYERS.
        Returns:
        the layered pane containing all printable content
      • getScaledLayers

        protected org.eclipse.draw2d.LayeredPane getScaledLayers()
        Returns the scalable layers of this EditPart
        Returns:
        LayeredPane
      • getZoomManager

        public ZoomManager getZoomManager()
        Returns the zoomManager.
        Returns:
        ZoomManager
      • register

        protected void register()
        Description copied from class: AbstractEditPart
        Registers itself in the viewer's various registries. If your EditPart has a 1-to-1 relationship with a visual object and a 1-to-1 relationship with a model object, the default implementation should be sufficent.
        Overrides:
        register in class AbstractEditPart
        See Also:
        AbstractEditPart.register()