Go to the documentation of this file.
20 package net.sf.gridarta.gui.mapcursor;
22 import java.awt.Point;
24 import javax.swing.Action;
41 import net.
sf.japi.swing.action.ActionMethod;
42 import org.jetbrains.annotations.NotNull;
43 import org.jetbrains.annotations.Nullable;
49 public class MapCursorActions<G
extends GameObject<G, A, R>, A extends
MapArchObject<A>, R extends
Archetype<G, A, R>> implements
EditorAction,
MapCursorListener<G, A, R>,
MapViewManagerListener<G, A, R> {
86 public void mapSizeChanged(@NotNull
final Size2D newSize) {
96 public void mapObjectsChanged(@NotNull
final Set<G> gameObjects, @NotNull
final Set<G> transientGameObjects) {
106 public void mapFileChanged(@Nullable
final MapFile oldMapFile) {
111 public void modifiedChanged() {
194 final Action action =
aMoveCursor[direction.ordinal()];
195 if (action !=
null) {
209 if (mapView ==
null) {
214 if (!mapCursor.
goTo(performAction, direction)) {
218 }
else if (performAction) {
221 location.translate(
BORDER * direction.getDx(),
BORDER * direction.getDy());
229 public void setAction(@NotNull
final Action action, @NotNull
final String
name) {
230 if (
name.startsWith(
"moveCursor")) {
231 boolean found =
false;
233 if (
name.equals(
"moveCursor" + direction.getId())) {
240 throw new IllegalArgumentException(
"unsupported action name: " +
name);
243 throw new IllegalArgumentException(
"unsupported action name: " +
name);
256 mapView.getMapControl().getMapModel().addMapModelListener(
mapModelListener);
261 mapView.getMapControl().getMapModel().removeMapModelListener(
mapModelListener);
MapView< G, A, R > currentMapView
void mapCursorChangedSize()
void moveCursorNorthWest()
boolean doMoveCursor(final boolean performAction, @NotNull final Direction direction)
void moveCursorSouthWest()
final Action[] aMoveCursor
void mapCursorChangedGameObject(@Nullable final MapSquare< G, A, R > mapSquare, @Nullable final G gameObject)
Rectangle getSquareBounds(@NotNull Point p)
final MapActions< G, A, R > mapActions
void moveCursorNorthEast()
boolean doEnterMap(final boolean performAction, @NotNull final Direction direction)
final MapModelListener< G, A, R > mapModelListener
void moveCursorSouthEast()
MapCursorActions(@NotNull final MapActions< G, A, R > mapActions)
void mapCursorChangedMode()
void scrollRectToVisible(@NotNull Rectangle aRect)
static final Direction[] DIRECTIONS
boolean goTo(final boolean performAction, @NotNull final Direction dir)
void mapViewClosing(@NotNull final MapView< G, A, R > mapView)
void mapCursorChangedPos(@NotNull final Point location)
void mapViewCreated(@NotNull final MapView< G, A, R > mapView)
void activeMapViewChanged(@Nullable final MapView< G, A, R > mapView)
void setAction(@NotNull final Action action, @NotNull final String name)
MapRenderer getRenderer()
MapCursor< G, A, R > getMapCursor()