|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.cast.builder.BuilderModel
public class BuilderModel
The builder model represents the current state of the character the user is building.
| Field Summary | |
|---|---|
protected ArrayList<ComponentClass> |
_classes
The list of all available component classes. |
protected HashMap<ComponentClass,ArrayList<Integer>> |
_components
The hashtable of available component ids for each class. |
protected ArrayList<BuilderModelListener> |
_listeners
The model listeners. |
protected HashMap<ComponentClass,Integer> |
_selected
The currently selected character components. |
| Constructor Summary | |
|---|---|
BuilderModel(ComponentRepository crepo)
Constructs a builder model. |
|
| Method Summary | |
|---|---|
void |
addListener(BuilderModelListener l)
Adds a builder model listener. |
protected void |
gatherComponentInfo(ComponentRepository crepo)
Gathers component class and component information from the character manager for later reference by others. |
List<ComponentClass> |
getComponentClasses()
Returns a list of the available component classes. |
List<Integer> |
getComponents(ComponentClass cclass)
Returns the list of components available in the specified class. |
int[] |
getSelectedComponents()
Returns the selected components in an array. |
protected void |
notifyListeners(int event)
Notifies all model listeners that the builder model has changed. |
void |
setSelectedComponent(ComponentClass cclass,
int cid)
Sets the selected component for the given component class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected HashMap<ComponentClass,Integer> _selected
protected HashMap<ComponentClass,ArrayList<Integer>> _components
protected ArrayList<ComponentClass> _classes
protected ArrayList<BuilderModelListener> _listeners
| Constructor Detail |
|---|
public BuilderModel(ComponentRepository crepo)
| Method Detail |
|---|
public void addListener(BuilderModelListener l)
l - the listener.protected void notifyListeners(int event)
public List<ComponentClass> getComponentClasses()
public List<Integer> getComponents(ComponentClass cclass)
public int[] getSelectedComponents()
public void setSelectedComponent(ComponentClass cclass,
int cid)
protected void gatherComponentInfo(ComponentRepository crepo)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||