|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel fr.lip6.sma.simulacion.app.map.MapPanel fr.lip6.sma.simulacion.app.map.MapComponentPanel
public class MapComponentPanel
Classe de base pour une carte où les joueurs sont présentés à l'aide de composants du type java.awt.Component. Ces composants doivent répondre à l'interface MapComponentItem.
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. |
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 | |
---|---|
MapComponentPanel(MapPanelListener inMapListener,
String inLocalAgentName)
Constructeur à partir du client et du nom de l'agent local. |
Method Summary | |
---|---|
void |
addAgentComponent(String inName,
MapComponentItem inAgentComponent)
Méthode appelée pour indiquer qu'un nouvel agent est arrivé. |
void |
clicked(MouseEvent inEvent,
String inAgentName)
Méthode appelée par les composants lors d'un clic. |
protected void |
doAddComponent(MapComponentItem inComponent)
Ajoute un composant. |
protected void |
doRemoveComponent(MapComponentItem inComponent)
Supprime un composant. |
MapComponentItem |
getAgentComponent(String inName)
Accesseur sur le composant d'un agent. |
void |
removeAgentComponent(String inName)
Méthode appelée pour supprimer un agent. |
protected void |
updateSelection(Set inSelectedAgents)
Méthode appelée lorsque la sélection a changé. |
Methods inherited from class fr.lip6.sma.simulacion.app.map.MapPanel |
---|
getAllowMultipleSelection, getLocalAgentName, getMapListener, getSelectedAgents, getSelectedAgentsSet, isAgentOnMap, selectAgent, selectAgents, setAllowMultipleSelection |
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 final Map mAgentsComponents
Constructor Detail |
---|
public MapComponentPanel(MapPanelListener inMapListener, String inLocalAgentName)
inMapListener
- référence sur le client.inLocalAgentName
- nom de l'agent local, null
si
l'agent local n'est pas sur la carte.Method Detail |
---|
public final MapComponentItem getAgentComponent(String inName)
inName
- nom de l'agent dont on veut le composant.
null
s'il n'est pas
sur la carte.public final void addAgentComponent(String inName, MapComponentItem inAgentComponent)
inName
- nom de l'agent à ajouter.inAgentComponent
- composant pour cet agent.public final void removeAgentComponent(String inName)
inName
- nom de l'agent à supprimer.protected final void updateSelection(Set inSelectedAgents)
updateSelection
in class MapPanel
inSelectedAgents
- la liste des noms des agents sélectionnés.
(le processus léger courant possède le
moniteur dessus).public final void clicked(MouseEvent inEvent, String inAgentName)
inEvent
- événement du clic.inAgentName
- nom de l'agent cliqué.protected void doAddComponent(MapComponentItem inComponent)
inComponent
- composant à ajouter.protected void doRemoveComponent(MapComponentItem inComponent)
inComponent
- composant à supprimer.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |