Package resources
Class Settings.Region
- java.lang.Object
-
- java.awt.geom.RectangularShape
-
- java.awt.geom.Rectangle2D
-
- java.awt.Rectangle
-
- resources.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 specializedRectangle
that is more easily converted to or from a setting value.- See Also:
- Serialized Form
-
-
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 theDimension
argument.Region(java.awt.Point p)
Creates a new region whose upper-left corner is the specifiedPoint
, 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 thePoint
argument, and whose width and height are specified by theDimension
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
-
-
-
-
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 theDimension
argument.- Parameters:
d
- aDimension
, specifying width and height
-
Region
public Region(java.awt.Point p)
Creates a new region whose upper-left corner is the specifiedPoint
, and whose width and height are both zero.- Parameters:
p
- aPoint
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 thePoint
argument, and whose width and height are specified by theDimension
argument.- Parameters:
p
- aPoint
that is the upper-left corner of the regiond
- aDimension
, 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 regionheight
- 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 coordinatey
- the specified Y coordinatewidth
- the width of the regionheight
- 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 classjava.awt.Rectangle
-
-