Package net.sf.gridarta.gui.mapcursor
Class MapCursorActions<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
- java.lang.Object
-
- net.sf.gridarta.gui.mapcursor.MapCursorActions<G,A,R>
-
- All Implemented Interfaces:
java.util.EventListener,MapViewManagerListener<G,A,R>,MapCursorListener<G,A,R>,EditorAction
public class MapCursorActions<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements EditorAction, MapCursorListener<G,A,R>, MapViewManagerListener<G,A,R>
Cursor related actions.
-
-
Constructor Summary
Constructors Constructor Description MapCursorActions(@NotNull MapActions<G,A,R> mapActions)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidactiveMapViewChanged(@Nullable MapView<G,A,R> mapView)This event handler is called when the current map view has changed.voidmapCursorChangedGameObject(@Nullable MapSquare<G,A,R> mapSquare, G gameObject)Called whenever the selected game object has changed.voidmapCursorChangedMode()This event handler is called whenMapCursorchanges mode (drag, select).voidmapCursorChangedPos(@NotNull java.awt.Point location)This event handler is called whenMapCursorhas moved.voidmapCursorChangedSize()Called whenever the map cursor's map grid size has changed.voidmapViewClosing(@NotNull MapView<G,A,R> mapView)This event handler is called when a map view is to be closed.voidmapViewCreated(@NotNull MapView<G,A,R> mapView)This event handler is called when a map view was created.voidmoveCursorEast()Action method for "move cursor east".voidmoveCursorNorth()Action method for "move cursor north".voidmoveCursorNorthEast()Action method for "move cursor north east".voidmoveCursorNorthWest()Action method for "move cursor north west".voidmoveCursorSouth()Action method for "move cursor south".voidmoveCursorSouthEast()Action method for "move cursor south east".voidmoveCursorSouthWest()Action method for "move cursor south west".voidmoveCursorWest()Action method for "move cursor west".voidsetAction(@NotNull javax.swing.Action action, @NotNull java.lang.String name)Sets theActioninstance for this editor action.
-
-
-
Constructor Detail
-
MapCursorActions
public MapCursorActions(@NotNull @NotNull MapActions<G,A,R> mapActions)Creates a new instance.
-
-
Method Detail
-
moveCursorNorth
@ActionMethod public void moveCursorNorth()
Action method for "move cursor north".
-
moveCursorSouth
@ActionMethod public void moveCursorSouth()
Action method for "move cursor south".
-
moveCursorEast
@ActionMethod public void moveCursorEast()
Action method for "move cursor east".
-
moveCursorWest
@ActionMethod public void moveCursorWest()
Action method for "move cursor west".
-
moveCursorNorthEast
@ActionMethod public void moveCursorNorthEast()
Action method for "move cursor north east".
-
moveCursorNorthWest
@ActionMethod public void moveCursorNorthWest()
Action method for "move cursor north west".
-
moveCursorSouthEast
@ActionMethod public void moveCursorSouthEast()
Action method for "move cursor south east".
-
moveCursorSouthWest
@ActionMethod public void moveCursorSouthWest()
Action method for "move cursor south west".
-
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
-
activeMapViewChanged
public void activeMapViewChanged(@Nullable @Nullable MapView<G,A,R> mapView)Description copied from interface:MapViewManagerListenerThis event handler is called when the current map view has changed.- Specified by:
activeMapViewChangedin interfaceMapViewManagerListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
mapView- the new map view ornullif no opened map view exists
-
mapViewCreated
public void mapViewCreated(@NotNull @NotNull MapView<G,A,R> mapView)Description copied from interface:MapViewManagerListenerThis event handler is called when a map view was created.- Specified by:
mapViewCreatedin interfaceMapViewManagerListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
mapView- the created map view
-
mapViewClosing
public void mapViewClosing(@NotNull @NotNull MapView<G,A,R> mapView)Description copied from interface:MapViewManagerListenerThis event handler is called when a map view is to be closed.- Specified by:
mapViewClosingin interfaceMapViewManagerListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
mapView- the map view that is to be closed
-
mapCursorChangedPos
public void mapCursorChangedPos(@NotNull @NotNull java.awt.Point location)Description copied from interface:MapCursorListenerThis event handler is called whenMapCursorhas moved.- Specified by:
mapCursorChangedPosin interfaceMapCursorListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
location- the new location
-
mapCursorChangedMode
public void mapCursorChangedMode()
Description copied from interface:MapCursorListenerThis event handler is called whenMapCursorchanges mode (drag, select).- Specified by:
mapCursorChangedModein interfaceMapCursorListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
mapCursorChangedGameObject
public void mapCursorChangedGameObject(@Nullable @Nullable MapSquare<G,A,R> mapSquare, @Nullable G gameObject)Description copied from interface:MapCursorListenerCalled whenever the selected game object has changed. This function is not called ifMapCursorListener.mapCursorChangedPos(Point)occurs concurrently.- Specified by:
mapCursorChangedGameObjectin interfaceMapCursorListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>- Parameters:
mapSquare- the newly selected map square ornullif no map square is selectedgameObject- the newly selected game object ornullif no game object is selected
-
mapCursorChangedSize
public void mapCursorChangedSize()
Description copied from interface:MapCursorListenerCalled whenever the map cursor's map grid size has changed.- Specified by:
mapCursorChangedSizein interfaceMapCursorListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
-