public class MapActions<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>
Constructor and Description |
---|
MapActions(@NotNull java.awt.Frame helpParent,
@NotNull MapManager<G,A,R> mapManager,
@NotNull MapViewManager<G,A,R> mapViewManager,
@NotNull ExitMatcher<G,A,R> exitMatcher,
@NotNull javax.swing.filechooser.FileFilter mapFileFilter,
@NotNull SelectedSquareModel<G,A,R> selectedSquareModel,
boolean allowRandomMapParameters,
@NotNull MapPropertiesDialogFactory<G,A,R> mapPropertiesDialogFactory,
@NotNull MapViewSettings mapViewSettings,
@NotNull MapViewsManager<G,A,R> mapViewsManager,
@NotNull EnterMap<G,A,R> enterMap,
@NotNull ProjectSettings projectSettings)
Creates a new instance.
|
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.
|
void |
createTileDown()
Action method for creating down tiled map.
|
void |
createTileEast()
Action method for creating east tiled map.
|
void |
createTileNorth()
Action method for creating north tiled map.
|
void |
createTileNorthEast()
Action method for creating northeast tiled map.
|
void |
createTileNorthWest()
Action method for creating northwest tiled map.
|
void |
createTileSouth()
Action method for creating south tiled map.
|
void |
createTileSouthEast()
Action method for creating southeast tiled map.
|
void |
createTileSouthWest()
Action method for creating southwest tiled map.
|
void |
createTileUp()
Action method for creating up tiled map.
|
void |
createTileWest()
Action method for creating west tiled map.
|
void |
deleteUnknownObjects()
Deletes all game objects referencing unknown archetypes.
|
boolean |
doEnterMap(boolean performAction,
@NotNull Direction direction)
Executes the "enter map" action.
|
void |
enterDownMap()
Action method for entering the down map.
|
void |
enterEastMap()
Action method for entering the east map.
|
void |
enterExit()
Tries to load the map where the selected map-exit points to.
|
void |
enterMap(@NotNull MapFile mapFile,
@Nullable java.awt.Point destinationPoint)
Enters a map.
|
void |
enterNorthEastMap()
Action method for entering the north east map.
|
void |
enterNorthMap()
Action method for entering the north map.
|
void |
enterNorthWestMap()
Action method for entering the north west map.
|
void |
enterSouthEastMap()
Action method for entering the south east map.
|
void |
enterSouthMap()
Action method for entering the south map.
|
void |
enterSouthWestMap()
Action method for entering the south west map.
|
void |
enterUpMap()
Action method for entering the up map.
|
void |
enterWestMap()
Action method for entering the west map.
|
boolean |
isAutoJoin()
Action method for "autojoin".
|
boolean |
isDoubleFaces()
Action method for "double faces".
|
boolean |
isGridVisible()
Action method for "grid visible".
|
boolean |
isSmoothing()
Action method for "smoothing".
|
boolean |
isTileShow()
Action method for "tile show".
|
boolean |
isTileStretching()
Action method for "tile-stretching".
|
void |
mapCreateView()
Action method for "create 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 |
mapProperties()
Action method for "map properties".
|
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.
|
void |
nextExit()
Selects the next exit.
|
void |
prevExit()
Selects the previous exit.
|
void |
setAction(@NotNull javax.swing.Action action,
@NotNull java.lang.String name)
Sets the
Action instance for this editor action. |
void |
setAutoJoin(boolean autoJoin)
Action method for "autoJoin".
|
void |
setDoubleFaces(boolean doubleFaces)
Sets whether double faces on the current map should be shown.
|
void |
setGridVisible(boolean gridVisible)
Sets whether the grid of the current map should be visible.
|
void |
setSmoothing(boolean smoothing)
Sets whether smoothing of the current map is active.
|
void |
setTileShow(boolean tileShow)
Action method for "tile show".
|
void |
setTileStretching(boolean tileStretching)
Sets whether tile-stretching of the current map is active.
|
void |
shrinkMapSize()
Action method for "shrink map size".
|
public MapActions(@NotNull @NotNull java.awt.Frame helpParent, @NotNull @NotNull MapManager<G,A,R> mapManager, @NotNull @NotNull MapViewManager<G,A,R> mapViewManager, @NotNull @NotNull ExitMatcher<G,A,R> exitMatcher, @NotNull @NotNull javax.swing.filechooser.FileFilter mapFileFilter, @NotNull @NotNull SelectedSquareModel<G,A,R> selectedSquareModel, boolean allowRandomMapParameters, @NotNull @NotNull MapPropertiesDialogFactory<G,A,R> mapPropertiesDialogFactory, @NotNull @NotNull MapViewSettings mapViewSettings, @NotNull @NotNull MapViewsManager<G,A,R> mapViewsManager, @NotNull @NotNull EnterMap<G,A,R> enterMap, @NotNull @NotNull ProjectSettings projectSettings)
helpParent
- the parent frame for help windowsmapManager
- the map managermapViewManager
- the map view managerexitMatcher
- the exit matcher for selecting exit game objectsmapFileFilter
- the Swing file filter to useselectedSquareModel
- the selected square model to useallowRandomMapParameters
- whether exit paths may point to random
mapsmapPropertiesDialogFactory
- the map properties dialog factory to
usemapViewSettings
- the map view settings instance to usemapViewsManager
- the map viewsenterMap
- the enter map instance to use@ActionMethod public boolean isGridVisible()
true
if the grid is visible, or false
if the grid
is invisible@ActionMethod public void setGridVisible(boolean gridVisible)
gridVisible
- new visibility of grid in current map, true
if
the grid should be visible, false
if invisibleisGridVisible()
@ActionMethod public boolean isSmoothing()
true
if smoothing is active, or false
if
smoothing is disabled@ActionMethod public void setSmoothing(boolean smoothing)
smoothing
- new smoothing in current map, true
if the
smoothing should be active, false
if deactivated()
@ActionMethod public boolean isDoubleFaces()
true
if double faces are shown, or false
if not@ActionMethod public void setDoubleFaces(boolean doubleFaces)
doubleFaces
- new valueisDoubleFaces()
@ActionMethod public boolean isTileShow()
true
if adjacent tiles are shown, or false
if not@ActionMethod public boolean isTileStretching()
true
if tile-stretching is active, or false
if
tile-stretching is disabled@ActionMethod public void setTileStretching(boolean tileStretching)
tileStretching
- new tile-stretching in current map, true
if
the tile-stretching should be active, false
if deactivated()
@ActionMethod public void setTileShow(boolean tileShow)
tileShow
- if set, show adjacent tiles@ActionMethod public void mapCreateView()
@ActionMethod public void mapProperties()
@ActionMethod public void shrinkMapSize()
@ActionMethod public boolean isAutoJoin()
true
if autojoining is enabled, or false
if
autojoining is disabled@ActionMethod public void setAutoJoin(boolean autoJoin)
autoJoin
- if set, enable autojoining@ActionMethod public void enterExit()
@ActionMethod public void nextExit()
@ActionMethod public void prevExit()
@ActionMethod public void enterNorthMap()
@ActionMethod public void enterNorthEastMap()
@ActionMethod public void enterEastMap()
@ActionMethod public void enterSouthEastMap()
@ActionMethod public void enterSouthMap()
@ActionMethod public void enterSouthWestMap()
@ActionMethod public void enterWestMap()
@ActionMethod public void enterNorthWestMap()
@ActionMethod public void enterUpMap()
@ActionMethod public void enterDownMap()
@ActionMethod public void createTileNorth()
@ActionMethod public void createTileEast()
@ActionMethod public void createTileSouth()
@ActionMethod public void createTileWest()
@ActionMethod public void createTileNorthEast()
@ActionMethod public void createTileSouthEast()
@ActionMethod public void createTileSouthWest()
@ActionMethod public void createTileNorthWest()
@ActionMethod public void createTileUp()
@ActionMethod public void createTileDown()
@ActionMethod public void deleteUnknownObjects()
public void enterMap(@NotNull @NotNull MapFile mapFile, @Nullable @Nullable java.awt.Point destinationPoint)
mapFile
- the map file to enterdestinationPoint
- the desired destination point on the map or
null
for defaultpublic boolean doEnterMap(boolean performAction, @NotNull @NotNull Direction direction)
performAction
- whether the action should be performeddirection
- the direction to enterpublic void setAction(@NotNull @NotNull javax.swing.Action action, @NotNull @NotNull java.lang.String name)
EditorAction
Action
instance for this editor action.setAction
in interface EditorAction
action
- the action instancename
- the name of the actionpublic 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>>