|
Gridarta Editor
|
Maintains the state of a pickmap file. More...
Inheritance diagram for net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
Collaboration diagram for net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:Public Member Functions | |
| void | freePickmap () |
| Unloads the map file. More... | |
| File | getFile () |
| Returns the underlying map file. More... | |
| MapView< G, A, R > | getMapView () |
| Returns the MapView instance for this pickmap. More... | |
| MapControl< G, A, R > | getPickmap () |
| Returns the MapControl representing this pickmap. More... | |
| void | getUnsavedPickmaps (@NotNull final Collection< MapControl< G, A, R >> unsavedPickmaps) |
| Returns this pickmap if it has been loaded and is modified. More... | |
| void | loadPickmap () throws IOException |
| Loads the pickmap from the underlying map file. More... | |
| 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 | |
| Creates a new instance. More... | |
| void | remove (final boolean deleteFile) |
| Removes this pickmap from its folder. More... | |
| void | revert () throws IOException |
| Reverts this pickmap to its underlying map file. More... | |
| void | save () throws IOException |
| Saves this pickmap. More... | |
Static Public Member Functions | |
| static boolean | isValidPickmapName (@NotNull final CharSequence name) |
| Returns whether a pickmap name is valid. More... | |
Private Attributes | |
| final MapFolder< G, A, R > | mapFolder |
| The folder this pickmap is part of. More... | |
| final MapReaderFactory< G, A > | mapReaderFactory |
| The MapReaderFactory to use. More... | |
| final MapViewsManager< G, A, R > | mapViewsManager |
| The MapViewsManager. More... | |
| final String | name |
| The underlying map file name. More... | |
| MapControl< G, A, R > | pickmap |
| The MapControl instance representing the map file, or. More... | |
| final MapManager< G, A, R > | pickmapManager |
| The MapManager for creating new pickmaps. More... | |
| MapView< G, A, R > | pickmapView |
| The MapView or pickmap, or. More... | |
| final Object | sync = new Object() |
| The synchronization object for accessed to pickmap and pickmapView. More... | |
Static Private Attributes | |
| static final Pattern | PATTERN_VALID_PICKMAP_NAME = Pattern.compile("[-a-zA-Z_+ 0-9,]+") |
| The Pattern that matches valid pickmap names. More... | |
Maintains the state of a pickmap file.
A
is part of a MapFolder which is part of MapFolderTree. A pickmap has an underlying file from which a MapControl instance may be created.
Definition at line 45 of file PickmapState.java.
| net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.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 |
Creates a new instance.
| mapFolder | the folder ths pickmap is part of |
| name | the underlying map file name |
| mapReaderFactory | the map reader factory to use |
| pickmapManager | the map manager for creating pickmaps |
| mapViewsManager | the map views |
| InvalidNameException | if is not valid |
Definition at line 113 of file PickmapState.java.
| void net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.freePickmap | ( | ) |
Unloads the map file.
Undoes the effect of loadPickmap().
Definition at line 189 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.revert().
Here is the caller graph for this function:| File net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getFile | ( | ) |
Returns the underlying map file.
Definition at line 139 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.mapfiles.MapFileNameComparator.compare(), net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl<?, ?, ?>.doDeletePickmap(), net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl<?, ?, ?>.doOpenPickmapMap(), net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl<?, ?, ?>.doRevertPickmap(), net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.loadPickmap(), and net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl<?, ?, ?>.reloadPickmap().
Here is the caller graph for this function:| MapView<G, A, R> net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapView | ( | ) |
Returns the MapView instance for this pickmap.
Returns
unless loadPickmap() was successfully called.
Definition at line 163 of file PickmapState.java.
Here is the caller graph for this function:| MapControl<G, A, R> net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getPickmap | ( | ) |
Returns the MapControl representing this pickmap.
Returns
unless loadPickmap() was successfully called.
Definition at line 150 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl<?, ?, ?>.doRevertPickmap(), net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.revert(), net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.save(), and net.sf.gridarta.gui.panel.objectchooser.DefaultObjectChooser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.updatePickmapInfo().
Here is the caller graph for this function:| void net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getUnsavedPickmaps | ( | @NotNull final Collection< MapControl< G, A, R >> | unsavedPickmaps | ) |
Returns this pickmap if it has been loaded and is modified.
| unsavedPickmaps | the collection to add this |
Definition at line 205 of file PickmapState.java.
|
static |
Returns whether a pickmap name is valid.
| name | the name to check |
Definition at line 130 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserView< G, A, R >.newPickmap(), and net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.PickmapState().
Here is the caller graph for this function:| void net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.loadPickmap | ( | ) | throws IOException |
Loads the pickmap from the underlying map file.
| IOException | if the map file cannot be loaded |
Definition at line 173 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.revert().
Here is the caller graph for this function:| void net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.remove | ( | final boolean | deleteFile | ) |
Removes this pickmap from its folder.
| deleteFile | if set, delete the map file as well |
Definition at line 217 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl<?, ?, ?>.doDeletePickmap().
Here is the caller graph for this function:| void net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.revert | ( | ) | throws IOException |
Reverts this pickmap to its underlying map file.
Does nothing if the pickmap is not loaded.
| IOException | if the pickmap cannot be loaded |
Definition at line 238 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl<?, ?, ?>.doRevertPickmap(), and net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl<?, ?, ?>.reloadPickmap().
Here is the caller graph for this function:| void net.sf.gridarta.gui.mapfiles.PickmapState< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.save | ( | ) | throws IOException |
Saves this pickmap.
Does nothing if the pickmap is not loaded or not modified.
| IOException | if saving fails |
Definition at line 226 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl<?, ?, ?>.doSavePickmap().
Here is the caller graph for this function:
|
private |
The folder this pickmap is part of.
Definition at line 57 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.PickmapState().
|
private |
The MapReaderFactory to use.
Definition at line 75 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.PickmapState().
|
private |
The MapViewsManager.
Definition at line 95 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.PickmapState().
|
private |
The underlying map file name.
Definition at line 63 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.getFile(), and net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.PickmapState().
|
staticprivate |
The Pattern that matches valid pickmap names.
Definition at line 51 of file PickmapState.java.
|
private |
The MapControl instance representing the map file, or.
if the map file is not loaded.
Definition at line 82 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.getPickmap().
|
private |
The MapManager for creating new pickmaps.
Definition at line 69 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.PickmapState().
|
private |
if
.
Definition at line 89 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.getMapView().
|
private |
The synchronization object for accessed to pickmap and pickmapView.
Definition at line 102 of file PickmapState.java.
Referenced by net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.freePickmap(), net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.getMapView(), net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.getPickmap(), net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.getUnsavedPickmaps(), and net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.loadPickmap().