com.jpemartin.jgt
Class VisibleObject

java.lang.Object
  extended by java.awt.geom.RectangularShape
      extended by java.awt.geom.Rectangle2D
          extended by java.awt.Rectangle
              extended by com.jpemartin.jgt.VisibleObject
All Implemented Interfaces:
java.awt.Shape, java.io.Serializable, java.lang.Cloneable

public abstract class VisibleObject
extends java.awt.Rectangle

The base class for stuff that's visible on-screen and has a notion of position that we can change.

Author:
jpmartin
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.geom.Rectangle2D
java.awt.geom.Rectangle2D.Double, java.awt.geom.Rectangle2D.Float
 
Field Summary
 boolean _alive
          setting this to false is a hint to the application to remove this object and stop calling draw()
 
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
VisibleObject()
           
 
Method Summary
abstract  void draw(java.awt.Graphics g)
          draw us on the given Graphics *
abstract  void move()
          update the position of the object and anything else that changes every turn
 
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, toString, 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
 

Field Detail

_alive

public boolean _alive
setting this to false is a hint to the application to remove this object and stop calling draw()

Constructor Detail

VisibleObject

public VisibleObject()
Method Detail

move

public abstract void move()
update the position of the object and anything else that changes every turn


draw

public abstract void draw(java.awt.Graphics g)
draw us on the given Graphics *