|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgizmoball.board.Gizmo
public abstract class Gizmo
This class represents a gizmo object, with methods to add triggers and call an action. Each gizmo has a shape object that can be accessed. The class is abstract so that subclasses can specify the action function themselves and determine the behavior of the gizmo.
| Field Summary | |
|---|---|
protected java.awt.Color |
color
|
protected java.util.ArrayList<Gizmo> |
connections
|
protected java.lang.String |
name
|
protected java.util.ArrayList<Gizmo> |
reverseConnections
|
| Constructor Summary | |
|---|---|
Gizmo()
|
|
| Method Summary | |
|---|---|
void |
action()
executes the action that this gizmo. |
java.awt.Color |
getColor()
returns the color of the gizmo. |
java.lang.String |
getName()
returns the name of the gizmo. |
Shape |
getShape()
returns the shape of the gizmo. |
java.util.List<Gizmo> |
getTriggeredGizmos()
returns a list of gizmos that this gizmo triggers. |
java.util.List<Gizmo> |
getTriggeringGizmos()
returns a list of gizmos that triggers this gizmo. |
void |
setColor(java.awt.Color color)
sets the color of the gizmo to the color specified. |
void |
triggerConnections(Ball b)
triggers all the gizmos that are connected to this gizmo. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.lang.String name
protected java.awt.Color color
protected java.util.ArrayList<Gizmo> connections
protected java.util.ArrayList<Gizmo> reverseConnections
| Constructor Detail |
|---|
public Gizmo()
| Method Detail |
|---|
public java.lang.String getName()
public void setColor(java.awt.Color color)
color - that the gizmo will havepublic java.awt.Color getColor()
public Shape getShape()
public java.util.List<Gizmo> getTriggeredGizmos()
public java.util.List<Gizmo> getTriggeringGizmos()
public void triggerConnections(Ball b)
b - the balls that triggers this gizmopublic void action()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||