Class RectangularFigure2D

    • Field Detail

      • xPosition

        public Parameter xPosition
        The initial x position (of type double) of the figure, before additional transformations. The default value is 0.0.
      • yPosition

        public Parameter yPosition
        The initial y position (of type double) of the figure, before additional transformations. The default value is 0.0.
      • width

        public Parameter width
        The initial width of the bounding rectangle (of type double) of the figure, before additional transformations. The default value is 50.0.
      • height

        public Parameter height
        The initial height of the bounding rectangle (of type double) of the figure, before additional transformations. The default value is 50.0.
    • Method Detail

      • attributeChanged

        public void attributeChanged​(Attribute attribute)
                              throws IllegalActionException
        Update the position and location of the figure on the screen when the user changes the parameters.
        Overrides:
        attributeChanged in class GRShape2D
        Parameters:
        attribute - The attribute which changed.
        Throws:
        IllegalActionException - If thrown while updating the figure or by the superclass.
      • _getCenterOffset

        protected double _getCenterOffset​(Parameter dimension)
                                   throws IllegalActionException
        Return the offset in a single axis by which to move the rectangle so that the figure is centered at the cartesian origin.
        Parameters:
        dimension - The size of the rectangle along a single axis.
        Returns:
        A DoubleToken containing the offset needed to center the figure.
        Throws:
        IllegalActionException - If getToken() method throws such an exception.
      • _getCenterPoint

        protected java.awt.geom.Point2D.Double _getCenterPoint()
                                                        throws IllegalActionException
        Return the center point of the rectangle as a Point.Double.
        Returns:
        The rectangle's center point as a Point.Double.
        Throws:
        IllegalActionException - If getToken() method throws such an exception.
      • _getCornerPoint

        protected java.awt.geom.Point2D.Double _getCornerPoint()
                                                        throws IllegalActionException
        Calculate the lower left point of the rectangle as a Point.Double.
        Returns:
        The lower left point of the rectangle as a Point.Double.
        Throws:
        IllegalActionException - If getToken() method throws such an exception.
      • _updateFigure

        protected abstract void _updateFigure()
                                       throws IllegalActionException
        Update the figure's position and size when the user changes the appropriate parameters.
        Throws:
        IllegalActionException - If getToken() generates IllegalActionException.