Package net.sf.gridarta.gui.map
Class MapFileActions<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.map.MapFileActions<G,A,R>
-
- All Implemented Interfaces:
EditorAction
public class MapFileActions<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements EditorAction
Implements actions for the "file" menu attached to maps.
-
-
Constructor Summary
Constructors Constructor Description MapFileActions(@NotNull ImageCreator2<G,A,R> imageCreator2, @NotNull MapManager<G,A,R> mapManager, @NotNull MapViewsManager<G,A,R> mapViewsManager, @NotNull MapViewManager<G,A,R> mapViewManager, @NotNull FileControl<G,A,R> fileControl, @NotNull java.awt.Component mainView)
Creates a new instance that tracks the map state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeMap()
Invoked when the user wants to close the map.void
closeNotify()
Unregisters all registered listeners.void
createImage()
Invoked when the user wants to create an image file of the map.void
reloadMap()
Invoked when the user wants to reload the map to the previously saved state.void
saveMap()
Invoked when the user wants to save the map.void
saveMapAs()
Invoked when the user wants to save the map to a file.void
setAction(@NotNull javax.swing.Action action, @NotNull java.lang.String name)
Sets theAction
instance for this editor action.
-
-
-
Constructor Detail
-
MapFileActions
public MapFileActions(@NotNull @NotNull ImageCreator2<G,A,R> imageCreator2, @NotNull @NotNull MapManager<G,A,R> mapManager, @NotNull @NotNull MapViewsManager<G,A,R> mapViewsManager, @NotNull @NotNull MapViewManager<G,A,R> mapViewManager, @NotNull @NotNull FileControl<G,A,R> fileControl, @NotNull @NotNull java.awt.Component mainView)
Creates a new instance that tracks the map state.- Parameters:
imageCreator2
- the image creator to forwards actions tomapManager
- the map managermapViewsManager
- the map views managermapViewManager
- the map view managerfileControl
- the file control to forward actions tomainView
- the main view component
-
-
Method Detail
-
closeNotify
public void closeNotify()
Unregisters all registered listeners. Must be called when this instance is freed.
-
saveMap
@ActionMethod public void saveMap()
Invoked when the user wants to save the map.
-
saveMapAs
@ActionMethod public void saveMapAs()
Invoked when the user wants to save the map to a file.
-
createImage
@ActionMethod public void createImage()
Invoked when the user wants to create an image file of the map.
-
reloadMap
@ActionMethod public void reloadMap()
Invoked when the user wants to reload the map to the previously saved state.
-
closeMap
@ActionMethod public void closeMap()
Invoked when the user wants to close the map.
-
setAction
public void setAction(@NotNull @NotNull javax.swing.Action action, @NotNull @NotNull java.lang.String name)
Description copied from interface:EditorAction
Sets theAction
instance for this editor action.- Specified by:
setAction
in interfaceEditorAction
- Parameters:
action
- the action instancename
- the name of the action
-
-