Package resources

Class Settings.Region

  • All Implemented Interfaces:
    java.awt.Shape, java.io.Serializable, java.lang.Cloneable
    Enclosing class:
    Settings

    public static class Settings.Region
    extends java.awt.Rectangle
    A specialized Rectangle that is more easily converted to or from a setting value.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D

        java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float
    • Field Summary

      • Fields inherited from class java.awt.Rectangle

        height, width, x, y
      • Fields inherited from class java.awt.geom.Rectangle2D

        OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
    • Constructor Summary

      Constructors 
      Constructor Description
      Region()
      Creates a new region whose upper-left corner is at (0, 0) in the coordinate space, and whose width and height are both zero.
      Region​(int width, int height)
      Creates a new region whose upper-left corner is at (0,0) in the coordinate space, and whose width and height are specified by the arguments of the same name.
      Region​(int x, int y, int width, int height)
      Creates a new region whose upper-left corner is specified as (x,y) and whose width and height are specified by the arguments of the same name.
      Region​(java.awt.Dimension d)
      Creates a new region whose upper-left corner is (0,0) and whose width and height are specified by the Dimension argument.
      Region​(java.awt.Point p)
      Creates a new region whose upper-left corner is the specified Point, and whose width and height are both zero.
      Region​(java.awt.Point p, java.awt.Dimension d)
      Creates a new region whose upper-left corner is specified by the Point argument, and whose width and height are specified by the Dimension argument.
      Region​(java.awt.Rectangle r)
      Creates a new region from the specified rectangle.
      Region​(java.lang.String settingValue)
      Creates a new region from a string using the same format as a region setting value.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getX2()
      Returns the x-coordinate of the right edge of the region.
      int getY2()
      Returns the y-coordinate of the bottom edge of the region.
      void setX2​(int x2)
      Moves the right edge of the region to the specified x-coordinate by changing the width of the region.
      void setY2​(int y2)
      Moves the bottom edge of the region to the specified y-coordinate by changing the height of the region.
      java.lang.String toString()  
      • Methods inherited from class java.awt.Rectangle

        add, add, add, contains, contains, contains, contains, createIntersection, createUnion, equals, getBounds, getBounds2D, getHeight, getLocation, getSize, getWidth, getX, getY, grow, inside, intersection, intersects, isEmpty, move, outcode, reshape, resize, setBounds, setBounds, setLocation, setLocation, setRect, setSize, setSize, translate, union
      • Methods inherited from class java.awt.geom.Rectangle2D

        add, add, add, contains, contains, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, setRect, union
      • Methods inherited from class java.awt.geom.RectangularShape

        clone, contains, contains, getCenterX, getCenterY, getFrame, getMaxX, getMaxY, getMinX, getMinY, intersects, setFrame, setFrame, setFrameFromCenter, setFrameFromCenter, setFrameFromDiagonal, setFrameFromDiagonal
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.Shape

        contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
    • Constructor Detail

      • Region

        public Region​(java.lang.String settingValue)
        Creates a new region from a string using the same format as a region setting value.
        Parameters:
        settingValue - the setting value to create a region from
      • Region

        public Region​(java.awt.Dimension d)
        Creates a new region whose upper-left corner is (0,0) and whose width and height are specified by the Dimension argument.
        Parameters:
        d - a Dimension, specifying width and height
      • Region

        public Region​(java.awt.Point p)
        Creates a new region whose upper-left corner is the specified Point, and whose width and height are both zero.
        Parameters:
        p - a Point that is the top left corner of the region
      • Region

        public Region​(java.awt.Point p,
                      java.awt.Dimension d)
        Creates a new region whose upper-left corner is specified by the Point argument, and whose width and height are specified by the Dimension argument.
        Parameters:
        p - a Point that is the upper-left corner of the region
        d - a Dimension, representing the width and height of the region
      • Region

        public Region​(int width,
                      int height)
        Creates a new region whose upper-left corner is at (0,0) in the coordinate space, and whose width and height are specified by the arguments of the same name.
        Parameters:
        width - the width of the region
        height - the height of the region
      • Region

        public Region​(int x,
                      int y,
                      int width,
                      int height)
        Creates a new region whose upper-left corner is specified as (x,y) and whose width and height are specified by the arguments of the same name.
        Parameters:
        x - the specified X coordinate
        y - the specified Y coordinate
        width - the width of the region
        height - the height of the region
      • Region

        public Region​(java.awt.Rectangle r)
        Creates a new region from the specified rectangle.
        Parameters:
        r - the rectangle to copy
      • Region

        public Region()
        Creates a new region whose upper-left corner is at (0, 0) in the coordinate space, and whose width and height are both zero.
    • Method Detail

      • setX2

        public void setX2​(int x2)
        Moves the right edge of the region to the specified x-coordinate by changing the width of the region.
        Parameters:
        x2 - the new x-coordinate for the right edge
      • getX2

        public int getX2()
        Returns the x-coordinate of the right edge of the region.
        Returns:
        the x-coordinate of the right edge
      • setY2

        public void setY2​(int y2)
        Moves the bottom edge of the region to the specified y-coordinate by changing the height of the region.
        Parameters:
        y2 - the new y-coordinate for the bottom edge
      • getY2

        public int getY2()
        Returns the y-coordinate of the bottom edge of the region.
        Returns:
        the y-coordinate of the bottom edge
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.awt.Rectangle