Package net.sf.gridarta.gui.mapdesktop
Class MapDesktop<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.mapdesktop.MapDesktop<G,A,R>
-
- All Implemented Interfaces:
EditorAction
public class MapDesktop<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements EditorAction
TheJDesktopPanecontaining all map views.
-
-
Constructor Summary
Constructors Constructor Description MapDesktop(@NotNull MapViewManager<G,A,R> mapViewManager, @NotNull MapManager<G,A,R> mapManager, @NotNull MapImageCache<G,A,R> mapImageCache, @NotNull MapViewsManager<G,A,R> mapViewsManager)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddWindowAction(@NotNull javax.swing.JMenu menu, @NotNull MapView<G,A,R> mapView, int index)Adds an action for selecting this window to a menu.@NotNull java.awt.ComponentgetComponent()Returns theComponentthat shows all map views.voidnextWindow()Gives focus to the previous window.voidprevWindow()Gives focus to the next window.voidsetAction(@NotNull javax.swing.Action action, @NotNull java.lang.String name)Sets theActioninstance for this editor action.voidsetCurrentMapView(@NotNull MapView<G,A,R> mapView)Sets the given level view as the current one.
-
-
-
Constructor Detail
-
MapDesktop
public MapDesktop(@NotNull @NotNull MapViewManager<G,A,R> mapViewManager, @NotNull @NotNull MapManager<G,A,R> mapManager, @NotNull @NotNull MapImageCache<G,A,R> mapImageCache, @NotNull @NotNull MapViewsManager<G,A,R> mapViewsManager)Creates a new instance.- Parameters:
mapViewManager- all open map viewsmapManager- the map manager to usemapImageCache- the map image cache to usemapViewsManager- the map views
-
-
Method Detail
-
getComponent
@NotNull public @NotNull java.awt.Component getComponent()
Returns theComponentthat shows all map views.- Returns:
- the component
-
setCurrentMapView
public void setCurrentMapView(@NotNull @NotNull MapView<G,A,R> mapView)Sets the given level view as the current one.- Parameters:
mapView- the new current level view
-
addWindowAction
public void addWindowAction(@NotNull @NotNull javax.swing.JMenu menu, @NotNull @NotNull MapView<G,A,R> mapView, int index)Adds an action for selecting this window to a menu.- Parameters:
menu- the menu to add the action tomapView- the map view to addindex- the index of the menu entry
-
prevWindow
@ActionMethod public void prevWindow()
Gives focus to the next window.
-
nextWindow
@ActionMethod public void nextWindow()
Gives focus to the previous window.
-
setAction
public void setAction(@NotNull @NotNull javax.swing.Action action, @NotNull @NotNull java.lang.String name)Description copied from interface:EditorActionSets theActioninstance for this editor action.- Specified by:
setActionin interfaceEditorAction- Parameters:
action- the action instancename- the name of the action
-
-