Gridarta Editor
net.sf.gridarta.model.mapmodel.MapFile Class Reference

The location of a map file with a map directory. More...

+ Inheritance diagram for net.sf.gridarta.model.mapmodel.MapFile:
+ Collaboration diagram for net.sf.gridarta.model.mapmodel.MapFile:

Public Member Functions

boolean equals (@Nullable final Object obj)
 
File getFile ()
 Returns a File for this map file. More...
 
AbsoluteMapPath getMapPath ()
 Returns the map path within getMapsDir(). More...
 
File getMapsDir ()
 Returns the base directory this map file is part of. More...
 
MapPath getRelativeMapFileTo (@NotNull final MapFile mapFile) throws DifferentMapBaseException
 Returns a map path of an another map file relative to this map file. More...
 
int hashCode ()
 
 MapFile (@NotNull final File mapsDir)
 Creates a new instance for the maps directory. More...
 
 MapFile (@NotNull final MapFile parent, @NotNull final MapPath mapPath)
 Creates a new instance. More...
 
 MapFile (@NotNull final MapFile parent, @NotNull final String name)
 Creates a new instance for a child of a parent map file. More...
 
String toString ()
 

Private Attributes

final AbsoluteMapPath mapPath
 The absolute map path within mapsDir. More...
 
final File mapsDir
 The maps directory this map file is part of. More...
 

Static Private Attributes

static final long serialVersionUID = 1L
 The serial version UID. More...
 

Detailed Description

The location of a map file with a map directory.

Author
Andreas Kirschbaum

Definition at line 31 of file MapFile.java.

Constructor & Destructor Documentation

◆ MapFile() [1/3]

net.sf.gridarta.model.mapmodel.MapFile.MapFile ( @NotNull final File  mapsDir)

Creates a new instance for the maps directory.

Parameters
mapsDirthe maps directory

Definition at line 54 of file MapFile.java.

References net.sf.gridarta.model.mapmodel.MapFile.mapPath, and net.sf.gridarta.model.mapmodel.MapFile.mapsDir.

Referenced by net.sf.gridarta.model.mapmodel.MapFile.equals().

+ Here is the caller graph for this function:

◆ MapFile() [2/3]

net.sf.gridarta.model.mapmodel.MapFile.MapFile ( @NotNull final MapFile  parent,
@NotNull final String  name 
)

Creates a new instance for a child of a parent map file.

Parameters
parentthe parent map file
namethe name of the child

Definition at line 64 of file MapFile.java.

References net.sf.gridarta.model.mapmodel.MapFile.mapPath, net.sf.gridarta.model.mapmodel.MapFile.mapsDir, and name.

◆ MapFile() [3/3]

net.sf.gridarta.model.mapmodel.MapFile.MapFile ( @NotNull final MapFile  parent,
@NotNull final MapPath  mapPath 
)

Creates a new instance.

Parameters
parentthe parent map file
mapPaththe map path

Definition at line 74 of file MapFile.java.

References net.sf.gridarta.model.mapmodel.MapPathUtils.append(), net.sf.gridarta.model.mapmodel.MapFile.mapPath, and net.sf.gridarta.model.mapmodel.MapFile.mapsDir.

+ Here is the call graph for this function:

Member Function Documentation

◆ equals()

◆ getFile()

File net.sf.gridarta.model.mapmodel.MapFile.getFile ( )

Returns a File for this map file.

Returns
the file

Definition at line 102 of file MapFile.java.

References net.sf.gridarta.model.mapmodel.AbsoluteMapPath.getPath(), net.sf.gridarta.model.mapmodel.MapFile.mapPath, and net.sf.gridarta.model.mapmodel.MapFile.mapsDir.

Referenced by net.sf.gridarta.gui.mapmenu.MapMenuAction.actionPerformed(), net.sf.gridarta.gui.map.renderer.ImageCreator2< G, A, R >.createImage(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.createMaps(), net.sf.gridarta.gui.map.maptilepane.AbstractMapTilePane< net.sf.gridarta.var.daimonin.model.gameobject.GameObject, net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject, net.sf.gridarta.var.daimonin.model.archetype.Archetype >.createTilePanels(), net.sf.gridarta.gui.map.mapactions.MapActions< G, A, R >.doCreateTile(), net.sf.gridarta.actions.ExitConnectorActions< G, A, R >.doExitConnect(), net.sf.gridarta.gui.map.MapFileActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doReloadMap(), net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserControl<?, ?, ?>.doRevertPickmap(), net.sf.gridarta.model.mapmanager.AbstractMapManager< G, A, R >.getLocalMapDir(), net.sf.gridarta.gui.mapimagecache.MapImageCache<?, ?, ?>.getOrCreate(), net.sf.gridarta.model.index.MapsIndexer< G, A, R >.indexPendingMaps(), net.sf.gridarta.gui.dialog.plugin.parameter.MapPathParameterView< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.MapPathParameterView(), net.sf.gridarta.gui.panel.pickmapchooser.PickmapChooserView< G, A, R >.newPickmap(), net.sf.gridarta.gui.misc.DefaultFileControl< G, A, R >.reportSaveError(), net.sf.gridarta.model.mapmanager.AbstractMapManager< G, A, R >.revert(), net.sf.gridarta.gui.misc.DefaultFileControl< G, A, R >.save(), net.sf.gridarta.actions.AttachTiledMaps< G, A, R >.saveAdjacentMaps(), net.sf.gridarta.gui.mapmenu.MapMenu.saveEntries(), net.sf.gridarta.gui.misc.DefaultFileControl< G, A, R >.saveMapAs(), net.sf.gridarta.model.mapmodel.MapFileTest.testGetFile1(), net.sf.gridarta.model.mapcontrol.DefaultMapControlTest.testSave1(), net.sf.gridarta.model.mapcontrol.DefaultMapControlTest.testSaveAs1(), net.sf.gridarta.gui.mapmenu.MapMenuAction.update(), net.sf.gridarta.actions.AttachTiledMaps< G, A, R >.updateTilePaths(), and net.sf.gridarta.gui.mapmenu.MapMenuEntryTreeCellRenderer.visit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMapPath()

AbsoluteMapPath net.sf.gridarta.model.mapmodel.MapFile.getMapPath ( )

◆ getMapsDir()

◆ getRelativeMapFileTo()

MapPath net.sf.gridarta.model.mapmodel.MapFile.getRelativeMapFileTo ( @NotNull final MapFile  mapFile) throws DifferentMapBaseException

Returns a map path of an another map file relative to this map file.

Parameters
mapFilethe other map file
Returns
the relative map path from this map file to the other map file
Exceptions
DifferentMapBaseExceptionif the two map files do not have the same maps directory

Definition at line 114 of file MapFile.java.

References net.sf.gridarta.model.mapmodel.MapFile.mapPath, and net.sf.gridarta.model.mapmodel.MapFile.mapsDir.

Referenced by net.sf.gridarta.model.mapmodel.MapFileTest.testGetRelativeMapFile1(), and net.sf.gridarta.model.mapmodel.MapFileTest.testGetRelativeMapFile2().

+ Here is the caller graph for this function:

◆ hashCode()

int net.sf.gridarta.model.mapmodel.MapFile.hashCode ( )

Definition at line 131 of file MapFile.java.

References net.sf.gridarta.model.mapmodel.AbsoluteMapPath.hashCode(), net.sf.gridarta.model.mapmodel.MapFile.mapPath, and net.sf.gridarta.model.mapmodel.MapFile.mapsDir.

Referenced by net.sf.gridarta.model.exitconnector.ExitLocation.hashCode().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toString()

String net.sf.gridarta.model.mapmodel.MapFile.toString ( )

Definition at line 136 of file MapFile.java.

References net.sf.gridarta.model.mapmodel.MapFile.mapPath, and net.sf.gridarta.model.mapmodel.AbsoluteMapPath.toString().

+ Here is the call graph for this function:

Member Data Documentation

◆ mapPath

◆ mapsDir

◆ serialVersionUID

final long net.sf.gridarta.model.mapmodel.MapFile.serialVersionUID = 1L
staticprivate

The serial version UID.

Definition at line 36 of file MapFile.java.


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