Package ptolemy.vergil.modal
Class KielerLayoutArcConnector
- java.lang.Object
-
- diva.canvas.AbstractFigure
-
- diva.canvas.connector.AbstractConnector
-
- diva.canvas.connector.ArcConnector
-
- ptolemy.vergil.modal.KielerLayoutArcConnector
-
- All Implemented Interfaces:
CanvasComponent
,Connector
,Figure
,VisibleComponent
,UserObjectContainer
public class KielerLayoutArcConnector extends ArcConnector
Extends the regular ArcConnector, allowing to draw spline paths, i.e. series of bezier curves.- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Ulf Rueegg
- See Also:
KielerLayoutConnector
- Pt.ProposedRating:
- red (uru)
-
-
Field Summary
-
Fields inherited from class diva.canvas.connector.ArcConnector
_CLOSE_THRESHOLD
-
-
Constructor Summary
Constructors Constructor Description KielerLayoutArcConnector(Site tail, Site head)
Construct a new connector with the given tail and head for the specified link.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
repositionLabel()
Tell the connector to reposition its label if it has one.void
route()
Tell the connector to route itself between the current positions of the head and tail sites.static void
setLayoutInProgress(boolean inProgress)
Notifies layout connections that a layout is in progress, which stops them from deciding to remove layout hints from relations.-
Methods inherited from class diva.canvas.connector.ArcConnector
getAngle, getArcMidpoint, getGamma, getMidpointSite, getSelfLoop, setAngle, setGamma, setSelfLoop, translate, translateMidpoint
-
Methods inherited from class diva.canvas.connector.AbstractConnector
getBounds, getDashArray, getHeadEnd, getHeadSite, getLabelFigure, getLineWidth, getShape, getStroke, getStrokePaint, getTailEnd, getTailSite, headMoved, hit, intersects, paint, reroute, setDashArray, setHeadEnd, setHeadSite, setLabelFigure, setLineWidth, setShape, setStroke, setStrokePaint, setTailEnd, setTailSite, tailMoved, transform
-
Methods inherited from class diva.canvas.AbstractFigure
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface diva.canvas.CanvasComponent
getTransformContext, repaint, repaint
-
Methods inherited from interface diva.canvas.Figure
contains, getInteractor, getLayer, getOrigin, getParent, getToolTipText, setInteractor, setParent, setToolTipText
-
Methods inherited from interface diva.util.UserObjectContainer
getUserObject, setUserObject
-
Methods inherited from interface diva.canvas.VisibleComponent
isVisible, paint, setVisible
-
-
-
-
Constructor Detail
-
KielerLayoutArcConnector
public KielerLayoutArcConnector(Site tail, Site head)
Construct a new connector with the given tail and head for the specified link. The connector is either drawn as a spline (in case KIELER layout information is available) or in the classic arc-style fashion as implemented by the super-class.- Parameters:
tail
- The tail site.head
- The head site.
-
-
Method Detail
-
route
public void route()
Tell the connector to route itself between the current positions of the head and tail sites. If bend points are available, draw the line with these instead. Delete bend point information if modification detected (i.e., movement of one or the other end of a link).- Specified by:
route
in interfaceConnector
- Overrides:
route
in classArcConnector
-
repositionLabel
public void repositionLabel()
Tell the connector to reposition its label if it has one. The label is currently only positioned at the center of the arc.- Overrides:
repositionLabel
in classArcConnector
-
setLayoutInProgress
public static void setLayoutInProgress(boolean inProgress)
Notifies layout connections that a layout is in progress, which stops them from deciding to remove layout hints from relations. Without this mechanism, it can happen that layout hints get removed seemingly at random. This is caused by layout connectors thinking that one actor in a relation is moved during the application of the layout results. This in turn triggers the corresponding layout hint to be viewed as being invalid, and consequently to be removed.A call to this method with the parameter value
true
must always be followed by a call with the parameter valuefalse
.Note: This mechanism is not thread-safe! However, since the problem only occurs while a layout result is being applied through a
MoMLChangeRequest
(of which only one is ever being executed at a given time), this shouldn't be a problem.- Parameters:
inProgress
-true
if a layout result is currently being applied.
-
-