Package org.eclipse.draw2d
Class ViewportUtilities
java.lang.Object
org.eclipse.draw2d.ViewportUtilities
Utility class to support working with 
Viewports.- Since:
- 3.6
- 
Method SummaryModifier and TypeMethodDescriptiongetEnclosingViewportsPath(IFigure figure) static ViewportgetNearestCommonViewport(IFigure firstFigure, IFigure secondFigure) static ViewportgetNearestEnclosingViewport(IFigure figure) static ViewportgetNearestViewport(IFigure figure) static ViewportgetRootViewport(IFigure figure) getViewportsPath(Viewport leafViewport, Viewport rootViewport) getViewportsPath(Viewport leafViewport, Viewport rootViewport, boolean includeRootViewport) 
- 
Method Details- 
getEnclosingViewportsPath
- 
getViewportsPathReturns a list containing the provided leafViewportas the first element, and all its enclosingViewports up to the rootViewport, where the rootViewportforms the last element of the list.- Parameters:
- leafViewport- The- Viewport, whose parent hierarchy is processed.
- rootViewport- an ancestor of the given leafViewport, which marks the end point of the hierarchy to be processed.
- Returns:
- A list of Viewports containing the leafViewportas the first element, the rootViewportas the last and in between all enclosingViewports of the leafViewportup to the root. Returns an empty list in case leaf or rootViewportare null or in case the root viewport is not an ancestor of the leafViewport.
 
- 
getViewportsPathpublic static List<Viewport> getViewportsPath(Viewport leafViewport, Viewport rootViewport, boolean includeRootViewport) Returns a list containing the provided leafViewportas the first element, and all its enclosingViewports up to the rootViewport. The rootViewportforms the last element of the list, in case includeRootViewport is set to true, otherwise the viewport directly nested below the root viewport will be the last in the list.- Parameters:
- leafViewport- The- Viewport, whose parent hierarchy is processed.
- rootViewport- an ancestor of the given leafViewport, which marks the end point of the hierarchy to be processed.
- includeRootViewport- whether the provided rootViewport should be included in the list of returned viewports (as the last one) or not.
- Returns:
- A list of Viewports containing the leafViewportas the first element, the rootViewportas the last and in between all enclosingViewports of the leafViewportup to the root. Returns an empty list in case leaf or rootViewportare null or in case the root viewport is not an ancestor of the leafViewport.
 
- 
getNearestCommonViewport
- 
getRootViewport
- 
getNearestViewport
- 
getNearestEnclosingViewport- Parameters:
- figure-
- Returns:
- The nearest enclosing Viewportof the given figure, or null if none could be found.
 
 
-