|
Gridarta Editor
|
Implements map models. More...
Inheritance diagram for net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
Collaboration diagram for net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:Public Member Functions | |
| void | acquire () |
| void | addMapControlListener (@NotNull final MapControlListener< G, A, R > listener) |
| DefaultMapControl (@NotNull final MapModel< G, A, R > mapModel, final boolean isPickmap, @NotNull final MapWriter< G, A, R > mapWriter, @NotNull final ProjectSettings projectSettings) | |
| Creates a new instance. More... | |
| MapModel< G, A, R > | getMapModel () |
| int | getUseCounter () |
| boolean | isPickmap () |
| void | release () |
| void | removeMapControlListener (@NotNull final MapControlListener< G, A, R > listener) |
| void | save () throws IOException |
| void | saveAs (@NotNull final MapFile mapFile) throws IOException |
Public Member Functions inherited from net.sf.gridarta.model.mapcontrol.MapControl< G, A, R > | |
| void | acquire () |
| Increases the use counter. More... | |
| void | addMapControlListener ( @NotNull MapControlListener< G, A, R > listener) |
| Registers a MapControlListener. More... | |
| MapModel< G, A, R > | getMapModel () |
| Returns the map model. More... | |
| int | getUseCounter () |
| Returns the use counter. More... | |
| boolean | isPickmap () |
| Return flag that indicates whether this is a pickmap or not. More... | |
| void | release () |
| Decreases the use counter and possibly frees the map control. More... | |
| void | removeMapControlListener ( @NotNull MapControlListener< G, A, R > listener) |
| Unregisters a MapControlListener. More... | |
| void | save () throws IOException |
| Saves the map to a file. More... | |
| void | saveAs ( @NotNull MapFile mapFile) throws IOException |
| Saves the file with the given map file. More... | |
Private Member Functions | |
| void | encodeMapFile (@NotNull final File file) throws IOException |
| Saves the map. More... | |
| void | save (@NotNull final MapFile mapFile) throws IOException |
| Updates the maps "Updated:" flag, saves it into the given MapFile, resets its modified and notifies all listeners about the save. More... | |
Private Attributes | |
| final boolean | isPickmap |
| Flag that indicates whether this is a pickmap or not. More... | |
| final EventListenerList2< MapControlListener< G, A, R > > | listenerList = new EventListenerList2<>(MapControlListener.class) |
| The registered event listeners. More... | |
| final MapModel< G, A, R > | mapModel |
| The MapModel. More... | |
| final MapWriter< G, A, R > | mapWriter |
| The MapWriter for saving this map. More... | |
| final ProjectSettings | projectSettings |
| The ProjectSettings to use. More... | |
| int | useCounter = 1 |
| The use counter. More... | |
Implements map models.
Definition at line 43 of file DefaultMapControl.java.
| net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.DefaultMapControl | ( | @NotNull final MapModel< G, A, R > | mapModel, |
| final boolean | isPickmap, | ||
| @NotNull final MapWriter< G, A, R > | mapWriter, | ||
| @NotNull final ProjectSettings | projectSettings | ||
| ) |
Creates a new instance.
| mapModel | the map model to use |
| isPickmap | true if this is a pickmap |
| mapWriter | the map writer for saving map control instances |
| projectSettings | the project settings to use |
Definition at line 87 of file DefaultMapControl.java.
References net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isPickmap(), net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapModel, net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapWriter, and net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.projectSettings.
Here is the call graph for this function:| void net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.acquire | ( | ) |
Definition at line 105 of file DefaultMapControl.java.
| void net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addMapControlListener | ( | @NotNull final MapControlListener< G, A, R > | listener | ) |
Definition at line 95 of file DefaultMapControl.java.
References net.sf.gridarta.utils.EventListenerList2< T extends EventListener >.add().
Here is the call graph for this function:
|
private |
Saves the map.
| file | the file to save to |
| IOException | if encoding fails |
Definition at line 130 of file DefaultMapControl.java.
References net.sf.gridarta.model.io.MapWriter< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.encodeMapFile(), and net.sf.gridarta.utils.IOUtils.MAP_ENCODING.
Here is the call graph for this function:
Here is the caller graph for this function:| MapModel<G, A, R> net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapModel | ( | ) |
| int net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getUseCounter | ( | ) |
| boolean net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isPickmap | ( | ) |
| void net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.release | ( | ) |
Definition at line 110 of file DefaultMapControl.java.
| void net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.removeMapControlListener | ( | @NotNull final MapControlListener< G, A, R > | listener | ) |
Definition at line 100 of file DefaultMapControl.java.
References net.sf.gridarta.utils.EventListenerList2< T extends EventListener >.remove().
Here is the call graph for this function:| void net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.save | ( | ) | throws IOException |
Definition at line 143 of file DefaultMapControl.java.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Updates the maps "Updated:" flag, saves it into the given MapFile, resets its modified and notifies all listeners about the save.
| mapFile | the map file |
| IOException | if an I/O error occurs |
Definition at line 163 of file DefaultMapControl.java.
References net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.encodeMapFile(), net.sf.gridarta.utils.EventListenerList2< T extends EventListener >.getListeners(), net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapArchObject(), net.sf.gridarta.model.settings.ProjectSettings.getUserName(), net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isModified(), and net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.resetModified().
Here is the call graph for this function:| void net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.saveAs | ( | @NotNull final MapFile | mapFile | ) | throws IOException |
Definition at line 152 of file DefaultMapControl.java.
References net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.save(), and net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setMapFile().
Here is the call graph for this function:
|
private |
Flag that indicates whether this is a pickmap or not.
Definition at line 60 of file DefaultMapControl.java.
|
private |
The registered event listeners.
Definition at line 49 of file DefaultMapControl.java.
|
private |
The MapModel.
Definition at line 66 of file DefaultMapControl.java.
Referenced by net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.DefaultMapControl(), and net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapModel().
|
private |
The MapWriter for saving this map.
Definition at line 72 of file DefaultMapControl.java.
|
private |
The ProjectSettings to use.
Definition at line 78 of file DefaultMapControl.java.
|
private |
The use counter.
The instance is freed when it reaches zero and if there are no map views.
Definition at line 55 of file DefaultMapControl.java.