20 package net.sf.gridarta.maincontrol;
22 import java.util.ArrayList;
23 import java.util.Collection;
24 import javax.swing.Action;
34 import net.
sf.japi.swing.action.ActionBuilder;
35 import net.
sf.japi.swing.action.ActionBuilderFactory;
36 import org.jetbrains.annotations.NotNull;
37 import org.jetbrains.annotations.Nullable;
58 private static final ActionBuilder
ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(
"net.sf.gridarta");
89 if (tmpMapView != null) {
94 currentMapView = mapView;
95 if (mapView != null) {
121 currentMapView = mapViewManager.getActiveMapView();
147 return editorAction == null ? null :
createAction(name, category, editorAction);
168 if (currentMapView != null) {
170 throw new IllegalStateException();
175 mapCursorListeners.add(mapCursorListener);
void addMapViewManagerListener(@NotNull final MapViewManagerListener< G, A, R > listener)
Adds a listener to be notified.
Graphical User Interface of Gridarta.
MapView< G, A, R > currentMapView
The active map view, or.
final Collection< MapCursorListener< G, A, R > > mapCursorListeners
The EditorActions that are interested in MapCursorListener events.
Utility class implementing Action related functions.
final MapViewManagerListener< G, A, R > mapViewManagerListener
The map view manager listener used to detect changed current maps.
Base package of all Gridarta classes.
void addMapCursorListener(@NotNull final MapCursorListener< G, A, R > listener)
Register a MapCursorListener.
Action createToggleAction(@NotNull final String name, @NotNull final String category, @NotNull final EditorAction editorAction)
Initializes a new action.
Reflects a game object (object on a map).
Action createAction(@NotNull final String name, @NotNull final String category, @NotNull final EditorAction editorAction)
Initializes a new action.
GameObjects are the objects based on Archetypes found on maps.
Action createActionOptional(@NotNull final String name, @NotNull final String category, @Nullable final EditorAction editorAction)
Initializes a new action.
Interface for listeners interested in events related to MapViewManager instances. ...
void addEditorAction(@NotNull final EditorAction editorAction)
Records the event types an EditorAction is interested in.
Maintains a set of EditorAction instances and calls their event listener callbacks.
EditorActionManager(@NotNull final MapViewManager< G, A, R > mapViewManager)
Creates a new instance.
Base classes for rendering maps.
MapCursor< G, A, R > getMapCursor()
Returns the MapCursor of this view.
final MapViewManager< G, A, R > mapViewManager
The MapViewManager for tracking open maps.
A map view consists of a map grid and a map cursor, and is attached to a map control.
static final ActionBuilder ACTION_BUILDER
The ActionBuilder.
Interface for listeners listening to MapCursor related events.
void removeMapCursorListener(@NotNull final MapCursorListener< G, A, R > listener)
Remove a MapCursorListener.
Interface for MapArchObjects.
static Action newToggleAction(@NotNull final ActionBuilder actionBuilder, @NotNull final String category, @NotNull final EditorAction editorAction, @NotNull final String key)
Creates a new Action instance.
static Action newAction(@NotNull final ActionBuilder actionBuilder, @NotNull final String category, @NotNull final EditorAction editorAction, @NotNull final String key)
Creates a new Action instance.