 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.map;
22 import java.awt.Component;
23 import java.io.IOException;
25 import javax.swing.Action;
45 import net.
sf.japi.swing.action.ActionMethod;
46 import org.jetbrains.annotations.NotNull;
47 import org.jetbrains.annotations.Nullable;
136 public void mapSizeChanged(@NotNull
final Size2D newSize) {
146 public void mapObjectsChanged(@NotNull
final Set<G> gameObjects, @NotNull
final Set<G> transientGameObjects) {
156 public void mapFileChanged(@Nullable
final MapFile oldMapFile) {
161 public void modifiedChanged() {
187 public void mapCreated(@NotNull
final MapControl<G, A, R> mapControl,
final boolean interactive) {
212 public MapFileActions(@NotNull
final ImageCreator2<G, A, R> imageCreator2, @NotNull
final MapManager<G, A, R> mapManager, @NotNull
final MapViewsManager<G, A, R> mapViewsManager, @NotNull
final MapViewManager<G, A, R> mapViewManager, @NotNull
final FileControl<G, A, R> fileControl, @NotNull
final Component
mainView) {
226 public void activeMapViewChanged(@Nullable
final MapView<G, A, R> mapView) {
242 mapViewManager.addMapViewManagerListener(mapViewManagerListener);
324 private boolean doSaveMap(
final boolean performAction) {
346 if (mapControl ==
null) {
366 if (mapView ==
null) {
385 if (mapControl ==
null) {
390 if (mapFile ==
null) {
397 }
catch (
final IOException ex) {
413 if (mapView ==
null) {
425 public void setAction(@NotNull
final Action action, @NotNull
final String
name) {
448 throw new IllegalArgumentException(
"unsupported action name: " +
name);
A MapModel reflects the data of a map.
void closeMap()
Invoked when the user wants to close the map.
MapFileActions(@NotNull final ImageCreator2< G, A, R > imageCreator2, @NotNull final MapManager< G, A, R > mapManager, @NotNull final MapViewsManager< G, A, R > mapViewsManager, @NotNull final MapViewManager< G, A, R > mapViewManager, @NotNull final FileControl< G, A, R > fileControl, @NotNull final Component mainView)
Creates a new instance that tracks the map state.
A MapManager manages all opened maps.
void removeMapManagerListener(@NotNull MapManagerListener< G, A, R > listener)
Removes a MapManagerListener to be notified.
MapControl< G, A, R > getMapControl()
Return the controller of this view.
Base package of all Gridarta classes.
Interface for listeners listening to MapManager changes.
final MapManagerListener< G, A, R > mapManagerListener
The map manager listener which is attached to the current map if the current map is tracked.
final MapManager< G, A, R > mapManager
The map manager.
void saveMapAs()
Invoked when the user wants to save the map to a file.
Action aSaveMapAs
The action for "save map as".
Interface for listeners interested in events related to {} instances.
boolean saveAs(@NotNull MapControl< G, A, R > mapControl)
Asks the user for a filename, then saves the map.
final Component mainView
The main view Component.
void setAction(@NotNull final Action action, @NotNull final String name)
Sets the Action instance for this editor action.
final MapViewsManager< G, A, R > mapViewsManager
The MapViewsManager.
void addMapManagerListener(@NotNull MapManagerListener< G, A, R > listener)
Adds a MapManagerListener to be notified.
Creates images from map instances.
void reportLoadError(@Nullable File file, @NotNull String message)
Reflects a game object (object on a map).
void addMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Register a map listener.
boolean isModified()
Return whether the map has been modified from the on-disk state.
Graphical User Interface of Gridarta.
GameObjects are the objects based on Archetypes found on maps.
void createImage(@NotNull final MapModel< G, A, R > mapModel, @NotNull final Component component)
Creates an image of a map and save it as a file.
final FileControl< G, A, R > fileControl
The file control to forward actions to.
void reloadMap()
Invoked when the user wants to reload the map to the previously saved state.
void closeMapView(@NotNull final MapView< G, A, R > mapView)
Invoked when the user wants to close a map view.
boolean doSaveMap(final boolean performAction)
Executes the "save map" action.
boolean doCloseMap(final boolean performAction)
Executes the "close map" action.
void closeNotify()
Unregisters all registered listeners.
final ImageCreator2< G, A, R > imageCreator2
The ImageCreator2 to forwards actions to.
void removeMapModelListener(@NotNull MapModelListener< G, A, R > listener)
Unregister a map listener.
Interface for MapArchObjects.
File getFile()
Returns a File for this map file.
An interface for classes that collect errors.
A map view consists of a map grid and a map cursor, and is attached to a map control.
Action aReloadMap
The action for "reload map".
This package contains the framework for validating maps.
MapControl< G, A, R > getCurrentMap()
Returns the current map.
The location of a map file with a map directory.
final MapModelListener< G, A, R > mapModelListener
The MapModelListener which is attached to {}'s map model.
Interface for listeners listening on MapModel events.
boolean doReloadMap(final boolean performAction)
Executes the "reload map" action.
void createImage()
Invoked when the user wants to create an image file of the map.
boolean doCreateImage(final boolean performAction)
Executes the "create image" action.
MapControl< G, A, R > currentMapControl
The currently tracked map, or.
Base classes for rendering maps.
void revert(@NotNull MapControl< G, A, R > mapControl)
Reverts one map.
MapView< G, A, R > currentMapView
The current map view, or.
Currently nothing more than a marker interface for unification.
MapModel< G, A, R > getMapModel()
Returns the map model.
void saveMap()
Invoked when the user wants to save the map.
Action aCreateImage
The action for "create image".
void updateActions()
Updates the enabled/disabled state of all actions.
boolean save(@NotNull MapControl< G, A, R > mapControl)
Save one map.
MapFile getMapFile()
Returns the map file.
Stores all existing MapViews.
The class Size2D represents a 2d rectangular area.
Action aCloseMap
The action for "close map".
boolean doSaveMapAs(final boolean performAction)
Executes the "save map as" action.
Action aSaveMap
The action for "save map".
Implements actions for the "file" menu attached to maps.