Class 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)
    • 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 interface Connector
        Overrides:
        route in class ManhattanConnector
      • 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 value false.

        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.