20 package net.sf.gridarta.action;
23 import javax.swing.Action;
39 import org.jetbrains.annotations.NotNull;
40 import org.jetbrains.annotations.Nullable;
75 setMapModel(mapControl == null ? null : mapControl.getMapModel());
79 public void mapCreated(@NotNull
final MapControl<G, A, R> mapControl,
final boolean interactive) {
99 public void mapSizeChanged(@NotNull
final Size2D newSize) {
111 public void mapObjectsChanged(@NotNull
final Set<G> gameObjects, @NotNull
final Set<G> transientGameObjects) {
122 public void mapFileChanged(@Nullable
final MapFile oldMapFile) {
126 public void modifiedChanged() {
139 public void selectionChanged(@Nullable
final MapSquare<G, A, R> mapSquare, @Nullable
final G gameObject) {
153 if (mapManager != null) {
154 mapManager.addMapManagerListener(mapManagerListener);
163 public boolean doAction(
final boolean performAction) {
174 protected abstract boolean doAction(
boolean performAction, @Nullable G gameObject);
177 public void setAction(@NotNull
final Action action, @NotNull
final String name) {
186 if (action != null) {
198 if (this.mapModel != null) {
199 this.mapModel.removeMapModelListener(mapModelListener);
202 if (this.mapModel != null) {
G getSelectedGameObject()
Returns the currently selected GameObject within this list (currently selected MapSquare).
void setAction(@NotNull final Action action, @NotNull final String name)
Sets the Action instance for this editor action.
boolean isSelectedMapSquares(@NotNull final Iterable< MapSquare< G, A, R >> mapSquares)
A MapModel reflects the data of a map.
A MapManager manages all opened maps.
Graphical User Interface of Gridarta.
This package contains the framework for validating maps.
Interface for listeners listening on MapModel events.
Interface for listeners interested in events of SelectedSquareModel instances.
void addMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Register a map listener.
Base package of all Gridarta classes.
MapModel< G, A, R > mapModel
The currently active MapModel.
Abstract base class for actions that move the selected game object in the SelectedSquareModel.
Reflects a game object (object on a map).
void setMapModel(@Nullable final MapModel< G, A, R > mapModel)
Called whether the current map has changed.
Interface for listeners listening to MapManager changes.
Action action
The Action for this instance.
final SelectedSquareModel< G, A, R > selectedSquareModel
The SelectedSquareModel that is updated.
GameObjects are the objects based on Archetypes found on maps.
void updateAction()
Updates the enabled state of action.
Displays the contents of the currently selected map square.
final SelectedSquareModelListener< G, A, R > selectedSquareModelListener
The SelectedSquareModelListener attached to selectedSquareModel.
void addSelectedSquareListener(@NotNull final SelectedSquareModelListener< G, A, R > listener)
Adds a SelectedSquareModelListener to be notified.
Currently nothing more than a marker interface for unification.
final MapManagerListener< G, A, R > mapManagerListener
The map view manager listener.
AbstractMoveSquareAction(@NotNull final SelectedSquareModel< G, A, R > selectedSquareModel, @Nullable final MapManager< G, A, R > mapManager)
Creates a new instance.
An interface for classes that collect errors.
The model component of the selected square control.
boolean doAction(final boolean performAction)
Executes the action.
boolean isSelectedGameObjects(@NotNull final Iterable< G > gameObjects)
The location of a map file with a map directory.
Interface for MapArchObjects.
final MapModelListener< G, A, R > mapModelListener
The MapModelListener attached to mapModel.
The class Size2D represents a 2d rectangular area.