|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwheelsunh.etc.AbstractGraphic
wheelsunh.users.AbstractShape
public abstract class AbstractShape
AbstractShape: an abstract superclass for Shape and ShapeGroup. Mostly for proper design hierarchy; it also means that a ShapeGroup can contain ShapeGroups. unh addition
| Field Summary | |
|---|---|
protected double |
_rot
|
| Constructor Summary | |
|---|---|
AbstractShape()
Default constructor - does nothing but check that a Frame has been created! UNH addition: 11/14/09 rdb |
|
| Method Summary | |
|---|---|
boolean |
boundsIntersects(AbstractShape s)
Intersect the bounds of this object with the argument. |
protected java.awt.Point |
center()
convenience method to get the center of Shape |
protected static double |
distance(java.awt.Point p1,
java.awt.Point p2)
convenience static method to compute distance between 2 points |
abstract java.awt.Rectangle |
getBounds()
|
java.awt.Point |
getCenter()
Returns the center of this Shape. |
int |
getCenterX()
Returns the X-coordinate of this Shape's center. |
int |
getCenterY()
Returns the Y-coordinate of this Shape's center. |
abstract int |
getHeight()
|
protected java.awt.Point |
getIntersection(java.awt.Point start,
double angle,
AbstractShape s)
getIntersection: get the intersection of the line starting at start with angle ( radians ) with the AbstractShape s Return the Point of intersection with the "wall" of the Frame if not found, or the point of intersection with the bounding box of s if found intersection() exploits this for shape-specific distances |
abstract java.awt.Point |
getLocation()
Returns the object's location. |
abstract int |
getRotation()
Returns the object's rotation in degrees. |
abstract int |
getWidth()
|
abstract int |
getXLocation()
Returns the object's x location. |
abstract int |
getYLocation()
Returns the object's y location. |
int |
intersects(AbstractShape s)
Generic AbstractShape handler Same as rectangle; exists for weird things that aren't the standard Shapes and for use in ShapeGroup's handler |
int |
intersects(ShapeGroup s)
ShapeGroup intersection handler Calls intersects() for each AbstractShape in the group and returns the closest. |
void |
setCenter(java.awt.Point p)
Moves this Shape so that its center is at p. |
void |
setLocation(int x,
int y)
Set object's location to given coordinates. |
abstract void |
setLocation(java.awt.Point p)
Set object's location to given point. |
abstract void |
setRotation(int d)
Sets the object's rotation in degrees. |
| Methods inherited from class wheelsunh.etc.AbstractGraphic |
|---|
mouseClicked, mouseDragged, mousePressed, mouseReleased |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface wheelsunh.etc.CustomGraphic |
|---|
contains, paint |
| Field Detail |
|---|
protected double _rot
| Constructor Detail |
|---|
public AbstractShape()
| Method Detail |
|---|
public void setLocation(int x,
int y)
setLocation in interface Locatablepublic abstract void setLocation(java.awt.Point p)
Locatable
setLocation in interface Locatablepublic abstract java.awt.Rectangle getBounds()
public abstract int getXLocation()
Locatable
getXLocation in interface Locatablepublic abstract int getYLocation()
Locatable
getYLocation in interface Locatablepublic abstract int getWidth()
public abstract int getHeight()
public abstract java.awt.Point getLocation()
Locatable
getLocation in interface Locatablepublic abstract void setRotation(int d)
Rotatable
setRotation in interface Rotatablepublic abstract int getRotation()
Rotatable
getRotation in interface Rotatablepublic java.awt.Point getCenter()
public void setCenter(java.awt.Point p)
public int getCenterX()
public int getCenterY()
public boolean boundsIntersects(AbstractShape s)
public int intersects(AbstractShape s)
public int intersects(ShapeGroup s)
protected java.awt.Point getIntersection(java.awt.Point start,
double angle,
AbstractShape s)
protected static final double distance(java.awt.Point p1,
java.awt.Point p2)
protected final java.awt.Point center()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||