Draw2d
3.9.0.201305060205

org.eclipse.draw2d
Class ViewportAwareConnectionLayerClippingStrategy

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

public class ViewportAwareConnectionLayerClippingStrategy
extends java.lang.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
ViewportAwareConnectionLayerClippingStrategy(ConnectionLayer connectionLayer)
           
 
Method Summary
protected  void clipAtViewports(Rectangle clipRect, java.util.List 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.
 Rectangle[] getClip(IFigure figure)
          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 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewportAwareConnectionLayerClippingStrategy

public ViewportAwareConnectionLayerClippingStrategy(ConnectionLayer connectionLayer)
Method Detail

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:
IClippingStrategy.getClip(org.eclipse.draw2d.IFigure)

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,
                               java.util.List 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.


Draw2d
3.9.0.201305060205

Copyright (c) IBM Corp. and others 2000, 2011. All Rights Reserved.