20 package net.sf.gridarta.gui.map.mapview;
22 import java.util.HashMap;
38 import org.jetbrains.annotations.NotNull;
39 import org.jetbrains.annotations.Nullable;
80 public void mapSizeChanged(@NotNull
final Size2D newSize) {
90 public void mapObjectsChanged(@NotNull
final Set<G> gameObjects, @NotNull
final Set<G> transientGameObjects) {
100 public void mapFileChanged(@Nullable
final MapFile oldMapFile) {
105 public void modifiedChanged() {
122 this.mapModel.addMapModelListener(mapModelListener);
138 erroneousMapSquares.clear();
144 erroneousMapSquares.put(mapSquare, validationError);
145 mapGrid.
setError(mapSquare.getMapX(), mapSquare.getMapY());
147 for (
final G gameObject : validationError.getGameObjects()) {
Tracks a MapModel for changed erroneous map squares and updates a MapGrid and an AbstractMapRenderer ...
void setErroneousMapSquares(@NotNull final Map< MapSquare< G, A, R >, ValidationError< G, A, R >> erroneousMapSquares)
Sets the MapSquares that are known to contain errors.
void resize(@NotNull final Size2D newSize)
Resizes the MapGrid.
A MapModel reflects the data of a map.
Graphical User Interface of Gridarta.
This package contains the framework for validating maps.
Interface for listeners listening on MapModel events.
void errorsChanged(@NotNull final ErrorCollector< G, A, R > errors)
Updates the erroneous map squares.
final Map< MapSquare< G, A, R >, ValidationError< G, A, R > > erroneousMapSquares
The erroneous MapSquares.
final MapModel< G, A, R > mapModel
The MapModel to track.
final MapGrid mapGrid
The MapGrid to mark.
void setError(final int x, final int y)
Sets the error flag at given coordinates.
Super class of all errors that could occur during map validation.
int getMapX()
Returns the X coordinate of this GameObject on its map.
Base package of all Gridarta classes.
Abstract base class for classes implementing MapRenderer.
Reflects a game object (object on a map).
int getMapY()
Returns the Y coordinate of this GameObject on its map.
final MapModelListener< G, A, R > mapModelListener
The MapModelListener attached to mapModel.
GameObjects are the objects based on Archetypes found on maps.
2D-Grid containing flags for selection, pre-selection, cursor, warnings and errors.
Base classes for rendering maps.
void beginTransaction()
Starts a new transaction.
void removeMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Unregister a map listener.
void clearErrors()
Clears all error flags.
final AbstractMapRenderer< G, A, R > renderer
The AbstractMapRenderer to notify.
void closeNotify()
Must be called when this instance is not used anymore.
void endTransaction()
Ends a transaction.
An interface for classes that collect errors.
ErroneousMapSquares(@NotNull final MapModel< G, A, R > mapModel, @NotNull final MapGrid mapGrid, @NotNull final AbstractMapRenderer< G, A, R > renderer)
Creates a new instance.
The location of a map file with a map directory.
Interface for MapArchObjects.
The class Size2D represents a 2d rectangular area.