Class ViewportAwareConnectionLayerClippingStrategy

java.lang.Object
org.eclipse.draw2d.ViewportAwareConnectionLayerClippingStrategy
All Implemented Interfaces:
IClippingStrategy

public class ViewportAwareConnectionLayerClippingStrategy extends Object implements IClippingStrategy
Clipping strategy for connection layer, which takes into account nested view ports and truncates those parts of connections which reach outside and are thus not visible.
Since:
3.6
  • Constructor Details

    • ViewportAwareConnectionLayerClippingStrategy

      public ViewportAwareConnectionLayerClippingStrategy(ConnectionLayer connectionLayer)
  • Method Details

    • getClip

      public Rectangle[] getClip(IFigure figure)
      Description copied from interface: IClippingStrategy
      Specifies the clipping region for the given child figure. That is, all parts of the figure, which are not covered by one of the returned rectangles are masked out and will not get painted. Each returned rectangle is considered to be specified in coordinates relative to the given child figure's bounds.
      Specified by:
      getClip in interface IClippingStrategy
      Parameters:
      figure - The child figure, which clipping region has to be returned.
      Returns:
      An array of rectangles to specify the clipping region of the figure, i.e. the areas in which the figure should not get clipped. May return an empty array in case the figure should not be visible at all, may not return null.
      See Also:
    • getEdgeClippingRectangle

      protected Rectangle[] getEdgeClippingRectangle(Connection connection)
      Computes clipping rectangle(s) for a given connection. Will consider all enclosing viewports, excluding the root viewport.
    • getNodeClippingRectangle

      protected Rectangle getNodeClippingRectangle(IFigure figure)
      Computes clipping rectangle for a given (node) figure. Will consider all enclosing viewports, excluding the root viewport.
    • clipAtViewports

      protected void clipAtViewports(Rectangle clipRect, List<Viewport> enclosingViewportsPath)
      Clips the given clipRect at all given viewports.
    • getRootViewport

      protected Viewport getRootViewport()
      Returns the root viewport, i.e. the nearest enclosing viewport of the connection layer, which corresponds to the nearest enclosing common viewport of primary and connection layer.
    • getAbsolutePointsAsCopy

      protected PointList getAbsolutePointsAsCopy(Connection connection)
      Returns the connection's points in absolute coordinates.
    • getAbsoluteViewportAreaAsCopy

      protected Rectangle getAbsoluteViewportAreaAsCopy(Viewport viewport)
      Returns the area covered by the viewport in absolute coordinates.
    • getAbsoluteClientAreaAsCopy

      protected Rectangle getAbsoluteClientAreaAsCopy(IFigure figure)
      Returns the viewport's client area in absolute coordinates.
    • getAbsoluteBoundsAsCopy

      protected Rectangle getAbsoluteBoundsAsCopy(IFigure figure)
      Returns the figure's bounds in absolute coordinates.