Class ApplyLayoutRequest


  • public class ApplyLayoutRequest
    extends ChangeRequest
    A change request specialized for application of automatically computed layout. This is used to set new locations for graph elements and to set layout hints for connection routing.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Miro Spoenemann (msp)
    Pt.AcceptedRating:
    Red (msp)
    Pt.ProposedRating:
    Red (msp)
    • Constructor Detail

      • ApplyLayoutRequest

        public ApplyLayoutRequest​(java.lang.Object source)
        Create a request for applying layout.
        Parameters:
        source - The source object, which is typically the parent composite actor.
    • Method Detail

      • addLocation

        public void addLocation​(Locatable locatable,
                                double x,
                                double y)
        Add a new location change to the request.
        Parameters:
        locatable - The locatable that will be changed
        x - The new x coordinate
        y - The new y coordinate
      • addConnection

        public void addConnection​(Relation relation,
                                  NamedObj head,
                                  NamedObj tail,
                                  double[] bendPoints)
        Add a new connection routing change to the request.
        Parameters:
        relation - The relation that owns the connection.
        head - The head object of the connection.
        tail - The tail object of the connection.
        bendPoints - The new bend points.
      • addConnection

        public void addConnection​(Relation relation,
                                  NamedObj head,
                                  NamedObj tail,
                                  double[] bendPoints,
                                  java.awt.geom.Point2D.Double labelLocation)
        Add a new connection routing change to the request.
        Parameters:
        relation - The relation that owns the connection.
        head - The head object of the connection.
        tail - The tail object of the connection.
        bendPoints - The new bend points.
        labelLocation - The location of a label, may be null
      • addCurve

        public void addCurve​(Transition transition,
                             double exitAngle)
        Add a new transition curve change to the request.
        Parameters:
        transition - The transition that is represented by the curve.
        exitAngle - The new value for the exit angle.
      • _execute

        protected void _execute()
                         throws java.lang.Exception
        Execute the request. This sets the previously configured locations and connections.
        Specified by:
        _execute in class ChangeRequest
        Throws:
        java.lang.Exception - If the change fails.