Package ptolemy.vergil.actor
Class KielerLayoutConnector
- java.lang.Object
-
- diva.canvas.AbstractFigure
-
- diva.canvas.connector.AbstractConnector
-
- diva.canvas.connector.ManhattanConnector
-
- ptolemy.vergil.actor.LinkManhattanConnector
-
- ptolemy.vergil.actor.KielerLayoutConnector
-
- All Implemented Interfaces:
CanvasComponent
,Connector
,Figure
,VisibleComponent
,UserObjectContainer
public class KielerLayoutConnector extends LinkManhattanConnector
An extension to LinkManhattanRouter supporting bend points for routing links provided by the corresponding relation. These bend points can be set by any mechanism, e.g. the KIELER dataflow layout. The latter is currently used by the automatic layout mechanism that simply adds such bend point layout hints to relations.- Since:
- Ptolemy II 10.0
- Author:
- Christian Motika
- See Also:
KielerLayoutArcConnector
- Pt.ProposedRating:
- Red (cmot)
-
-
Field Summary
-
Fields inherited from class diva.canvas.connector.ManhattanConnector
_labelLocation
-
-
Constructor Summary
Constructors Constructor Description KielerLayoutConnector(Site tail, Site head, Link link)
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
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 ptolemy.vergil.actor.LinkManhattanConnector
getHeadSite, getLink, getTailSite
-
Methods inherited from class diva.canvas.connector.ManhattanConnector
getBendRadius, getRouter, repositionLabel, setBendRadius, setRouter, translate
-
Methods inherited from class diva.canvas.connector.AbstractConnector
getBounds, getDashArray, getHeadEnd, getLabelFigure, getLineWidth, getShape, getStroke, getStrokePaint, getTailEnd, 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
-
KielerLayoutConnector
public KielerLayoutConnector(Site tail, Site head, Link link)
Construct a new connector with the given tail and head for the specified link. The head and tail sites may be representative sites for multiport, in which case they are not necessarily the ones returned by getHeadSite() or getTailSite(). Those methods will return new sites as needed to ensure that each each connection is to its own site.- Parameters:
tail
- The tail site.head
- The head site.link
- The link.
-
-
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 classManhattanConnector
-
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.
-
-