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.

Constructor Index

 o Area()
Initializes an empty bounding box with all coordinates zero.
 o Area(Area)
Construct a area from a given region.
 o Area(float, float, float, boolean, float, float, float, boolean)
Initializes a bounding box.
 o Area(float, float, float, float, float, float)
Initializes a bounding box.

Method Index

 o bounds()
Get upper and lower coordinates.
 o center()
Get the center of the area.
 o contains(Point)
Determine if a point intersects the area.
 o copy(Area)
Copy the given area into this area.
 o intersects(Area)
Determine if a area intersects an area.
 o mergeIntersect(Area)
Sets the area to be the intersection of itself with the given area.
 o mergeUnion(Area)
Sets the area to union of itself with the given area.
 o origin()
Get the origin of the area.
 o span(int)
Get the span of particular axis.
 o toString()
Returns a String that represents the value of this Object.
 o xDefined()
Determine whether the x dimension is defined..
 o yDefined()
Determine whether y dimension is defined.

Constructors

 o Area
  public Area()
Initializes an empty bounding box with all coordinates zero.
 o Area
  public Area(float x1,
              float y1,
              float xalign,
              float x2,
              float y2,
              float yalign)
Initializes a bounding box.
 o Area
  public Area(float x1,
              float y1,
              float xalign,
              boolean xDefined,
              float x2,
              float y2,
              float yalign,
              boolean yDefined)
Initializes a bounding box.
 o Area
  public Area(Area area)
Construct a area from a given region.

Methods

 o xDefined
  public boolean xDefined()
Determine whether the x dimension is defined..
 o yDefined
  public boolean yDefined()
Determine whether y dimension is defined.
 o contains
  public boolean contains(Point p)
Determine if a point intersects the area.
Parameters:
p - the point.
Returns:
true if there is an intersection.
 o intersects
  public boolean intersects(Area area)
Determine if a area intersects an area.
Parameters:
area - the area.
Returns:
true if there is an intersection.
 o 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.
 o 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.
 o mergeUnion
  public void mergeUnion(Area area)
Sets the area to union of itself with the given area. The origin of the area is unchanged.
 o bounds
  public Point[] bounds()
Get upper and lower coordinates.
Returns:
two points in an array.
 o center
  public Point center()
Get the center of the area.
 o origin
  public Point origin()
Get the origin of the area.
 o span
  public BoundingSpan span(int axis)
Get the span of particular axis.
Parameters:
axis - the axis. (xAxis or yAxis)
 o 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