|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.gameEngine.game.GameRelatedObject
vooga.gameEngine.item.GameItem
vooga.gameEngine.item.BoundedItem
public class BoundedItem
Represents an item that is always updated to know the current boundaries of
of a given Tangible
item.
Constructor Summary | |
---|---|
BoundedItem(Texture t,
Tangible b)
Constructor for creating a BoundedItem . |
Method Summary | |
---|---|
protected java.awt.geom.Rectangle2D |
getRectangularBoundaries()
Method for getting the current rectangular boundaries associated with the BoundedItem . |
protected java.awt.Shape |
getShapeBoundaries()
Method for getting the current boundaries associated with the BoundedItem . |
void |
positionChanged(PositionChangedEvent e)
This is called whenever a Tangible object updates its position. |
void |
rotationChanged(RotationChangedEvent e)
This is called whenever a Tangible object changes its rotation. |
void |
sizeChanged(SizeChangedEvent e)
This is called whenever a Tangible object updates its position. |
Methods inherited from class vooga.gameEngine.item.GameItem |
---|
compareTo, getPosition, getRotation, getShape, getSize, getTexture, isVisible, move, resize, rotate, setPosition, setRotation, setSize, setVisibility |
Methods inherited from class vooga.gameEngine.game.GameRelatedObject |
---|
addEventListener, clearListeners, equals, fire, fire, fire, getEventListeners, getID, getListenerCount, removeEventListener |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BoundedItem(Texture t, Tangible b)
BoundedItem
. Automatically adds
this item as a listener to the supplied Tangible
item if it is a
GameRelatedObject
.
t
- is the Texture
to represent this item on screenb
- is the Tangible
item that this object will know
the bounds ofMethod Detail |
---|
protected java.awt.geom.Rectangle2D getRectangularBoundaries()
BoundedItem
. This is equivalent of calling
getShape().getBounds2D()
.
Rectangle2D
representing the boundaries of what is
bounding this item in terms of the game's coordinate systemprotected java.awt.Shape getShapeBoundaries()
BoundedItem
. These boundaries are very precise and represent
the exact Shape
associated with the object bounding this one.
Shape
representing the boundaries of what is
bounding this item in terms of the game's coordinate systempublic void positionChanged(PositionChangedEvent e)
PositionChangeListener
Tangible
object updates its position.
positionChanged
in interface PositionChangeListener
e
- the PositionChangedEvent
public void rotationChanged(RotationChangedEvent e)
RotationChangeListener
Tangible
object changes its rotation.
rotationChanged
in interface RotationChangeListener
e
- the RotationChangedEvent
public void sizeChanged(SizeChangedEvent e)
SizeChangeListener
Tangible
object updates its position.
sizeChanged
in interface SizeChangeListener
e
- the PositionChangedEvent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |