Class sgraphics.Area
All Packages Class Hierarchy This Package Previous Next Index
Class sgraphics.Area
java.lang.Object
|
+----java.util.Observable
|
+----sgraphics.Area
- public class Area
- extends Observable
- implements Axis
A area is a two dimensional area.
-
Area()
- Initializes an empty bounding box with all coordinates zero.
-
Area(Area)
- Construct a area from a given region.
-
Area(float, float, float, boolean, float, float, float, boolean)
- Initializes a bounding box.
-
Area(float, float, float, float, float, float)
- Initializes a bounding box.
-
bounds()
- Get upper and lower coordinates.
-
center()
- Get the center of the area.
-
contains(Point)
- Determine if a point intersects the area.
-
copy(Area)
- Copy the given area into this area.
-
intersects(Area)
- Determine if a area intersects an area.
-
mergeIntersect(Area)
- Sets the area to be the intersection of itself with the
given area.
-
mergeUnion(Area)
- Sets the area to union of itself with the
given area.
-
origin()
- Get the origin of the area.
-
span(int)
- Get the span of particular axis.
-
toString()
- Returns a String that represents the value of this Object.
-
xDefined()
- Determine whether the x dimension is defined..
-
yDefined()
- Determine whether y dimension is defined.
Area
public Area()
- Initializes an empty bounding box with all coordinates zero.
Area
public Area(float x1,
float y1,
float xalign,
float x2,
float y2,
float yalign)
- Initializes a bounding box.
Area
public Area(float x1,
float y1,
float xalign,
boolean xDefined,
float x2,
float y2,
float yalign,
boolean yDefined)
- Initializes a bounding box.
Area
public Area(Area area)
- Construct a area from a given region.
xDefined
public boolean xDefined()
- Determine whether the x dimension is defined..
yDefined
public boolean yDefined()
- Determine whether y dimension is defined.
contains
public boolean contains(Point p)
- Determine if a point intersects the area.
- Parameters:
- p - the point.
- Returns:
- true if there is an intersection.
intersects
public boolean intersects(Area area)
- Determine if a area intersects an area.
- Parameters:
- area - the area.
- Returns:
- true if there is an intersection.
copy
public void copy(Area area)
- Copy the given area into this area. This operation
is equivalent to setting this area to the empty area and
then calling mergeUnion on the given area.
mergeIntersect
public void mergeIntersect(Area area)
- Sets the area to be the intersection of itself with the
given area. The origin of the area is unchanged.
mergeUnion
public void mergeUnion(Area area)
- Sets the area to union of itself with the
given area. The origin of the area is unchanged.
bounds
public Point[] bounds()
- Get upper and lower coordinates.
- Returns:
- two points in an array.
center
public Point center()
- Get the center of the area.
origin
public Point origin()
- Get the origin of the area.
span
public BoundingSpan span(int axis)
- Get the span of particular axis.
- Parameters:
- axis - the axis. (xAxis or yAxis)
toString
public String toString()
- Returns a String that represents the value of this Object.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index