 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.action;
22 import java.awt.Point;
23 import java.util.List;
24 import javax.swing.Action;
37 import net.
sf.japi.swing.action.ActionMethod;
38 import org.jetbrains.annotations.NotNull;
39 import org.jetbrains.annotations.Nullable;
67 public void mapGridChanged(@NotNull
final MapGridEvent e) {
72 public void mapGridResized(@NotNull
final MapGridEvent e) {
108 if (mapView ==
null) {
118 if (selectedSquares.isEmpty()) {
125 final Point point =
new Point();
129 for (
int dy = -1; dy <= 1; dy++) {
130 for (
int dx = -1; dx <= 1; dx++) {
131 mapSquare.getMapLocation(point, dx, dy);
void addMapGridListener(@NotNull final MapGridListener listener)
Registers a MapGridListener.
A MapModel reflects the data of a map.
void endTransaction()
Ends a transaction.
MapGrid getMapGrid()
Returns the MapGrid of this view.
A getMapArchObject()
Returns the Map Arch Object with the meta information about the map.
void growSelection()
Grows the current map selection by one map square.
MapControl< G, A, R > getMapControl()
Return the controller of this view.
Base package of all Gridarta classes.
void setAction(@NotNull final Action action, @NotNull final String name)
Sets the Action instance for this editor action.
boolean isPointValid(@Nullable Point pos)
Checks whether the given coordinate is within map bounds.
Interface for listeners interested in events related to {} instances.
boolean doGrowSelection(final boolean performAction)
Grows the current map selection by one map square.
Rectangle getSelectedRec()
Returns the smallest rectangle containing selection.
Reflects a game object (object on a map).
void activeMapViewChanged(@Nullable final MapView< G, A, R > mapView)
This event handler is called when the current map view has changed.
void mapViewCreated(@NotNull final MapView< G, A, R > mapView)
This event handler is called when a map view was created.
MapView< G, A, R > currentMapView
The active map view, or.
An EditorAction that grows the current selection by one map square.
Graphical User Interface of Gridarta.
void beginTransaction()
Starts a new transaction.
GameObjects are the objects based on Archetypes found on maps.
void mapViewClosing(@NotNull final MapView< G, A, R > mapView)
This event handler is called when a map view is to be closed.
Interface for MapArchObjects.
Action action
The action associated with this editor action.
A map view consists of a map grid and a map cursor, and is attached to a map control.
Modes that describe how squares get selected.
void removeMapGridListener(@NotNull final MapGridListener listener)
Removes a MapGridListener.
void select(@NotNull final Point pos, @NotNull final SelectionMode selectionMode)
Selects or deselects a single square.
2D-Grid containing flags for selection, pre-selection, cursor, warnings and errors.
ADD
All squares that are preselected get selected.
void updateAction()
Updates the action's enabled state.
Base classes for rendering maps.
final MapGridListener mapGridListener
The MapGridListener attached to currentMapView.
Interface for listeners listening to MapGridEvents.
MapModel< G, A, R > getMapModel()
Returns the map model.
List< MapSquare< G, A, R > > getSelectedSquares()
Returns the selected squares.
This event is created by MapGrid.