DE.purple_sunshine.bigbro
Class Area

java.lang.Object
  |
  +--java.awt.geom.RectangularShape
        |
        +--java.awt.geom.Rectangle2D
              |
              +--java.awt.Rectangle
                    |
                    +--DE.purple_sunshine.bigbro.Area
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, java.awt.Shape
Direct Known Subclasses:
PathArea

public class Area
extends java.awt.Rectangle

An Area within a house. The inhabitants move from one area to another through the areas that are in between. The positions inside the areas are randomly generated with a preference of the center.

Since:
JDK1.1
Version:
1.0
Author:
Holger Wagner
See Also:
Serialized Form

Inner classes inherited from class java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float
 
Fields inherited from class java.awt.Rectangle
height, width, x, y
 
Fields inherited from class java.awt.geom.Rectangle2D
OUT_BOTTOM, OUT_LEFT, OUT_RIGHT, OUT_TOP
 
Constructor Summary
Area(java.lang.String id, int x, int y, int width, int height)
          Constructs a new Area.
Area(java.lang.String id, int x, int y, int width, int height, PathArea pA)
          Constructs a new Area that contains a PathArea.
 
Method Summary
 java.lang.String getId()
          Returns the ID of this Area.
 PathArea getPathArea()
          Returns the PathArea contained in this Area.
 java.awt.Point randomPointWithin()
          Generates a random point within this Area and returns it.
 java.lang.String toString()
          Returns a String representation of this Area.
 
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
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.Shape
contains, contains, contains, contains, getPathIterator, getPathIterator, intersects, intersects
 

Constructor Detail

Area

public Area(java.lang.String id,
            int x,
            int y,
            int width,
            int height)
Constructs a new Area.
Parameters:
id - a unique identifier for the constructed area
x - the x-value of the top left corner of the area
y - the y-value of the top left corner of the area
width - the width of the area
height - the height of the area

Area

public Area(java.lang.String id,
            int x,
            int y,
            int width,
            int height,
            PathArea pA)
Constructs a new Area that contains a PathArea.
Parameters:
id - a unique identifier for the constructed area
x - the x-value of the top left corner of the area
y - the y-value of the top left corner of the area
width - the width of the area
height - the height of the area
pA - the PathArea which is contained in this Area
Method Detail

getPathArea

public PathArea getPathArea()
Returns the PathArea contained in this Area.
Returns:
the PathArea contained in this Area

getId

public java.lang.String getId()
Returns the ID of this Area.
Returns:
the ID of this Area

randomPointWithin

public java.awt.Point randomPointWithin()
Generates a random point within this Area and returns it. The point is generated with a preference to centered positions.
Returns:
a random point within this Area

toString

public java.lang.String toString()
Returns a String representation of this Area.
Overrides:
toString in class java.awt.Rectangle
Returns:
a String in the form of Area[id, x, y, width, height]


© 2000, Holger Wagner, Purple Sunshine Productions.