public class ERectangle extends AbstractFixpRectangle implements java.io.Serializable
ERectangle
immutable class defines a point representing
defined by a location (x, y) and dimension (w x h).
This class is used in Electric database.
Modifier and Type | Field and Description |
---|---|
static ImmutableArrayList<ERectangle> |
EMPTY_LIST |
static ERectangle[] |
NULL_ARRAY |
static ERectangle |
ORIGIN |
Modifier and Type | Method and Description |
---|---|
ERectangle |
createFixp(long fixpMinX,
long fixpMinY,
long fixpMaxX,
long fixpMaxY) |
java.awt.geom.Rectangle2D |
createIntersection(java.awt.geom.Rectangle2D r) |
java.awt.geom.Rectangle2D |
createUnion(java.awt.geom.Rectangle2D r) |
static ERectangle |
fromFixp(long x,
long y,
long w,
long h)
Constructs and initializes a
ERectangle
from the specified long coordinates in fixed-point units. |
static ERectangle |
fromFixp(java.awt.geom.Rectangle2D r)
Returns
ERectangle from specified
Rectangle2D in fixed-point units
snapped to the grid. |
static ERectangle |
fromGrid(long x,
long y,
long w,
long h)
Constructs and initializes a
ERectangle
from the specified long coordinates in grid units. |
static ERectangle |
fromGrid(java.awt.geom.Rectangle2D r)
Returns
ERectangle from specified
Rectangle2D in grid units
snapped to the grid. |
static ERectangle |
fromLambda(double x,
double y,
double w,
double h)
Constructs and initializes a
ERectangle
from the specified long coordinates in lambda units. |
static ERectangle |
fromLambda(java.awt.geom.Rectangle2D r)
Returns
ERectangle from specified
Rectangle2D in lambda units
snapped to the grid. |
java.awt.geom.Rectangle2D |
getBounds2D() |
FixpCoord |
getCoordCenterX()
Returns the X coordinate of the center of this
ERectangle as FixpCoord object. |
FixpCoord |
getCoordCenterY()
Returns the Y coordinate of the center of this
ERectangle as FixpCoord object. |
ECoord |
getCoordHeight()
Returns the heigth of this
ERectangle as ECoord object. |
ECoord |
getCoordMaxX()
Returns the largest X coordinate of this
ERectangle as ECoord object. |
ECoord |
getCoordMaxY()
Returns the largest Y coordinate of this
ERectangle as ECoord object. |
ECoord |
getCoordMinX()
Returns the smallest X coordinate of this
ERectangle as ECoord object. |
ECoord |
getCoordMinY()
Returns the smallest Y coordinate of this
ERectangle as ECoord object. |
ECoord |
getCoordWidth()
Returns the width of this
ERectangle as ECoord object. |
long |
getFixpCenterX()
Returns the X coordinate of the center of this
ERectangle
in fixed-point units in
long precision. |
long |
getFixpCenterY()
Returns the Y coordinate of the center of this
ERectangle
in fixed-point units in
long precision. |
long |
getFixpHeight()
Returns the heigth of this
ERectangle
in fixed-point units in long precision. |
long |
getFixpMaxX()
Returns the largest X coordinate of this
ERectangle
in fixed-point units in
long precision. |
long |
getFixpMaxY()
Returns the largest Y coordinate of this
ERectangle
in fixed-point units in
long precision. |
long |
getFixpMinX()
Returns the smallest X coordinate of this
ERectangle
in fixed-point units in
long precision. |
long |
getFixpMinY()
Returns the smallest Y coordinate of this
ERectangle
in fixed-point units in
long precision. |
long |
getFixpWidth()
Returns the width of this
ERectangle
in fixed-point units in long precision. |
long |
getFixpX()
Returns the X coordinate of this
ERectangle
in fixed-point units in long precision. |
long |
getFixpY()
Returns the Y coordinate of this
ERectangle
in fixed-point units in long precision. |
double |
getGridCenterX()
Returns the X coordinate of the center of this
ERectangle
in grid units in
long precision. |
double |
getGridCenterY()
Returns the Y coordinate of the center of this
ERectangle
in grid units in
long precision. |
long |
getGridHeight()
Returns the heigth of this
ERectangle
in grid units in long precision. |
long |
getGridMaxX()
Returns the largest X coordinate of this
ERectangle
in grid units in
long precision. |
long |
getGridMaxY()
Returns the largest Y coordinate of this
ERectangle
in grid units in
long precision. |
long |
getGridMinX()
Returns the smallest X coordinate of this
ERectangle
in grid units in
long precision. |
long |
getGridMinY()
Returns the smallest Y coordinate of this
ERectangle
in grid units in
long precision. |
long |
getGridWidth()
Returns the width of this
ERectangle
in grid units in long precision. |
long |
getGridX()
Returns the X coordinate of this
ERectangle
in grid units in long precision. |
long |
getGridY()
Returns the Y coordinate of this
ERectangle
in grid units in long precision. |
boolean |
isEmpty() |
int |
outcode(double x,
double y) |
void |
setFixp(long fixpMinX,
long fixpMinY,
long fixpMaxX,
long fixpMaxY) |
void |
setRect(double x,
double y,
double w,
double h) |
add, getCenterX, getCenterY, getHeight, getLambdaCenterX, getLambdaCenterY, getLambdaHeight, getLambdaMaxX, getLambdaMaxY, getLambdaMinX, getLambdaMinY, getLambdaWidth, getLambdaX, getLambdaY, getMaxX, getMaxY, getMinX, getMinY, getWidth, getX, getY, setRect, toString
add, add, contains, contains, equals, getPathIterator, getPathIterator, hashCode, intersect, intersects, intersectsLine, intersectsLine, outcode, setFrame, union
public static final ERectangle ORIGIN
public static final ERectangle[] NULL_ARRAY
public static final ImmutableArrayList<ERectangle> EMPTY_LIST
public static ERectangle fromLambda(double x, double y, double w, double h)
ERectangle
from the specified long coordinates in lambda units.x
- the X coordinates of the upper left corner
of the newly constructed ERectangle
y
- the Y coordinates of the upper left corner
of the newly constructed ERectangle
w
- the width of the newly constructed ERectangle
h
- the height of the newly constructed ERectangle
public static ERectangle fromFixp(long x, long y, long w, long h)
ERectangle
from the specified long coordinates in fixed-point units.x
- the X coordinates of the upper left corner
of the newly constructed ERectangle
y
- the Y coordinates of the upper left corner
of the newly constructed ERectangle
w
- the width of the newly constructed ERectangle
h
- the height of the newly constructed ERectangle
public static ERectangle fromGrid(long x, long y, long w, long h)
ERectangle
from the specified long coordinates in grid units.x
- the X coordinates of the upper left corner
of the newly constructed ERectangle
y
- the Y coordinates of the upper left corner
of the newly constructed ERectangle
w
- the width of the newly constructed ERectangle
h
- the height of the newly constructed ERectangle
public static ERectangle fromLambda(java.awt.geom.Rectangle2D r)
ERectangle
from specified
Rectangle2D
in lambda units
snapped to the grid.r
- specified ERectanglepublic static ERectangle fromFixp(java.awt.geom.Rectangle2D r)
ERectangle
from specified
Rectangle2D
in fixed-point units
snapped to the grid.r
- specified ERectanglepublic static ERectangle fromGrid(java.awt.geom.Rectangle2D r)
ERectangle
from specified
Rectangle2D
in grid units
snapped to the grid.r
- specified ERectanglepublic ECoord getCoordWidth()
ERectangle
as ECoord object.getCoordWidth
in class AbstractFixpRectangle
ERectangle
as ECoord object.public ECoord getCoordHeight()
ERectangle
as ECoord object.getCoordHeight
in class AbstractFixpRectangle
ERectangle
as ECoord object.public ECoord getCoordMinX()
ERectangle
as ECoord object.getCoordMinX
in class AbstractFixpRectangle
ERectangle
as ECoord object.public ECoord getCoordMinY()
ERectangle
as ECoord object.getCoordMinY
in class AbstractFixpRectangle
ERectangle
as ECoord object.public ECoord getCoordMaxX()
ERectangle
as ECoord object.getCoordMaxX
in class AbstractFixpRectangle
ERectangle
as ECoord object.public ECoord getCoordMaxY()
ERectangle
as ECoord object.getCoordMaxY
in class AbstractFixpRectangle
ERectangle
as ECoord object.public FixpCoord getCoordCenterX()
ERectangle
as FixpCoord object.getCoordCenterX
in class AbstractFixpRectangle
ERectangle
object's center.public FixpCoord getCoordCenterY()
ERectangle
as FixpCoord object.getCoordCenterY
in class AbstractFixpRectangle
ERectangle
object's center.public long getFixpX()
ERectangle
in fixed-point units in long precision.getFixpX
in class AbstractFixpRectangle
ERectangle
.public long getFixpY()
ERectangle
in fixed-point units in long precision.getFixpY
in class AbstractFixpRectangle
ERectangle
.public long getFixpWidth()
ERectangle
in fixed-point units in long precision.getFixpWidth
in class AbstractFixpRectangle
ERectangle
.public long getFixpHeight()
ERectangle
in fixed-point units in long precision.getFixpHeight
in class AbstractFixpRectangle
ERectangle
.public long getFixpMinX()
ERectangle
in fixed-point units in
long
precision.getFixpMinX
in class AbstractFixpRectangle
ERectangle
.public long getFixpMinY()
ERectangle
in fixed-point units in
long
precision.getFixpMinY
in class AbstractFixpRectangle
ERectangle
.public long getFixpMaxX()
ERectangle
in fixed-point units in
long
precision.getFixpMaxX
in class AbstractFixpRectangle
ERectangle
.public long getFixpMaxY()
ERectangle
in fixed-point units in
long
precision.getFixpMaxY
in class AbstractFixpRectangle
ERectangle
.public long getFixpCenterX()
ERectangle
in fixed-point units in
long
precision.getFixpCenterX
in class AbstractFixpRectangle
ERectangle
object's center.public long getFixpCenterY()
ERectangle
in fixed-point units in
long
precision.getFixpCenterY
in class AbstractFixpRectangle
ERectangle
object's center.public long getGridX()
ERectangle
in grid units in long precision.ERectangle
.public long getGridY()
ERectangle
in grid units in long precision.ERectangle
.public long getGridWidth()
ERectangle
in grid units in long precision.ERectangle
.public long getGridHeight()
ERectangle
in grid units in long precision.ERectangle
.public long getGridMinX()
ERectangle
in grid units in
long
precision.ERectangle
.public long getGridMinY()
ERectangle
in grid units in
long
precision.ERectangle
.public long getGridMaxX()
ERectangle
in grid units in
long
precision.ERectangle
.public long getGridMaxY()
ERectangle
in grid units in
long
precision.ERectangle
.public double getGridCenterX()
ERectangle
in grid units in
long
precision.ERectangle
object's center.public double getGridCenterY()
ERectangle
in grid units in
long
precision.ERectangle
object's center.public boolean isEmpty()
isEmpty
in class AbstractFixpRectangle
public void setRect(double x, double y, double w, double h)
setRect
in class AbstractFixpRectangle
public void setFixp(long fixpMinX, long fixpMinY, long fixpMaxX, long fixpMaxY)
setFixp
in class AbstractFixpRectangle
public ERectangle createFixp(long fixpMinX, long fixpMinY, long fixpMaxX, long fixpMaxY)
createFixp
in class AbstractFixpRectangle
public int outcode(double x, double y)
outcode
in class AbstractFixpRectangle
public java.awt.geom.Rectangle2D getBounds2D()
getBounds2D
in interface java.awt.Shape
getBounds2D
in class java.awt.geom.Rectangle2D
public java.awt.geom.Rectangle2D createIntersection(java.awt.geom.Rectangle2D r)
createIntersection
in class AbstractFixpRectangle
public java.awt.geom.Rectangle2D createUnion(java.awt.geom.Rectangle2D r)
createUnion
in class AbstractFixpRectangle