Package net.sf.gridarta.gui.map.mapview
Class MapViews<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.MapViews<G,A,R>
-
public class MapViews<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.ObjectA list ofMapViewsfor oneMapControlinstance.
-
-
Constructor Summary
Constructors Constructor Description MapViews()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMapViewsListener(@NotNull MapViewsListener<G,A,R> listener)Adds aMapViewsListenerto be notified of events.voidcloseAllViews()Closes all views of aMapControl.voidcloseView(@NotNull MapView<G,A,R> mapView)Closes a view of aMapControl.@Nullable MapView<G,A,R>getMapViewFrame()Returns the last used view of aMapControl.@NotNull java.util.Iterator<MapView<G,A,R>>getMapViewIterator()Returns anIteratorreturning allMapViews.intgetMapViews()Returns the number of views of aMapControl.@NotNull java.awt.Point @NotNull []getViewPositions()Returns the current view positions of all views of aMapControl.@NotNull MapView<G,A,R>newMapView(@NotNull MapControl<G,A,R> mapControl, @Nullable java.awt.Point viewPosition, @NotNull MapViewFactory<G,A,R> mapViewFactory)Creates a newMapView.voidraise(@NotNull MapView<G,A,R> mapView)Raises aMapView.voidremoveMapViewsListener(@NotNull MapViewsListener<G,A,R> listener)Removes aMapViewsListenerto be notified of events.voidrepaintAllViews()Repaints allMapViews.voidsetFocus(@NotNull MapView<G,A,R> mapView)Sets aMapViewas the main view.
-
-
-
Method Detail
-
addMapViewsListener
public void addMapViewsListener(@NotNull @NotNull MapViewsListener<G,A,R> listener)Adds aMapViewsListenerto be notified of events.- Parameters:
listener- the listener
-
removeMapViewsListener
public void removeMapViewsListener(@NotNull @NotNull MapViewsListener<G,A,R> listener)Removes aMapViewsListenerto be notified of events.- Parameters:
listener- the listener
-
getMapViewFrame
@Nullable public @Nullable MapView<G,A,R> getMapViewFrame()
Returns the last used view of aMapControl.- Returns:
- the last used view
-
getMapViews
public int getMapViews()
Returns the number of views of aMapControl.- Returns:
- the number of views
-
newMapView
@NotNull public @NotNull MapView<G,A,R> newMapView(@NotNull @NotNull MapControl<G,A,R> mapControl, @Nullable @Nullable java.awt.Point viewPosition, @NotNull @NotNull MapViewFactory<G,A,R> mapViewFactory)
Creates a newMapView.- Parameters:
mapControl- the map control new map view is part ofviewPosition- the view position to show initially; may benullto show the top left cornermapViewFactory- the map view factory to use- Returns:
- the map view
-
getViewPositions
@NotNull public @NotNull java.awt.Point @NotNull [] getViewPositions()
Returns the current view positions of all views of aMapControl.- Returns:
- the current view positions of all views
-
closeView
public void closeView(@NotNull @NotNull MapView<G,A,R> mapView)Closes a view of aMapControl.- Parameters:
mapView- the view to be closed
-
closeAllViews
public void closeAllViews()
Closes all views of aMapControl.
-
setFocus
public void setFocus(@NotNull @NotNull MapView<G,A,R> mapView)Sets aMapViewas the main view.- Parameters:
mapView- the map view
-
getMapViewIterator
@NotNull public @NotNull java.util.Iterator<MapView<G,A,R>> getMapViewIterator()
Returns anIteratorreturning allMapViews. The map views are returns top to bottom.- Returns:
- the iterator
-
repaintAllViews
public void repaintAllViews()
Repaints allMapViews.
-
-