20 package net.sf.gridarta.actions;
22 import java.awt.Point;
23 import java.io.IOException;
24 import javax.swing.Action;
35 import net.
sf.japi.swing.action.ActionMethod;
36 import org.jetbrains.annotations.NotNull;
37 import org.jetbrains.annotations.Nullable;
85 if (aOpenInClient != null) {
98 if (mapView == null) {
105 if (mapFile == null) {
115 final int mapX = cursor.x;
116 final int mapY = cursor.y;
121 }
catch (
final IOException ex) {
134 protected abstract void resetMap(@NotNull String mapPath)
throws IOException;
143 protected abstract void teleportCharacterToMap(@NotNull String mapPath,
int mapX,
int mapY)
throws IOException;
146 public void setAction(@NotNull
final Action action, @NotNull
final String name) {
147 aOpenInClient = action;
153 currentMapView = mapView;
AbstractServerActions(@NotNull final FileControl< G, A, R > fileControl)
Creates a new instance.
A MapModel reflects the data of a map.
boolean doOpenInClient(final boolean performAction)
Executes the "open in client" action.
Graphical User Interface of Gridarta.
final FileControl< G, A, R > fileControl
The file control for saving maps.
void setAction(@NotNull final Action action, @NotNull final String name)
Sets the Action instance for this editor action.
AbsoluteMapPath getMapPath()
Returns the map path within getMapsDir().
void updateActions()
Update the enabled/disabled state of all actions.
abstract void teleportCharacterToMap(@NotNull String mapPath, int mapX, int mapY)
Teleports the character to the given map path.
boolean isModified()
Return whether the map has been modified from the on-disk state.
void openInClient()
Action method for "open in client".
Actions that require a connection to a game server.
MapControl< G, A, R > getMapControl()
Return the controller of this view.
Point getLocation()
Get position of cursor.
MapModel< G, A, R > getMapModel()
Returns the map model.
void mapViewCreated(@NotNull final MapView< G, A, R > mapView)
NoopMethodInAbstractClass
void reportTeleportCharacterError(@NotNull String mapPath, @NotNull String message)
Reports an error while teleporting a character to the current map.
Base package of all Gridarta classes.
void mapViewClosing(@NotNull final MapView< G, A, R > mapView)
NoopMethodInAbstractClass
Reflects a game object (object on a map).
abstract void resetMap(@NotNull String mapPath)
Resets a map identified by the given map path.
void activeMapViewChanged(@Nullable final MapView< G, A, R > mapView)
This event handler is called when the current map view has changed.
GameObjects are the objects based on Archetypes found on maps.
Interface for listeners interested in events related to MapViewManager instances. ...
Action aOpenInClient
The action for "open in client".
MapView< G, A, R > currentMapView
The currently active map or.
boolean save(@NotNull MapControl< G, A, R > mapControl)
Save one map.
Base classes for rendering maps.
MapCursor< G, A, R > getMapCursor()
Returns the MapCursor of this view.
Currently nothing more than a marker interface for unification.
A map view consists of a map grid and a map cursor, and is attached to a map control.
MapFile getMapFile()
Returns the map file.
The location of a map file with a map directory.
Interface for MapArchObjects.