Class Rectangle

  • All Implemented Interfaces:
    Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, SizeOfHandler, AntiAliasingDrawOperation, Serializable

    public class Rectangle
    extends AbstractColorStrokeDrawOperation
    Draws a rectangle with the specified color and dimensions at the given location. If the arc width/height are greater than 0, a rounded rectangle is drawn. The rectangle can be filled as well.

    Valid options are:

    -D <int> (property: debugLevel)
        The greater the number the more additional info the scheme may output to 
        the console (0 = off).
        default: 0
        minimum: 0
     
    -color <java.awt.Color> (property: color)
        The color of the pixel.
        default: #000000
     
    -stroke-thickness <float> (property: strokeThickness)
        The thickness of the stroke.
        default: 1.0
        minimum: 0.01
     
    -anti-aliasing-enabled (property: antiAliasingEnabled)
        If enabled, uses anti-aliasing for drawing.
     
    -x <int> (property: X)
        The X position of the top-left corner of the rectangle (1-based).
        default: 1
        minimum: 1
     
    -y <int> (property: Y)
        The Y position of the top-left corner of the rectangle (1-based).
        default: 1
        minimum: 1
     
    -width <int> (property: width)
        The width of the rectangle.
        default: 10
        minimum: 1
     
    -height <int> (property: height)
        The height of the rectangle.
        default: 10
        minimum: 1
     
    -arc-width <int> (property: arcWidth)
        The width of the arc for a rounded rectangle.
        default: 0
        minimum: 0
     
    -arc-height <int> (property: arcHeight)
        The height of the arc for a rounded rectangle.
        default: 0
        minimum: 0
     
    -fill (property: fill)
        If enabled, the rectangle gets filled with the specified color.
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_X

        protected int m_X
        the X position of the rectangle (1-based).
      • m_Y

        protected int m_Y
        the Y position of the rectangle (1-based).
      • m_Width

        protected int m_Width
        the width of the rectangle.
      • m_Height

        protected int m_Height
        the height of the rectangle.
      • m_ArcWidth

        protected int m_ArcWidth
        the width of the arc.
      • m_ArcHeight

        protected int m_ArcHeight
        the height of the arc.
      • m_Fill

        protected boolean m_Fill
        whether to fill the rectangle.
    • Constructor Detail

      • Rectangle

        public Rectangle()
    • Method Detail

      • setX

        public void setX​(int value)
        Sets the X position of the rectangle (top-left corner).
        Parameters:
        value - the position, 1-based
      • getX

        public int getX()
        Returns the X position of the rectangle (top-left corner).
        Returns:
        the position, 1-based
      • XTipText

        public String XTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setY

        public void setY​(int value)
        Sets the Y position of the rectangle (top-left corner).
        Parameters:
        value - the position, 1-based
      • getY

        public int getY()
        Returns the Y position of the rectangle (top-left corner).
        Returns:
        the position, 1-based
      • YTipText

        public String YTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setWidth

        public void setWidth​(int value)
        Sets the width of the rectangle.
        Parameters:
        value - the width
      • getWidth

        public int getWidth()
        Returns the width of the rectangle.
        Returns:
        the width
      • widthTipText

        public String widthTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setHeight

        public void setHeight​(int value)
        Sets the height of the rectangle.
        Parameters:
        value - the height
      • getHeight

        public int getHeight()
        Returns the height of the rectangle.
        Returns:
        the height
      • heightTipText

        public String heightTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setArcWidth

        public void setArcWidth​(int value)
        Sets the width of the arc.
        Parameters:
        value - the width
      • getArcWidth

        public int getArcWidth()
        Returns the width of the arc.
        Returns:
        the width
      • arcWidthTipText

        public String arcWidthTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setArcHeight

        public void setArcHeight​(int value)
        Sets the height of the arc.
        Parameters:
        value - the height
      • getArcHeight

        public int getArcHeight()
        Returns the height of the arc.
        Returns:
        the height
      • arcHeightTipText

        public String arcHeightTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setFill

        public void setFill​(boolean value)
        Sets whether to fill the rectangle.
        Parameters:
        value - true if to fill
      • getFill

        public boolean getFill()
        Returns whether to fill the rectangle.
        Returns:
        true if to fill
      • fillTipText

        public String fillTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.