Gridarta Editor
net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Interface Template Reference

A MapManager manages all opened maps. More...

+ Inheritance diagram for net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

Public Member Functions

void addMapManagerListener (@NotNull MapManagerListener< G, A, R > listener)
 Adds a MapManagerListener to be notified. More...
 
void closeMap (@NotNull MapControl< G, A, R > mapControl)
 Closes the given map, ignoring modified status. More...
 
MapControl< G, A, R > getCurrentMap ()
 Returns the current map. More...
 
File getLocalMapDir ()
 Returns a guess for a script directory to use. More...
 
List< MapControl< G, A, R > > getOpenedMaps ()
 Returns all opened maps. More...
 
MapControl< G, A, R > getOpenMap ()
 Returns one open map. More...
 
MapControl< G, A, R > newMap (@Nullable List< G > objects, @NotNull A mapArchObject, @Nullable MapFile mapFile, boolean interactive)
 Creates a new map control without view. More...
 
MapControl< G, A, R > openMapFile (@NotNull File file, boolean interactive) throws IOException
 Loads a map file. More...
 
MapControl< G, A, R > openMapFile (@NotNull MapFile mapFile, boolean interactive) throws IOException
 Loads a map file. More...
 
void release (@NotNull MapControl< G, A, R > mapControl)
 Releases a MapControl instance. More...
 
void removeMapManagerListener (@NotNull MapManagerListener< G, A, R > listener)
 Removes a MapManagerListener to be notified. More...
 
void revert (@NotNull MapControl< G, A, R > mapControl) throws IOException
 Reverts one map. More...
 
void setCurrentMap (@Nullable MapControl< G, A, R > mapControl)
 Sets the given map as the current one. More...
 

Detailed Description

A MapManager manages all opened maps.

Author
Christian Hujer

Definition at line 37 of file MapManager.java.

Member Function Documentation

◆ addMapManagerListener()

◆ closeMap()

void net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.closeMap ( @NotNull MapControl< G, A, R >  mapControl)

Closes the given map, ignoring modified status.

Parameters
mapControlthe map to close

Referenced by net.sf.gridarta.gui.misc.DefaultFileControl< G, A, R >.closeAllMaps(), and net.sf.gridarta.gui.map.mapview.MapViewsManager<?, ?, ?>.closeMapView().

+ Here is the caller graph for this function:

◆ getCurrentMap()

◆ getLocalMapDir()

File net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getLocalMapDir ( )

Returns a guess for a script directory to use.

Returns
the directory

Referenced by net.sf.gridarta.gui.scripts.ScriptArchEditor< G, A, R >.addEventScript(), and net.sf.gridarta.gui.scripts.ScriptArchEditor< G, A, R >.createNewEvent().

+ Here is the caller graph for this function:

◆ getOpenedMaps()

◆ getOpenMap()

MapControl<G, A, R> net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getOpenMap ( )

Returns one open map.

Returns
the map or
null
if no open maps exist

Referenced by net.sf.gridarta.gui.misc.DefaultFileControl< G, A, R >.closeAllMaps().

+ Here is the caller graph for this function:

◆ newMap()

MapControl<G, A, R> net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.newMap ( @Nullable List< G >  objects,
@NotNull A  mapArchObject,
@Nullable MapFile  mapFile,
boolean  interactive 
)

Creates a new map control without view.

The returned instance must be freed with release(MapControl) when not needed anymore.

Parameters
objectsthe game objects to insert; may be
null
mapArchObjectthe map arch object for the new map
mapFilethe map file, or
null
if the map was not yet saved
interactiveif set, the new map becomes the current map
Returns
the newly created map control

Referenced by net.sf.gridarta.gui.map.mapactions.MapActions< G, A, R >.doCreateTile(), net.sf.gridarta.gui.mapfiles.PickmapState< G, A, R >.loadPickmap(), net.sf.gridarta.gui.map.mapview.MapViewsManager<?, ?, ?>.newMapWithView(), and net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserView< G, A, R >.newPickmap().

+ Here is the caller graph for this function:

◆ openMapFile() [1/2]

MapControl<G, A, R> net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.openMapFile ( @NotNull File  file,
boolean  interactive 
) throws IOException

◆ openMapFile() [2/2]

MapControl<G, A, R> net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.openMapFile ( @NotNull MapFile  mapFile,
boolean  interactive 
) throws IOException

◆ release()

void net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.release ( @NotNull MapControl< G, A, R >  mapControl)

◆ removeMapManagerListener()

void net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.removeMapManagerListener ( @NotNull MapManagerListener< G, A, R >  listener)

◆ revert()

void net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.revert ( @NotNull MapControl< G, A, R >  mapControl) throws IOException

Reverts one map.

Parameters
mapControlthe map to revert
Exceptions
IOExceptionif an I/O error occurs

Referenced by net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doReloadMap(), and net.sf.gridarta.model.mapmanager.DefaultMapManagerTest.testRevertResizedMap().

+ Here is the caller graph for this function:

◆ setCurrentMap()

void net.sf.gridarta.model.mapmanager.MapManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setCurrentMap ( @Nullable MapControl< G, A, R >  mapControl)

Sets the given map as the current one.

Parameters
mapControlthe
MapControl
of the new current map

Referenced by net.sf.gridarta.gui.mapdesktop.MapDesktop< G, A, R >.activateAndRaiseMapView(), net.sf.gridarta.gui.mapdesktop.MapDesktop< G, A, R >.mapViewFocusGainedNotify(), and net.sf.gridarta.gui.mapdesktop.MapDesktop< G, A, R >.updateFocus().

+ Here is the caller graph for this function:

The documentation for this interface was generated from the following file: