Class LineAttribute

  • All Implemented Interfaces:
    java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
    Direct Known Subclasses:
    ArrowAttribute

    public class LineAttribute
    extends ShapeAttribute
    This is an attribute that is rendered as a line.

    This contains two parameters, x and y, which control the run and rise, respectively, of the line. Note that the origin is in the upper-left hand corner, so positive x values will extend to the right, and positive y values will extend downwards on the screen.

    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • x

        public Parameter x
        The horizontal extent. This is a double that defaults to 100.0.
      • y

        public Parameter y
        The y extent. This is a double that defaults to 0.0.
    • Constructor Detail

      • LineAttribute

        public LineAttribute​(NamedObj container,
                             java.lang.String name)
                      throws IllegalActionException,
                             NameDuplicationException
        Construct an attribute with the given name contained by the specified container. The container argument must not be null, or a NullPointerException will be thrown. This attribute will use the workspace of the container for synchronization and version counts. If the name argument is null, then the name is set to the empty string. Increment the version of the workspace.
        Parameters:
        container - The container.
        name - The name of this attribute.
        Throws:
        IllegalActionException - If the attribute is not of an acceptable class for the container, or if the name contains a period.
        NameDuplicationException - If the name coincides with an attribute already in the container.
    • Method Detail

      • clone

        public java.lang.Object clone​(Workspace workspace)
                               throws java.lang.CloneNotSupportedException
        Clone the object into the specified workspace. The new object is not added to the directory of that workspace (you must do this yourself if you want it there). The result is an object with no container.
        Overrides:
        clone in class ShapeAttribute
        Parameters:
        workspace - The workspace for the cloned object.
        Returns:
        The new Attribute.
        Throws:
        java.lang.CloneNotSupportedException - Not thrown in this base class
        See Also:
        NamedObj.exportMoML(Writer, int, String), NamedObj.setDeferringChangeRequests(boolean)
      • _getDefaultShape

        protected java.awt.Shape _getDefaultShape()
        Return a line.
        Overrides:
        _getDefaultShape in class ShapeAttribute
        Returns:
        A line.