ncsa.j3d.ui.events
Class CollisionEvent
java.lang.Object
|
+--java.util.EventObject
|
+--ncsa.j3d.ui.events.CollisionEvent
- public class CollisionEvent
- extends java.util.EventObject
This class describes and reports a collision.
It is designed to use the final members of this class to describe this
event. But could use the values from a derived class or even an ad
hoc method.
The notion of a code is an abstract identifier that uniquely describes
the type of collision event(example: COLLISION_START). There are
some default codes provided for use in this file.
- See Also:
- Serialized Form
Constructor Summary |
CollisionEvent(java.lang.Object source)
Constructs a collision event with the source of the event. |
CollisionEvent(java.lang.Object source,
int code)
Constructs a collision event with the source and id code of the event. |
Method Summary |
int |
getCode()
Gets the code of this event. |
void |
setCode(int code)
Sets the code of this event. |
java.lang.String |
toString()
Describes this object. |
Methods inherited from class java.util.EventObject |
getSource |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
COLLISION_NOTSET
public static final int COLLISION_NOTSET
COLLISION_START
public static final int COLLISION_START
COLLISION_CONTINUE
public static final int COLLISION_CONTINUE
COLLISION_STOP
public static final int COLLISION_STOP
CollisionEvent
public CollisionEvent(java.lang.Object source)
- Constructs a collision event with the source of the event.
- Parameters:
source
- The object which detected the collision.
CollisionEvent
public CollisionEvent(java.lang.Object source,
int code)
- Constructs a collision event with the source and id code of the event.
- Parameters:
source
- The originator of the event.code
- An int describing the event (should be one of the final
members of this class or derived class).
setCode
public void setCode(int code)
- Sets the code of this event.
- Parameters:
code
- The new code.
getCode
public int getCode()
- Gets the code of this event.
- Returns:
- int The code.
toString
public java.lang.String toString()
- Describes this object.
- Overrides:
- toString in class java.util.EventObject
- Returns:
- String A description.
NCSA Portfolio, Copyright 1997-1999, National Center for Supercomputing Applications, University of Illinois Urbana-Champaign, All Rights Reserved