|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
fr.lip6.sma.simulacion.app.map.MapCell
public abstract class MapCell
This GUI component represents one cell where agents can be situated on the game application map. Basically, a map using the MapMultiCellPanel is a mesh of MapCell classes. This highest level implementation of the cell just maintains the number of agents it contains. It monitors the access to the number of agents.
MapMultiCellPanel,
Serialized Form| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
private Map |
mAgentsComponents
Tableau avec les éléments pour chacun des agents. |
private int |
mXcoordinate
X coordinate of the cell |
private int |
mYcoordinate
Y coordinate of the cell |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
MapCell(MapMultiCellModel inModel,
int inXcoord,
int inYcoord)
Constructor of a MapCell. |
|
| Method Summary | |
|---|---|
abstract void |
addAgent(String inAgentName,
boolean inIsLocalAgent,
int inShapeTypeID,
Color inColor)
Add an agent to the cell. |
protected void |
addAgentComponent(String inAgentName,
MapComponentItem inComponent)
Add an agent component to the set. |
protected Iterator |
agentComponentsIterator()
Get an iterator on the agent components. |
protected int |
countAgentComponents()
Return the number of agent components. |
protected MapComponentItem |
getAgentComponent(String inAgentName)
Get an agent component. |
int |
getXcoordinate()
Returns the X coordinate of the cell. |
int |
getYcoordinate()
Returns the Y coordinate of the cell. |
abstract boolean |
removeAgent(String inAgentName)
Remove an agent from on the cell. |
protected void |
removeAgentComponent(String inAgentName)
Remove an agent component. |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private int mXcoordinate
private int mYcoordinate
private final Map mAgentsComponents
| Constructor Detail |
|---|
public MapCell(MapMultiCellModel inModel,
int inXcoord,
int inYcoord)
inModel - modèle du jeu.inXcoord - X coordinate of the cell.inYcoord - Y coordinate of the cell.| Method Detail |
|---|
public final int getXcoordinate()
public final int getYcoordinate()
protected final int countAgentComponents()
protected final Iterator agentComponentsIterator()
protected final void addAgentComponent(String inAgentName,
MapComponentItem inComponent)
inAgentName - name of the agent's component.inComponent - the component.protected final MapComponentItem getAgentComponent(String inAgentName)
inAgentName - name of the agent's component.
nullprotected final void removeAgentComponent(String inAgentName)
inAgentName - name of the agent's component to remove.
public abstract void addAgent(String inAgentName,
boolean inIsLocalAgent,
int inShapeTypeID,
Color inColor)
inAgentName - Name of the agent to add.inIsLocalAgent - Is it the local agent?inShapeTypeID - id of the shape.inColor - color of the agent.public abstract boolean removeAgent(String inAgentName)
inAgentName - name of the agent to remove
true if the operation was successful,
false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||