 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.mapfiles;
23 import java.io.IOException;
24 import java.util.Collection;
25 import java.util.regex.Pattern;
36 import org.jetbrains.annotations.NotNull;
37 import org.jetbrains.annotations.Nullable;
102 private final Object
sync =
new Object();
113 public PickmapState(@NotNull
final MapFolder<G, A, R> mapFolder, @NotNull
final String
name, @NotNull
final MapReaderFactory<G, A> mapReaderFactory, @NotNull
final MapManager<G, A, R> pickmapManager, @NotNull
final MapViewsManager<G, A, R> mapViewsManager)
throws InvalidNameException {
151 synchronized (
sync) {
164 synchronized (
sync) {
174 synchronized (
sync) {
190 synchronized (
sync) {
206 synchronized (
sync) {
217 public void remove(
final boolean deleteFile) {
226 public void save() throws IOException {
238 public void revert() throws IOException {
240 if (oldPickmap !=
null) {
void freePickmap()
Unloads the map file.
void getUnsavedPickmaps(@NotNull final Collection< MapControl< G, A, R >> unsavedPickmaps)
Returns this pickmap if it has been loaded and is modified.
File getFile()
Returns the underlying map file.
Interface for classes that read map files.
A MapManager manages all opened maps.
Base package of all Gridarta classes.
MapView< G, A, R > getMapView()
Returns the MapView instance for this pickmap.
void revert()
Reverts this pickmap to its underlying map file.
A factory for creating MapReader instances.
MapView< G, A, R > pickmapView
The MapView or pickmap, or.
static boolean isValidPickmapName(@NotNull final CharSequence name)
Returns whether a pickmap name is valid.
void loadPickmap()
Loads the pickmap from the underlying map file.
MapControl< G, A, R > newMap(@Nullable List< G > objects, @NotNull A mapArchObject, @Nullable MapFile mapFile, boolean interactive)
Creates a new map control without view.
List< G > getGameObjects()
Return the decoded game objects.
Reflects a game object (object on a map).
boolean isModified()
Return whether the map has been modified from the on-disk state.
final MapManager< G, A, R > pickmapManager
The MapManager for creating new pickmaps.
MapReader< G, A > newMapReader(@NotNull File file)
Creates a new MapReader instance.
Graphical User Interface of Gridarta.
void closeView(@NotNull final MapView< G, A, R > mapView)
Closes a view of a MapControl.
File getDir()
Returns the base directory.
void save()
Saves this pickmap.
GameObjects are the objects based on Archetypes found on maps.
Indicates that a folder or pickmap name is invalid.
void firePickmapReverted(@NotNull final PickmapState< G, A, R > pickmapState, @NotNull final MapControl< G, A, R > oldPickmap)
Notifies all listeners about a reverted pickmap.
Interface for MapArchObjects.
MapControl< G, A, R > pickmap
The MapControl instance representing the map file, or.
A map view consists of a map grid and a map cursor, and is attached to a map control.
final String name
The underlying map file name.
void save()
Saves the map to a file.
The location of a map file with a map directory.
MapView< G, A, R > newMapView(@NotNull final MapControl< G, A, R > mapControl, @Nullable final Point viewPosition)
Creates a new map view.
Reading and writing of maps, handling of paths.
Maintains the state of a pickmap file.
void release(@NotNull MapControl< G, A, R > mapControl)
Releases a MapControl instance.
PickmapState(@NotNull final MapFolder< G, A, R > mapFolder, @NotNull final String name, @NotNull final MapReaderFactory< G, A > mapReaderFactory, @NotNull final MapManager< G, A, R > pickmapManager, @NotNull final MapViewsManager< G, A, R > mapViewsManager)
Creates a new instance.
static final Pattern PATTERN_VALID_PICKMAP_NAME
The Pattern that matches valid pickmap names.
Base classes for rendering maps.
void removePickmap(@NotNull final PickmapState< G, A, R > pickmapState, final boolean deleteFile)
Removes a PickmapState from this folder.
final MapReaderFactory< G, A > mapReaderFactory
The MapReaderFactory to use.
final Object sync
The synchronization object for accessed to pickmap and {}.
Currently nothing more than a marker interface for unification.
MapModel< G, A, R > getMapModel()
Returns the map model.
A getMapArchObject()
Returns the MapArchObject read from this MapFileDecode.
Stores all existing MapViews.
MapControl< G, A, R > getPickmap()
Returns the MapControl representing this pickmap.
final MapViewsManager< G, A, R > mapViewsManager
The MapViewsManager.
final MapFolder< G, A, R > mapFolder
The folder this pickmap is part of.