|
||||||||||
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.MapPanel
fr.lip6.sma.simulacion.app.map.MapRegionPanel
public abstract class MapRegionPanel
Classe de base pour une carte où les joueurs sont présentés dans des régions rectangulaires fixes.
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 |
mAgentsLocations
Tableau avec les coordonées des agents. |
private Map |
mAgentsRects
Tableau avec les rectangles de chacun des agents (maison et tout ce qui est dessiné qui leur appartient). |
private Configuration |
mConfiguration
Référence sur la configuration globale. |
private Point |
mLocalAgentLocation
Position de l'agent local sur la carte, null si l'agent
local n'est pas sur la carte. |
private Rectangle |
mLocalAgentRect
Rectangle de l'agent local. |
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 | |
---|---|
protected |
MapRegionPanel(MapPanelListener inMapListener,
Configuration inConfiguration)
Constructeur à partir d'un gestionnaire et de la configuration globale. |
protected |
MapRegionPanel(MapPanelListener inMapListener,
Configuration inConfiguration,
String inLocalAgentName)
Constructeur à partir d'un gestionnaire et des coordonnées de l'agent local. |
Method Summary | |
---|---|
void |
addAgent(String inName)
Méthode appelée pour indiquer qu'un nouvel agent est arrivé. |
Map |
getAgentsLocations()
Accesseur sur les positions des agents. |
Map |
getAgentsRects()
Accesseur sur les rectangles des agents. |
protected Configuration |
getConfiguration()
Accesseur sur la configuration globale. |
private String |
getHouseOwnerName(Point inPoint)
Méthode pour récupérer le nom de l'agent à qui appartient la maison sous un point donné. |
Point |
getLocalAgentLocation()
Accesseur sur la position de l'agent local. |
Rectangle |
getLocalAgentRect()
Accesseur sur le rectangle de l'agent local. |
static Point |
getLocationFromString(String inLocationProperty)
Détermine la position à partir d'une chaîne. |
String |
getToolTipText(MouseEvent inEvent)
Méthode pour afficher une bulle d'aide. |
abstract void |
paintComponent(Graphics inGraphics)
Dessine le composant. |
private void |
processClick(MouseEvent inEvent)
Méthode pour gérer les clics dans la carte. |
void |
removeAgent(String inName)
Méthode appelée pour supprimer un agent. |
void |
setLocalAgentRect(Rectangle inLocalAgentRect)
Sélecteur sur le rectangle de l'agent local. |
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 Configuration mConfiguration
private final Point mLocalAgentLocation
null
si l'agent
local n'est pas sur la carte.
private final Map mAgentsLocations
private final Map mAgentsRects
private Rectangle mLocalAgentRect
null
tant qu'il n'a pas été calculé (il l'est lorsqu'on
dessine tout) ou si l'agent local n'est pas sur la carte.
Constructor Detail |
---|
protected MapRegionPanel(MapPanelListener inMapListener, Configuration inConfiguration)
inMapListener
- référence sur le gestionnaireinConfiguration
- configuration globaleprotected MapRegionPanel(MapPanelListener inMapListener, Configuration inConfiguration, String inLocalAgentName)
inMapListener
- référence sur le gestionnaireinConfiguration
- configuration globaleinLocalAgentName
- nom de l'agent local, null
si
l'agent local n'est pas sur la carte.Method Detail |
---|
protected final Configuration getConfiguration()
public final Map getAgentsLocations()
public final Map getAgentsRects()
public final Point getLocalAgentLocation()
public final Rectangle getLocalAgentRect()
public final void setLocalAgentRect(Rectangle inLocalAgentRect)
inLocalAgentRect
- le rectangle de l'agent local.public abstract void paintComponent(Graphics inGraphics)
paintComponent
in class JComponent
inGraphics
- interface pour dessiner la carte.public void addAgent(String inName)
inName
- nom de l'agent à ajouter.public void removeAgent(String inName)
inName
- nom de l'agent à supprimerpublic final String getToolTipText(MouseEvent inEvent)
getToolTipText
in class JComponent
inEvent
- l'événement de la souris (permettant de savoir où elle
est)
null
si aucune
bulle ne doit être affichée)private String getHouseOwnerName(Point inPoint)
inPoint
- point à tester.
null
si aucune maison est sous
la souris.private void processClick(MouseEvent inEvent)
inEvent
- événement du clic.public static Point getLocationFromString(String inLocationProperty)
inLocationProperty
- chaîne pour la position
(dans le fichier XML)
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).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |