Package net.sf.gridarta.gui.map.mapview
Class MapViewManager<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.map.mapview.MapViewManager<G,A,R>
-
- All Implemented Interfaces:
java.lang.Iterable<MapView<G,A,R>>
public class MapViewManager<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements java.lang.Iterable<MapView<G,A,R>>
Maintains all map views.
-
-
Constructor Summary
Constructors Constructor Description MapViewManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactivateMapView(@NotNull MapView<G,A,R> mapView)Activates a map view.voidaddMapView(@NotNull MapView<G,A,R> mapView)Adds a map view.voidaddMapViewManagerListener(@NotNull MapViewManagerListener<G,A,R> listener)Adds a listener to be notified.voiddeactivateMapView(@NotNull MapView<G,A,R> mapView)Deactivates a map view.booleandoNextWindow(boolean performAction)Executes the "next window" action.booleandoPrevWindow(boolean performAction)Executes the "prev window" action.@Nullable MapView<G,A,R>getActiveMapView()Returns the active top map view we are working with.@NotNull java.util.Iterator<MapView<G,A,R>>iterator()Returns all opened map views.voidremoveMapView(@NotNull MapView<G,A,R> mapView)Removes a map view.voidremoveMapViewManagerListener(@NotNull MapViewManagerListener<G,A,R> listener)Removes a listener to be notified.voidsetActiveMapView(@NotNull MapView<G,A,R> mapView)Sets the active map view.
-
-
-
Method Detail
-
setActiveMapView
public void setActiveMapView(@NotNull @NotNull MapView<G,A,R> mapView)Sets the active map view. The map view will be moved to the front.- Parameters:
mapView- the map view to activate
-
removeMapView
public void removeMapView(@NotNull @NotNull MapView<G,A,R> mapView)Removes a map view. Activates another map view if the active map view is removed.- Parameters:
mapView- the map view to remove
-
addMapView
public void addMapView(@NotNull @NotNull MapView<G,A,R> mapView)Adds a map view. The map view becomes the active map view.- Parameters:
mapView- the map view to add
-
deactivateMapView
public void deactivateMapView(@NotNull @NotNull MapView<G,A,R> mapView)Deactivates a map view.- Parameters:
mapView- the map view to deactivate
-
activateMapView
public void activateMapView(@NotNull @NotNull MapView<G,A,R> mapView)Activates a map view.- Parameters:
mapView- the map view to activate
-
iterator
@NotNull public @NotNull java.util.Iterator<MapView<G,A,R>> iterator()
Returns all opened map views.- Specified by:
iteratorin interfacejava.lang.Iterable<G extends GameObject<G,A,R>>- Returns:
- all opened map views; the result cannot be modified
-
addMapViewManagerListener
public void addMapViewManagerListener(@NotNull @NotNull MapViewManagerListener<G,A,R> listener)Adds a listener to be notified.- Parameters:
listener- the listener to add
-
removeMapViewManagerListener
public void removeMapViewManagerListener(@NotNull @NotNull MapViewManagerListener<G,A,R> listener)Removes a listener to be notified.- Parameters:
listener- the listener to remove
-
getActiveMapView
@Nullable public @Nullable MapView<G,A,R> getActiveMapView()
Returns the active top map view we are working with.- Returns:
- the active top map view we are working with or
nullif no map view is open
-
doPrevWindow
public boolean doPrevWindow(boolean performAction)
Executes the "prev window" action.- Parameters:
performAction- whether the action should be performed- Returns:
- whether the action was or can be performed
-
doNextWindow
public boolean doNextWindow(boolean performAction)
Executes the "next window" action.- Parameters:
performAction- whether the action should be performed- Returns:
- whether the action was or can be performed
-
-