public abstract class AbstractMapCursorAction<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends java.lang.Object implements MapCursorListener<G,A,R>, MapViewManagerListener<G,A,R>
Constructor and Description |
---|
AbstractMapCursorAction() |
Modifier and Type | Method and Description |
---|---|
void |
activeMapViewChanged(@Nullable MapView<G,A,R> mapView)
This event handler is called when the current map view has changed.
|
protected @Nullable MapCursor<G,A,R> |
getActiveMapCursor()
Return the map cursor of the current map view if it is active.
|
protected @Nullable MapView<G,A,R> |
getActiveMapView()
Return the current map view.
|
void |
mapCursorChangedGameObject(@Nullable MapSquare<G,A,R> mapSquare,
G gameObject)
Called whenever the selected game object has changed.
|
void |
mapCursorChangedMode()
This event handler is called when
MapCursor changes mode (drag,
select). |
void |
mapCursorChangedPos(@NotNull java.awt.Point location)
This event handler is called when
MapCursor has moved. |
void |
mapCursorChangedSize()
Called whenever the map cursor's map grid size has changed.
|
void |
mapViewClosing(@NotNull MapView<G,A,R> mapView)
This event handler is called when a map view is to be closed.
|
void |
mapViewCreated(@NotNull MapView<G,A,R> mapView)
This event handler is called when a map view was created.
|
protected abstract void |
updateAction()
Called whenever the current map cursor has changed.
|
@Nullable protected @Nullable MapCursor<G,A,R> getActiveMapCursor()
null
if the cursor is not active, or
if no map view exists@Nullable protected @Nullable MapView<G,A,R> getActiveMapView()
null
protected abstract void updateAction()
public void activeMapViewChanged(@Nullable @Nullable MapView<G,A,R> mapView)
MapViewManagerListener
activeMapViewChanged
in interface MapViewManagerListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
mapView
- the new map view or null
if no opened map view
existspublic void mapViewCreated(@NotNull @NotNull MapView<G,A,R> mapView)
MapViewManagerListener
mapViewCreated
in interface MapViewManagerListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
mapView
- the created map viewpublic void mapViewClosing(@NotNull @NotNull MapView<G,A,R> mapView)
MapViewManagerListener
mapViewClosing
in interface MapViewManagerListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
mapView
- the map view that is to be closedpublic void mapCursorChangedPos(@NotNull @NotNull java.awt.Point location)
MapCursorListener
MapCursor
has moved.mapCursorChangedPos
in interface MapCursorListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
location
- the new locationpublic void mapCursorChangedMode()
MapCursorListener
MapCursor
changes mode (drag,
select).mapCursorChangedMode
in interface MapCursorListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
public void mapCursorChangedGameObject(@Nullable @Nullable MapSquare<G,A,R> mapSquare, @Nullable G gameObject)
MapCursorListener
MapCursorListener.mapCursorChangedPos(Point)
occurs
concurrently.mapCursorChangedGameObject
in interface MapCursorListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
mapSquare
- the newly selected map square or null
if no map
square is selectedgameObject
- the newly selected game object or null
if no
game object is selectedpublic void mapCursorChangedSize()
MapCursorListener
mapCursorChangedSize
in interface MapCursorListener<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>