|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.geom.RectangularShape
java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double
att.grappa.GrappaBox
public class GrappaBox
This class extends java.awt.geom.Rectangle2D.Double and provides built-in string-to-Rectangle2D and Rectangle2D-to-string conversions suitable for Grappa.
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 | |
---|---|
private boolean |
dimensioned
|
private static long |
serialVersionUID
|
Fields inherited from class java.awt.geom.Rectangle2D.Double |
---|
height, width, x, y |
Fields inherited from class java.awt.geom.Rectangle2D |
---|
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP |
Constructor Summary | |
---|---|
GrappaBox()
Constructs and initializes a GrappaBox with
upper-left coordinates (0, 0) and zero width and height. |
|
GrappaBox(double x,
double y,
double width,
double height)
Constructs and initializes a GrappaBox with the
specified coordinates. |
|
GrappaBox(java.awt.geom.Rectangle2D r)
Constructs and initializes a GrappaBox from a
Rectangle2D |
|
GrappaBox(java.lang.String coordString)
Constructs and initializes a GrappaBox with the
coordinates derived from the specified String representation. |
|
GrappaBox(java.lang.String coordString,
boolean dimensioned)
Constructs and initializes a GrappaBox with the
coordinates derived from the specified String representation. |
Method Summary | |
---|---|
boolean |
isDimensioned()
Returns true if the String format will be "x1,x2,width,height" or false if the format will be "x1,y1,x2,y2". |
java.lang.String |
toAttributeString()
Provides a string representation of this object consistent with Grappa attributes. |
java.lang.String |
toFormattedString(java.lang.String format)
Provides a formatted string representation of this object. |
java.lang.String |
toString()
Provides a generic string representation of this object. |
Methods inherited from class java.awt.geom.Rectangle2D.Double |
---|
createIntersection, createUnion, getBounds2D, getHeight, getWidth, getX, getY, isEmpty, outcode, setRect, setRect |
Methods inherited from class java.awt.geom.Rectangle2D |
---|
add, add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union |
Methods inherited from class java.awt.geom.RectangularShape |
---|
clone, contains, contains, getBounds, 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 |
Field Detail |
---|
private static final long serialVersionUID
private boolean dimensioned
Constructor Detail |
---|
public GrappaBox()
GrappaBox
with
upper-left coordinates (0, 0) and zero width and height.
public GrappaBox(java.awt.geom.Rectangle2D r)
GrappaBox
from a
Rectangle2D
r
- the rectangle defining the box (1-to-1 correspondence)public GrappaBox(double x, double y, double width, double height)
GrappaBox
with the
specified coordinates.
x, y
- the upper-left position coordinates of the boxwidth, height
- the size of the boxpublic GrappaBox(java.lang.String coordString, boolean dimensioned)
GrappaBox
with the
coordinates derived from the specified String representation.
When the dimensioned parameter is true, then the String
format should be:
"x-coord,y-coord,width,height"
otherwise it should be:
"x1-coord,y1-coord,x2-coord,y2-coord"
coordString
- String representing the coordinates to which to
set the newly constructed GrappaBox
dimensioned
- a boolean indicating the format of the stringpublic GrappaBox(java.lang.String coordString)
GrappaBox
with the
coordinates derived from the specified String representation.
The String format should be: "x-coord,y-coord,width,height""
coordString
- String representing the coordinates to which to
set the newly constructed GrappaBox
Method Detail |
---|
public java.lang.String toAttributeString()
public java.lang.String toFormattedString(java.lang.String format)
format
- the format used to build the string (%b is the base directive for a GrappaBox).
public java.lang.String toString()
toString
in class java.awt.geom.Rectangle2D.Double
public boolean isDimensioned()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |