Package org.eclipse.draw2d
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 Summary
ConstructorsConstructorDescriptionViewportAwareConnectionLayerClippingStrategy
(ConnectionLayer connectionLayer) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
clipAtViewports
(Rectangle clipRect, List<Viewport> enclosingViewportsPath) Clips the given clipRect at all given viewports.protected Rectangle
getAbsoluteBoundsAsCopy
(IFigure figure) Returns the figure's bounds in absolute coordinates.protected Rectangle
getAbsoluteClientAreaAsCopy
(IFigure figure) Returns the viewport's client area in absolute coordinates.protected PointList
getAbsolutePointsAsCopy
(Connection connection) Returns the connection's points in absolute coordinates.protected Rectangle
getAbsoluteViewportAreaAsCopy
(Viewport viewport) Returns the area covered by the viewport in absolute coordinates.Specifies the clipping region for the given child figure.protected Rectangle[]
getEdgeClippingRectangle
(Connection connection) Computes clipping rectangle(s) for a given connection.protected Rectangle
getNodeClippingRectangle
(IFigure figure) Computes clipping rectangle for a given (node) figure.protected Viewport
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.
-
Constructor Details
-
ViewportAwareConnectionLayerClippingStrategy
-
-
Method Details
-
getClip
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 interfaceIClippingStrategy
- 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
Computes clipping rectangle(s) for a given connection. Will consider all enclosing viewports, excluding the root viewport. -
getNodeClippingRectangle
Computes clipping rectangle for a given (node) figure. Will consider all enclosing viewports, excluding the root viewport. -
clipAtViewports
Clips the given clipRect at all given viewports. -
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
Returns the connection's points in absolute coordinates. -
getAbsoluteViewportAreaAsCopy
Returns the area covered by the viewport in absolute coordinates. -
getAbsoluteClientAreaAsCopy
Returns the viewport's client area in absolute coordinates. -
getAbsoluteBoundsAsCopy
Returns the figure's bounds in absolute coordinates.
-