20 package net.sf.gridarta.gui.panel.selectedsquare;
27 import org.jetbrains.annotations.NotNull;
28 import org.jetbrains.annotations.Nullable;
79 listenerList.
add(listener);
87 listenerList.
remove(listener);
95 final G head = gameObject == null ? null : gameObject.getHead();
97 listener.selectionChanged(selectedMapSquare, head);
103 if (selectedMapSquare == null) {
108 if (selectedMapSquare == mapSquare) {
118 if (selectedMapSquare == null) {
124 if (selectedMapSquare == gameObjectPart.
getMapSquare()) {
141 if (selectedMapSquare == mapSquare && selectedGameObject == gameObject) {
145 selectedMapSquare = mapSquare;
146 selectedGameObject = gameObject;
156 if (selectedMapSquare != null && selectedGameObject != gameObject) {
157 selectedGameObject = gameObject;
G getSelectedGameObject()
Returns the currently selected GameObject within this list (currently selected MapSquare).
MapSquare< G, A, R > getMapSquare()
boolean isSelectedMapSquares(@NotNull final Iterable< MapSquare< G, A, R >> mapSquares)
T [] getListeners()
Returns an array of all the listeners.
T getMultiNext()
Returns the next of this multi-part object.
MapSquare< G, A, R > getSelectedMapSquare()
Returns the currently selected map square.
Interface for listeners interested in events of SelectedSquareModel instances.
Base package of all Gridarta classes.
Reflects a game object (object on a map).
void remove(@NotNull final T listener)
Removes a listener.
GameObjects are the objects based on Archetypes found on maps.
void add(@NotNull final T listener)
Adds a listener.
boolean setSelectedMapSquare(@Nullable final MapSquare< G, A, R > mapSquare, @Nullable final G gameObject)
Sets the currently selected map square.
MapSquare< G, A, R > selectedMapSquare
The currently selected MapSquare.
void removeSelectedSquareListener(@NotNull final SelectedSquareModelListener< G, A, R > listener)
Removes a SelectedSquareModelListener to be notified.
void addSelectedSquareListener(@NotNull final SelectedSquareModelListener< G, A, R > listener)
Adds a SelectedSquareModelListener to be notified.
G selectedGameObject
The currently selected GameObject.
Type-safe version of EventListenerList.
void setSelectedGameObject(@Nullable final G gameObject)
Sets the currently selected GameObject.
void fireSelectionChangedEvent()
Notifies all listeners that the selected map square has changed.
The model component of the selected square control.
final EventListenerList2< SelectedSquareModelListener< G, A, R > > listenerList
The listeners to inform of changes.
boolean isSelectedGameObjects(@NotNull final Iterable< G > gameObjects)
Interface for MapArchObjects.