Runtime

org.eclipse.gmf.runtime.diagram.ui.editparts
Class ShapeCompartmentEditPart.ConnectionRefreshMgr

java.lang.Object
  extended byorg.eclipse.gmf.runtime.diagram.ui.editparts.ShapeCompartmentEditPart.ConnectionRefreshMgr
Enclosing class:
ShapeCompartmentEditPart

public static class ShapeCompartmentEditPart.ConnectionRefreshMgr
extends java.lang.Object

Class used to refresh the connections associated to the shape compartment's children. This implementation will hide all connections whose endpoints are not visible inside the shape compartment.


Constructor Summary
ShapeCompartmentEditPart.ConnectionRefreshMgr()
           
 
Method Summary
protected  java.util.Set getConnectionNodes(ShapeCompartmentEditPart scep)
          Return the set of ConnectionNodeEditParts contained in the supplied shape compartment.
protected  ShapeCompartmentEditPart getOwningShapeCompartment(EditPart ep)
          gets the supplied editparts containing shape compartment.
protected  java.util.List getSourceConnections(IGraphicalEditPart editPart)
          gets the source connections of the passed edit part
protected  EditPart getSourceEditPart(ConnectionEditPart connectionEditPart)
          Returns source edit part.
protected  java.util.List getTargetConnections(IGraphicalEditPart editPart)
          get the target connections of the passed edit part
protected  EditPart getTargetEditPart(ConnectionEditPart connectionEditPart)
          Returns target editPart
protected  boolean isBorderItem(ShapeCompartmentEditPart scep, IGraphicalEditPart itemEditPart)
          This method can be overridden to allow connections between border items to be drawn to items within the interior of the compartment.
protected  boolean isChildOf(EditPart parent, EditPart child)
          Return true if parent child's ancestor; otherwise false
protected  boolean isFigureVisible(IFigure figure, Point loc)
          Walks up the hierarchy to make sure that supplied figure is visible inside its figure hierarchy.
protected  boolean isFigureVisible(IFigure figure, Point loc, IFigure stopFigure)
          Walks up the hierarchy to make sure that supplied figure is visible inside its figure hierarchy.
protected  void refreshConnections(ShapeCompartmentEditPart scep)
          Cycles through all the connections associated to the editparts contained within the passed shape compartment and sets their visibility.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeCompartmentEditPart.ConnectionRefreshMgr

public ShapeCompartmentEditPart.ConnectionRefreshMgr()
Method Detail

refreshConnections

protected void refreshConnections(ShapeCompartmentEditPart scep)
Cycles through all the connections associated to the editparts contained within the passed shape compartment and sets their visibility.

Parameters:
scep - edit part to consider
See Also:
ConnectionNodeEditPart.getSourceConnectionAnchor(), ConnectionNodeEditPart.getTargetConnectionAnchor()

getConnectionNodes

protected java.util.Set getConnectionNodes(ShapeCompartmentEditPart scep)
Return the set of ConnectionNodeEditParts contained in the supplied shape compartment.

Parameters:
scep - a shape compartment.
Returns:
a Set of ConnectionNodeEditPart.

isChildOf

protected boolean isChildOf(EditPart parent,
                            EditPart child)
Return true if parent child's ancestor; otherwise false

Parameters:
parent - parent to consider
child - child to consider
Returns:
true or false

getOwningShapeCompartment

protected ShapeCompartmentEditPart getOwningShapeCompartment(EditPart ep)
gets the supplied editparts containing shape compartment.

Parameters:
ep - edit part
Returns:
ShapeCompartmentEditPart

isBorderItem

protected boolean isBorderItem(ShapeCompartmentEditPart scep,
                               IGraphicalEditPart itemEditPart)
This method can be overridden to allow connections between border items to be drawn to items within the interior of the compartment.

Parameters:
scep -
itemEditPart -
Returns:
false by default. Override to allow connections to border items.

getSourceEditPart

protected EditPart getSourceEditPart(ConnectionEditPart connectionEditPart)
Returns source edit part.

Parameters:
connectionEditPart -
Returns:
EditPart

getTargetEditPart

protected EditPart getTargetEditPart(ConnectionEditPart connectionEditPart)
Returns target editPart

Parameters:
connectionEditPart -
Returns:
EditPart

getSourceConnections

protected java.util.List getSourceConnections(IGraphicalEditPart editPart)
gets the source connections of the passed edit part

Parameters:
editPart - edit part to consider
Returns:
source connections

getTargetConnections

protected java.util.List getTargetConnections(IGraphicalEditPart editPart)
get the target connections of the passed edit part

Parameters:
editPart - edit part to consider
Returns:
target connection

isFigureVisible

protected boolean isFigureVisible(IFigure figure,
                                  Point loc)
Walks up the hierarchy to make sure that supplied figure is visible inside its figure hierarchy.
Same as calling isFigureVisible(figure, loc, null);

Parameters:
figure - The figure under test.
loc - the child's location in absolute coordinates.
Returns:
boolean visibility of the figure by going up the chain.

isFigureVisible

protected boolean isFigureVisible(IFigure figure,
                                  Point loc,
                                  IFigure stopFigure)
Walks up the hierarchy to make sure that supplied figure is visible inside its figure hierarchy.

Parameters:
figure - The figure under test.
loc - the child's location in absolute coordinates.
stopFigure - root figure in the figure hierarchy being tested.
Returns:
boolean visibility of the figure by going up the chain.

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.