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

A MapModel reflects the data of a map. More...

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

Public Member Functions

void addActiveEditType (int editType)
 Add edit type to the bitmask of active types. More...
 
void addGameObjectToMap (@NotNull G gameObject, @NotNull Point pos, @NotNull InsertionMode< G, A, R > insertionMode)
 Add a gameObject to the map. More...
 
void addMapModelListener (@NotNull MapModelListener< G, A, R > listener)
 Register a map listener. More...
 
void addMapTransactionListener (@NotNull MapTransactionListener< G, A, R > listener)
 Registers a map transaction listener. More...
 
void addObjectListToMap (@NotNull Iterable< G > objects)
 Adds a list of GameObjects to this map. More...
 
void beginGameObjectChange (@NotNull G gameObject)
 Method to notify the model that a game object is about to change. More...
 
void beginSquareChange (@NotNull MapSquare< G, A, R > mapSquare)
 Method to notify the model that a map square is about to change. More...
 
void beginTransaction (@NotNull String name)
 Starts a new transaction. More...
 
void clearMap ()
 Clears this map completely. More...
 
void endAllTransactions ()
 Ends all transaction. More...
 
void endGameObjectChange (@NotNull G gameObject)
 Method to notify the model that a game object was changed. More...
 
void endSquareChange (@NotNull MapSquare< G, A, R > mapSquare)
 Method to notify the model that a map square was changed. More...
 
void endTransaction ()
 End a transaction. More...
 
void endTransaction (boolean fireEvent)
 End a transaction. More...
 
void facesReloaded ()
 Will be called whenever the archetype faces have been reloaded. More...
 
List< G > getAllGameObjects ()
 Returns all game objects. More...
 
ErrorCollector< G, A, R > getErrors ()
 Gets the errors in this map. More...
 
getMapArchObject ()
 Returns the Map Arch Object with the meta information about the map. More...
 
MapFile getMapFile ()
 Returns the map file. More...
 
MapFile getMapFile (@NotNull MapPath mapPath) throws SameMapException, UnsavedMapException
 Returns the map file for a map that can be reached by following a MapPath from this map. More...
 
MapSquare< G, A, R > getMapSquare (@NotNull Point pos)
 Get the square at a specified location. More...
 
int getTransactionDepth ()
 Get the transaction depth, which is the number of beginTransaction(String) invocations without matching endTransaction() invocations. More...
 
insertArchToMap (@NotNull BaseObject< G, A, R, ?> templateBaseObject, @Nullable G nextGameObject, @NotNull Point pos, boolean join)
 Insert a game object to the map at a specified position. More...
 
insertBaseObject (@NotNull BaseObject< G, A, R, ?> baseObject, @NotNull Point pos, boolean allowMany, boolean join, @NotNull InsertionMode< G, A, R > insertionMode)
 Inserts a BaseObject to a map. More...
 
boolean isAnyTransactionActive ()
 Returns whether a transaction is currently active. More...
 
boolean isAreaEmpty (int left, int top, int width, int height)
 Checks whether an area of a map is completely empty. More...
 
boolean isEmpty ()
 Returns whether the map is empty. More...
 
boolean isModified ()
 Return whether the map has been modified from the on-disk state. More...
 
boolean isMultiArchFittingToMap (@NotNull Archetype< G, A, R > archetype, @NotNull Point pos, boolean allowDouble)
 Checks whether an GameObject (multi-arch) would still fit on this map. More...
 
void mapClosed ()
 This function must be called if this instance is freed. More...
 
void moveEnv (@NotNull G gameObject, @NotNull Point pos, @NotNull G nextGameObject)
 Moves a GameObject to its environment. More...
 
void moveInv (@NotNull G gameObject, @NotNull GameObject< G, A, R > prevGameObject)
 Moves a GameObject to the inventory of another game object. More...
 
void nextPoint (Point point, int direction)
 Moves the given point forward or backward one map square. More...
 
void removeGameObject (@NotNull G gameObject, boolean join)
 Delete an existing GameObject from the map. More...
 
void removeMapModelListener (@NotNull MapModelListener< G, A, R > listener)
 Unregister a map listener. More...
 
void removeMapTransactionListener (@NotNull MapTransactionListener< G, A, R > listener)
 Unregisters a map transaction listener. More...
 
void resetModified ()
 Resets the modified flag to false. More...
 
void setErrors (@NotNull ErrorCollector< G, A, R > errors)
 Sets the errors in this map. More...
 
void setMapFile (@Nullable MapFile mapFile)
 Sets the map file. More...
 
void transientGameObjectChange (@NotNull G gameObject)
 Method to notify the model that a game object was changed but need not be restored by undo/redo. More...
 

Detailed Description

A MapModel reflects the data of a map.

This MapModel interface covers the similarities between the current CFEditor and DaiEditor implementations.

Transaction System

The purpose of the transaction system in MapModel is to allow several subsequent changes to the model to be collected as a single big change before the registered listeners (usually the user interface) gets notified. This prevents the user interface from performing hundreds of updates when a single one would be enough. The transaction system will also be used for implementing undo / redo.

Concurrency

It's not purpose of the transaction system to provide concurrent transactions for concurrent threads. A MapModel will protect itself against concurrent modification.

Performance

The transaction system is efficient-safe. The following operations are very cheap:

  • Beginning a nested transaction
  • Ending a nested transaction
  • Ending an outermost transaction without having changed something

Whether beginning the outermost transaction will be a cheap operation is not yet decided.

Transactions are recorded.

It is not (yet?) the purpose of the transaction system to provide real transactions (ACID). Queries to the MapModel during an ongoing transaction will reflect the intermediate state. And there is no rollback yet, but this is planned for future as it's required for undo anyway.

Future

The following features are not yet implemented but planned.

Undo System

The transaction system will serve as a base for an undo / redo system. Beginning the outermost transaction stores a new undo record in the undo buffer. An undo record consists of the transaction's name plus the current map state.

Author
Christian Hujer
Invariant
!isAnyTransactionActive() || getTransactionDepth() > 0

Definition at line 75 of file MapModel.java.

Member Function Documentation

◆ addActiveEditType()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addActiveEditType ( int  editType)

Add edit type to the bitmask of active types.

If this is a new type, it gets calculated for every arch on the map. Once it is calculated, we save that state in 'activeEditType' so we don't need to do it again.

Parameters
editTypenew edit type

Referenced by net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testEditType1().

+ Here is the caller graph for this function:

◆ addGameObjectToMap()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addGameObjectToMap ( @NotNull G  gameObject,
@NotNull Point  pos,
@NotNull InsertionMode< G, A, R >  insertionMode 
)

◆ addMapModelListener()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addMapModelListener ( @NotNull MapModelListener< G, A, R >  listener)

◆ addMapTransactionListener()

◆ addObjectListToMap()

◆ beginGameObjectChange()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.beginGameObjectChange ( @NotNull G  gameObject)

Method to notify the model that a game object is about to change.

Parameters
gameObjectthe game object that is about to change

Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.notifyBeginChange().

+ Here is the caller graph for this function:

◆ beginSquareChange()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.beginSquareChange ( @NotNull MapSquare< G, A, R >  mapSquare)

Method to notify the model that a map square is about to change.

Parameters
mapSquarethe map square that is about to change

Referenced by net.sf.gridarta.model.mapmodel.MapSquare< G, A, R >.beginSquareChange(), and net.sf.gridarta.model.mapmodel.MapSquare< G, A, R >.notifyBeginChange().

+ Here is the caller graph for this function:

◆ beginTransaction()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.beginTransaction ( @NotNull String  name)

Starts a new transaction.

Transactions may be nested. Transactions serve the purpose of firing events to the views when more changes are known to come before the view is really required to update. Each invocation of this function requires its own invocation of endTransaction().

A transaction has a name. The name of the outermost transaction is used as a String presented to the user for undoing the operation enclosed by that transaction.

Beginning a nested transaction is a cheap operation.

Parameters
namethe name of the transaction
See also
endTransaction()
endTransaction(boolean)
endAllTransactions()
getTransactionDepth()
isAnyTransactionActive()

Referenced by net.sf.gridarta.gui.panel.gameobjectattributes.GameObjectAttributesControl< G, A, R >.applyArchPanelChanges(), net.sf.gridarta.gui.dialog.gameobjectattributes.GameObjectAttributesDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.applySettings(), net.sf.gridarta.gui.mainwindow.GameObjectTextEditorTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.autoApplyArchPanelChanges(), net.sf.gridarta.action.CleanCompletelyBlockedSquaresAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.cleanCompletelyBlockedSquares(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.copyNCut(), net.sf.gridarta.gui.panel.tools.DeletionTool< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.deleteArch(), net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.deleteSelectedGameObject(), net.sf.gridarta.gui.panel.gameobjectattributes.ArchTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.direction(), net.sf.gridarta.action.MoveSquareBottomAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.action.MoveSquareDownAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.action.MoveSquareTopAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.action.MoveSquareUpAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.action.MoveSquareInvAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.action.MoveSquareEnvAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.gui.panel.gameobjectattributes.EventsTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAddNewEvent(), net.sf.gridarta.gui.map.mapactions.MapActions< G, A, R >.doDeleteUnknownObjects(), net.sf.gridarta.gui.panel.gameobjectattributes.EventsTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doEditEvent(), net.sf.gridarta.gui.panel.tools.InsertionTool< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doInsert(), net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doMassChange(), net.sf.gridarta.gui.dialog.replace.ReplaceDialog< G, A, R >.doReplace(), net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.insertGameObject(), net.sf.gridarta.gui.panel.gameobjectattributes.GameObjectAttributesControl< G, A, R >.mapArchAddEnv(), net.sf.gridarta.gui.panel.gameobjectattributes.GameObjectAttributesControl< G, A, R >.mapArchAddInv(), net.sf.gridarta.var.daimonin.gui.mappropertiesdialog.MapPropertiesDialog.modifyMapProperties(), net.sf.gridarta.var.atrinik.gui.mappropertiesdialog.MapPropertiesDialog.modifyMapProperties(), net.sf.gridarta.var.crossfire.gui.mappropertiesdialog.MapPropertiesDialog.modifyMapProperties(), net.sf.gridarta.model.mapcontrol.TestMapControlFactory.newMapControl(), net.sf.gridarta.var.atrinik.model.mapcontrol.DefaultMapControlFactory.newMapControl(), net.sf.gridarta.var.daimonin.model.mapcontrol.DefaultMapControlFactory.newMapControl(), net.sf.gridarta.var.crossfire.model.mapcontrol.DefaultMapControlFactory.newMapControl(), net.sf.gridarta.var.daimonin.model.mapcontrol.DefaultMapControlFactory.newPickmapControl(), net.sf.gridarta.var.crossfire.model.mapcontrol.DefaultMapControlFactory.newPickmapControl(), net.sf.gridarta.var.atrinik.model.mapcontrol.DefaultMapControlFactory.newPickmapControl(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.paste(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.pasteTiled(), net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.shift(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testAddGameObjectToMap1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testAddGameObjectToMap2(), net.sf.gridarta.gui.copybuffer.CopyBufferTest.testCutPaste1(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareBottomMulti(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareBottomSingle(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareDownMulti(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareDownSingle(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareEnvMulti3(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareEnvMulti4(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareEnvSingle1(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareEnvSingle2(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareEnvSingle3(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareInvIntoHead1(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareInvMulti1(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareInvSingle1(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareTopMulti(), net.sf.gridarta.model.gameobject.GameObjectFactoryTest.testDoMoveSquareTopSingle(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareTopSingle(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareUpMulti(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareUpSingle(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testEditType1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testEmpty(), net.sf.gridarta.actions.ExitConnectorActionsTest.testExitConnect1(), net.sf.gridarta.actions.ExitConnectorActionsTest.testExitPaste1(), net.sf.gridarta.model.floodfill.FillUtilsTest.testFillAdjacent(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testGetAllGameObjects1(), net.sf.gridarta.actions.UndoActionsTest.testInsert1(), net.sf.gridarta.model.autojoin.AutojoinListsTest.testInsert1(), net.sf.gridarta.model.autojoin.AutojoinListsTest.testInsertAlt1(), net.sf.gridarta.model.autojoin.AutojoinListsTest.testInsertAlt2(), net.sf.gridarta.model.autojoin.AutojoinListsTest.testInsertAlt3(), net.sf.gridarta.model.autojoin.AutojoinListsTest.testInsertDuplicate1(), net.sf.gridarta.model.autojoin.AutojoinListsTest.testInsertReplace1(), net.sf.gridarta.model.mapmodel.AutoInsertionModeTest.testInsertSystemObject1(), net.sf.gridarta.model.mapmodel.AutoInsertionModeTest.testInsertSystemObject2(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testModifiedGameObject1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testModifiedGameObject2(), net.sf.gridarta.action.SelectedSquareActionsTest.testMoveTailPart(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintAlign1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintAlign2(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintCombined1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintNormal(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZ1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZ2(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom2(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom3(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom4(), net.sf.gridarta.actions.ExitConnectorActionsTest.testPath(), net.sf.gridarta.model.autojoin.AutojoinListsTest.testRemove1(), net.sf.gridarta.model.autojoin.AutojoinListsTest.testRemoveAlt1(), net.sf.gridarta.model.autojoin.AutojoinListsTest.testRemoveAlt2(), net.sf.gridarta.model.autojoin.AutojoinListsTest.testRemoveAlt3(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap2(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap3(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap4(), net.sf.gridarta.model.mapmanager.DefaultMapManagerTest.testRevertResizedMap(), net.sf.gridarta.model.mapcontrol.DefaultMapControlTest.testSaveAs1(), net.sf.gridarta.model.baseobject.AbstractBaseObjectTest.testSetObjectTextAttributeOrdering(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testUpdateDirectionOnInsert(), net.sf.gridarta.model.gameobject.GameObjectFactoryTest.testUpdateFaceInformation(), net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.tileStretching(), and net.sf.gridarta.actions.AttachTiledMaps< G, A, R >.updateTilePaths().

◆ clearMap()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.clearMap ( )

Clears this map completely.

After invoking this method, no objects will remain on this map.

◆ endAllTransactions()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.endAllTransactions ( )

Ends all transaction.

Invoking this method will reduce set the transaction depth to 0. You shouldn't invoke this method regularly. It is meant as a fallback in high level methods / exception handlers to prevent errors from causing unclosed transactions.

See also
#beginTransaction(String)
endTransaction()
endTransaction(boolean)
getTransactionDepth()
isAnyTransactionActive()

◆ endGameObjectChange()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.endGameObjectChange ( @NotNull G  gameObject)

Method to notify the model that a game object was changed.

A change to a game object is atomic if getTransactionDepth() returns 0, otherwise it is transactional. The model then notifies the registered listeners of the changes.

Parameters
gameObjectthe game object that has changed

Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.notifyEndChange().

+ Here is the caller graph for this function:

◆ endSquareChange()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.endSquareChange ( @NotNull MapSquare< G, A, R >  mapSquare)

Method to notify the model that a map square was changed.

A change to a square is atomic if getTransactionDepth() returns 0, otherwise it is transactional. The model then notifies the registered listeners of the changes.

Parameters
mapSquarethe map square that has changed

Referenced by net.sf.gridarta.model.mapmodel.MapSquare< G, A, R >.endSquareChange(), and net.sf.gridarta.model.mapmodel.MapSquare< G, A, R >.notifyEndChange().

+ Here is the caller graph for this function:

◆ endTransaction() [1/2]

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.endTransaction ( )

End a transaction.

Invoking this method will reduce the transaction depth by only 1.

Ending a nested operation is a cheap operation. Ending a transaction without changes also is a cheap operation.

If the last transaction is ended, the changes are committed.

Same as endTransaction(false).

See also
#beginTransaction(String)
endTransaction(boolean)
endAllTransactions()
getTransactionDepth()
isAnyTransactionActive()

Referenced by net.sf.gridarta.gui.panel.gameobjectattributes.GameObjectAttributesControl< G, A, R >.applyArchPanelChanges(), net.sf.gridarta.gui.dialog.gameobjectattributes.GameObjectAttributesDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.applySettings(), net.sf.gridarta.gui.mainwindow.GameObjectTextEditorTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.autoApplyArchPanelChanges(), net.sf.gridarta.action.CleanCompletelyBlockedSquaresAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.cleanCompletelyBlockedSquares(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.copyNCut(), net.sf.gridarta.gui.panel.tools.DeletionTool< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.deleteArch(), net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.deleteSelectedGameObject(), net.sf.gridarta.gui.panel.gameobjectattributes.ArchTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.direction(), net.sf.gridarta.action.MoveSquareBottomAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.action.MoveSquareDownAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.action.MoveSquareTopAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.action.MoveSquareUpAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.action.MoveSquareInvAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.action.MoveSquareEnvAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction(), net.sf.gridarta.gui.panel.gameobjectattributes.EventsTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAddNewEvent(), net.sf.gridarta.gui.panel.gameobjectattributes.EventsTab< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doEditEvent(), net.sf.gridarta.gui.panel.tools.InsertionTool< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doInsert(), net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doMassChange(), net.sf.gridarta.gui.dialog.replace.ReplaceDialog< G, A, R >.doReplace(), net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.insertGameObject(), net.sf.gridarta.gui.panel.gameobjectattributes.GameObjectAttributesControl< G, A, R >.mapArchAddEnv(), net.sf.gridarta.gui.panel.gameobjectattributes.GameObjectAttributesControl< G, A, R >.mapArchAddInv(), net.sf.gridarta.var.daimonin.gui.mappropertiesdialog.MapPropertiesDialog.modifyMapProperties(), net.sf.gridarta.var.atrinik.gui.mappropertiesdialog.MapPropertiesDialog.modifyMapProperties(), net.sf.gridarta.var.crossfire.gui.mappropertiesdialog.MapPropertiesDialog.modifyMapProperties(), net.sf.gridarta.model.mapcontrol.TestMapControlFactory.newMapControl(), net.sf.gridarta.var.atrinik.model.mapcontrol.DefaultMapControlFactory.newMapControl(), net.sf.gridarta.var.daimonin.model.mapcontrol.DefaultMapControlFactory.newMapControl(), net.sf.gridarta.var.crossfire.model.mapcontrol.DefaultMapControlFactory.newMapControl(), net.sf.gridarta.var.daimonin.model.mapcontrol.DefaultMapControlFactory.newPickmapControl(), net.sf.gridarta.var.crossfire.model.mapcontrol.DefaultMapControlFactory.newPickmapControl(), net.sf.gridarta.var.atrinik.model.mapcontrol.DefaultMapControlFactory.newPickmapControl(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.paste(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.pasteTiled(), net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.shift(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testAddGameObjectToMap1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testAddGameObjectToMap2(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testEditType1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testEmpty(), net.sf.gridarta.actions.ExitConnectorActionsTest.testExitConnect1(), net.sf.gridarta.actions.ExitConnectorActionsTest.testExitPaste1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testGetAllGameObjects1(), net.sf.gridarta.actions.UndoActionsTest.testInsert1(), net.sf.gridarta.model.mapmodel.AutoInsertionModeTest.testInsertSystemObject1(), net.sf.gridarta.model.mapmodel.AutoInsertionModeTest.testInsertSystemObject2(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testModifiedGameObject1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testModifiedGameObject2(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintAlign1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintAlign2(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintCombined1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintNormal(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZ1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZ2(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom2(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom3(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom4(), net.sf.gridarta.actions.ExitConnectorActionsTest.testPath(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap2(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap3(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap4(), net.sf.gridarta.model.mapmanager.DefaultMapManagerTest.testRevertResizedMap(), net.sf.gridarta.model.mapcontrol.DefaultMapControlTest.testSaveAs1(), net.sf.gridarta.model.baseobject.AbstractBaseObjectTest.testSetObjectTextAttributeOrdering(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testUpdateDirectionOnInsert(), net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.tileStretching(), and net.sf.gridarta.actions.AttachTiledMaps< G, A, R >.updateTilePaths().

◆ endTransaction() [2/2]

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.endTransaction ( boolean  fireEvent)

End a transaction.

Invoking this method will reduce the transaction depth by only 1.

Ending a nested operation is a cheap operation. Ending a transaction without changes also is a cheap operation.

If the last transaction is ended, the changes are committed.

An example where setting

fireEvent

to

true

is useful even though the outermost transaction is not ended is when during painting the UI should be updated though painting is not finished.

Parameters
fireEvent

◆ facesReloaded()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.facesReloaded ( )

Will be called whenever the archetype faces have been reloaded.

◆ getAllGameObjects()

List<G> net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getAllGameObjects ( )

Returns all game objects.

Only top-level head parts are returned; tail parts are ignored as are objects in inventories.

Returns
all game objects

Referenced by net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.getAllGameObjects(), net.sf.gridarta.gui.map.mapview.AbstractMapView< TestGameObject, TestMapArchObject, TestArchetype >.getSelectedGameObjects(), and net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testGetAllGameObjects1().

+ Here is the caller graph for this function:

◆ getErrors()

ErrorCollector<G, A, R> net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getErrors ( )

◆ getMapArchObject()

A net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapArchObject ( )

Returns the Map Arch Object with the meta information about the map.

Returns
the map arch object with the meta information about the map

Referenced by net.sf.gridarta.gui.map.mapactions.MapActions< G, A, R >.activeMapViewChanged(), net.sf.gridarta.gui.map.renderer.AbstractSimpleIsoMapRenderer< G, A, R >.calculateOrigin(), net.sf.gridarta.gui.map.mapview.DefaultMapView< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.closeNotify(), net.sf.gridarta.model.mapcursor.MapCursorTest.createCursor(), net.sf.gridarta.var.daimonin.gui.mappropertiesdialog.MapPropertiesDialog.createMapPanel(), net.sf.gridarta.var.atrinik.gui.mappropertiesdialog.MapPropertiesDialog.createMapPanel(), net.sf.gridarta.var.crossfire.gui.mappropertiesdialog.MapPropertiesDialog.createMapPanel(), net.sf.gridarta.model.mapcontrol.TestMapControlCreator.createMaps(), net.sf.gridarta.gui.dialog.golocation.GoLocationDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.createPanel(), net.sf.gridarta.action.AddBookmarkAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAddBookmark(), net.sf.gridarta.gui.map.mapactions.MapActions< G, A, R >.doCreateTile(), net.sf.gridarta.gui.map.mapactions.MapActions< G, A, R >.doEnterMap(), net.sf.gridarta.actions.ExitConnectorActions< G, A, R >.doExitCopy(), net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExpandEmptySelection(), net.sf.gridarta.action.GrowSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doGrowSelection(), net.sf.gridarta.gui.panel.tools.InsertionTool< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doInsert(), net.sf.gridarta.gui.dialog.replace.ReplaceDialog< G, A, R >.doReplace(), net.sf.gridarta.action.ShrinkSelectionAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doShrinkSelection(), net.sf.gridarta.gui.map.mapactions.EnterMap< G, A, R >.enterMap(), net.sf.gridarta.actions.AttachTiledMaps< G, A, R >.fillAdjacentMaps(), net.sf.gridarta.var.crossfire.gui.map.renderer.SimpleFlatMapRenderer.getFullImage(), net.sf.gridarta.gui.map.renderer.AbstractSimpleIsoMapRenderer< G, A, R >.getFullImage(), net.sf.gridarta.gui.dialog.plugin.parameter.map.MapParameterCellRenderer.getListCellRendererComponent(), net.sf.gridarta.gui.dialog.golocation.GoLocationDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.goLocation(), net.sf.gridarta.model.index.MapsIndexer< G, A, R >.indexPendingMaps(), 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 >.mapTilesAttach(), net.sf.gridarta.var.daimonin.gui.mappropertiesdialog.MapPropertiesDialog.modifyMapProperties(), net.sf.gridarta.var.atrinik.gui.mappropertiesdialog.MapPropertiesDialog.modifyMapProperties(), net.sf.gridarta.var.crossfire.gui.mappropertiesdialog.MapPropertiesDialog.modifyMapProperties(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.newMapModel(), net.sf.gridarta.gui.map.mapview.TestMapViewFactory.newMapView(), net.sf.gridarta.gui.map.test.TestMapControlCreatorUtils.newMapView(), net.sf.gridarta.gui.map.mapview.DefaultMapViewFactory< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.newMapView(), net.sf.gridarta.var.crossfire.gui.map.renderer.SimpleFlatMapRenderer.paintComponent(), net.sf.gridarta.gui.map.renderer.AbstractSimpleIsoMapRenderer< G, A, R >.paintComponent2(), net.sf.gridarta.var.crossfire.gui.map.renderer.SmoothingRenderer.paintSmooth(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.paste(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.pasteTiled(), net.sf.gridarta.gui.misc.RecentManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.RecentManager(), net.sf.gridarta.var.daimonin.gui.mappropertiesdialog.MapPropertiesDialog.restoreMapProperties(), net.sf.gridarta.var.atrinik.gui.mappropertiesdialog.MapPropertiesDialog.restoreMapProperties(), net.sf.gridarta.var.crossfire.gui.mappropertiesdialog.MapPropertiesDialog.restoreMapProperties(), net.sf.gridarta.model.mapmanager.AbstractMapManager< G, A, R >.revert(), net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.save(), net.sf.gridarta.gui.map.mapview.AbstractMapView< TestGameObject, TestMapArchObject, TestArchetype >.setCursorLocation(), net.sf.gridarta.var.daimonin.gui.mappropertiesdialog.MapPropertiesDialog.showDialog(), net.sf.gridarta.var.atrinik.gui.mappropertiesdialog.MapPropertiesDialog.showDialog(), net.sf.gridarta.var.crossfire.gui.mappropertiesdialog.MapPropertiesDialog.showDialog(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testAddGameObjectToMap1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testAddGameObjectToMap2(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testGetAllGameObjects1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testModifiedGameObject1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testModifiedGameObject2(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap2(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap3(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap4(), net.sf.gridarta.model.mapmanager.DefaultMapManagerTest.testRevertResizedMap(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testUpdateDirectionOnInsert(), net.sf.gridarta.model.mapmodel.MapSquare< G, A, R >.toString(), net.sf.gridarta.gui.undo.UndoControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.UndoControl(), net.sf.gridarta.var.crossfire.gui.map.renderer.FlatMapRenderer.updateSquare(), net.sf.gridarta.actions.AttachTiledMaps< G, A, R >.updateTilePaths(), net.sf.gridarta.gui.dialog.shrinkmapsize.ShrinkMapSizeDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.updateWarnings(), net.sf.gridarta.var.crossfire.model.validation.checks.NonAbsoluteExitPathChecker.validateGameObject(), and net.sf.gridarta.actions.AttachTiledMaps< G, A, R >.validateMapSizes().

◆ getMapFile() [1/2]

MapFile net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapFile ( )

Returns the map file.

Returns
the map file or
null
if the map has not yet been saved

Referenced by 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.action.AddBookmarkAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAddBookmark(), net.sf.gridarta.gui.map.mapactions.MapActions< G, A, R >.doCreateTile(), net.sf.gridarta.actions.ExitConnectorActions< G, A, R >.doExitConnect(), net.sf.gridarta.actions.ExitConnectorActions< G, A, R >.doExitCopy(), net.sf.gridarta.actions.ExitConnectorActions< G, A, R >.doExitPaste(), net.sf.gridarta.actions.AbstractServerActions< GameObject, MapArchObject, Archetype >.doOpenInClient(), 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.dialog.plugin.parameter.map.MapParameterView< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.MapParameterView(), net.sf.gridarta.model.maplocation.MapLocation.newAbsoluteMapLocation(), net.sf.gridarta.gui.misc.RecentManager< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.RecentManager(), net.sf.gridarta.model.mapcontrol.DefaultMapControl< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.save(), net.sf.gridarta.plugin.parameter.PluginParameterCodecTest.testMapFromXml3(), net.sf.gridarta.model.mapcontrol.DefaultMapControlTest.testSaveAs1(), net.sf.gridarta.actions.AttachTiledMaps< G, A, R >.updateTilePaths(), net.sf.gridarta.model.validation.checks.ExitChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.validateGameObject(), and net.sf.gridarta.actions.AttachTiledMaps< G, A, R >.validateMapSizes().

+ Here is the caller graph for this function:

◆ getMapFile() [2/2]

MapFile net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapFile ( @NotNull MapPath  mapPath) throws SameMapException, UnsavedMapException

Returns the map file for a map that can be reached by following a MapPath from this map.

Parameters
mapPaththe map path to follow
Returns
the map file
Exceptions
SameMapExceptionof the destination map file is the same as this map file
UnsavedMapExceptionif this map is not saved and therefore its map file is unknown

◆ getMapSquare()

MapSquare<G, A, R> net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMapSquare ( @NotNull Point  pos)

Get the square at a specified location.

Parameters
poslocation to get square at
Returns
square at
p
Exceptions
IndexOutOfBoundsExceptionin case p specifies a location that's not valid within this map model

Referenced by net.sf.gridarta.model.mapmodel.TopLevelGameObjectIteratorTest.createMap(), net.sf.gridarta.gui.panel.tools.DeletionTool< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.deleteArch(), net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExpandEmptySelection(), net.sf.gridarta.gui.panel.tools.InsertionTool< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doInsert(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.getFullImage(), net.sf.gridarta.gui.map.mapview.AbstractMapView< TestGameObject, TestMapArchObject, TestArchetype >.getSelectedSquares(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.getSquareLocationAt(), net.sf.gridarta.gui.map.renderer.AbstractMapRenderer< TestGameObject, TestMapArchObject, TestArchetype >.getToolTipText(), net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.getYFloorOffset(), net.sf.gridarta.model.mapmodel.LightMapModelTracker< G, A, R >.mapSizeChanging(), net.sf.gridarta.model.mapmodel.MapSquareIterator< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.next(), net.sf.gridarta.gui.map.renderer.AbstractSimpleIsoMapRenderer< G, A, R >.paintComponent2(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.paintComponent2(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.paintMap(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.paintMapSelection(), net.sf.gridarta.var.crossfire.gui.map.renderer.SmoothingRenderer.paintSmooth(), net.sf.gridarta.var.crossfire.gui.map.renderer.SimpleFlatMapRenderer.paintSquare(), net.sf.gridarta.var.crossfire.gui.map.renderer.AbstractFlatMapRenderer.paintSquareSelection(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.pasteTiled(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.resizeFromModel(), net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.selectMapSquare(), net.sf.gridarta.model.mapmodel.LightMapModelTracker< G, A, R >.setLightRadius(), net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.shift(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareBottomMulti(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareBottomSingle(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareDownMulti(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareDownSingle(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareEnvMulti3(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareEnvMulti4(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareEnvSingle1(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareEnvSingle2(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareEnvSingle3(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareInvIntoHead1(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareInvMulti1(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareInvSingle1(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareTopMulti(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareTopSingle(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareUpMulti(), net.sf.gridarta.action.SelectedSquareActionsTest.testDoMoveSquareUpSingle(), net.sf.gridarta.model.floodfill.FillUtilsTest.testFillAdjacent(), net.sf.gridarta.model.mapmodel.AutoInsertionModeTest.testInsertSystemObject1(), net.sf.gridarta.model.mapmodel.AutoInsertionModeTest.testInsertSystemObject2(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testModifiedGameObject1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testModifiedGameObject2(), net.sf.gridarta.action.SelectedSquareActionsTest.testMoveTailPart(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testResizeMap4(), net.sf.gridarta.model.baseobject.AbstractBaseObjectTest.testSetObjectTextAttributeOrdering(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.tileStretchingOffsets(), net.sf.gridarta.gui.panel.objectchooser.DefaultObjectChooser< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.updatePickmapInfo(), and net.sf.gridarta.var.crossfire.gui.map.renderer.FlatMapRenderer.updateSquare().

◆ getTransactionDepth()

int net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getTransactionDepth ( )

Get the transaction depth, which is the number of beginTransaction(String) invocations without matching endTransaction() invocations.

A transaction depth of 0 means there is no ongoing transaction.

Returns
transaction depth
See also
#beginTransaction(String)
endTransaction()
endTransaction(boolean)
endAllTransactions()
isAnyTransactionActive()

◆ insertArchToMap()

G net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.insertArchToMap ( @NotNull BaseObject< G, A, R, ?>  templateBaseObject,
@Nullable G  nextGameObject,
@NotNull Point  pos,
boolean  join 
)

Insert a game object to the map at a specified position.

This function allows either to choose from the archetypes or to insert a copy from an existing game object. It also works for container-inventory.

Parameters
templateBaseObjecta clone copy of this game object gets inserted to the map; it can be an archetype of a game object
nextGameObjectthe new game object gets inserted before this; if
null
, the game object gets inserted at bottom
posthe map position to insert the new game object
joinif set, auto-joining is supported
Returns
the inserted game object, or
null
if an error occurred

Referenced by net.sf.gridarta.gui.dialog.replace.ReplaceDialog< G, A, R >.doReplace(), net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.insertGameObject(), net.sf.gridarta.gui.panel.gameobjectattributes.GameObjectAttributesControl< G, A, R >.mapArchAddEnv(), and net.sf.gridarta.model.io.DefaultMapReaderTest.testReorderMultiSquares().

+ Here is the caller graph for this function:

◆ insertBaseObject()

G net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.insertBaseObject ( @NotNull BaseObject< G, A, R, ?>  baseObject,
@NotNull Point  pos,
boolean  allowMany,
boolean  join,
@NotNull InsertionMode< G, A, R >  insertionMode 
)

Inserts a BaseObject to a map.

Archetypes are instantiated, game objects are cloned. The direction of the inserted game object is set to the direction of the archetype chooser. This function allows multi-square game objects.

Parameters
baseObjectthe base object
posthe insert-location on this map
allowManywhether duplicates are allowed
joinwhether to auto-join the inserted game object
insertionModethe insertion mode to use
Returns
the inserted game object or
null
if nothing was inserted

Referenced by net.sf.gridarta.gui.panel.tools.InsertionTool< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doInsert(), net.sf.gridarta.gui.dialog.replace.ReplaceDialog< G, A, R >.doReplace(), net.sf.gridarta.gui.misc.ShiftProcessor< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.insertAllAndClear(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.paste(), net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.pasteTiled(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testEditType1(), net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testGetAllGameObjects1(), and net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testUpdateDirectionOnInsert().

+ Here is the caller graph for this function:

◆ isAnyTransactionActive()

boolean net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isAnyTransactionActive ( )

Returns whether a transaction is currently active.

This method will return

true

if and only if getTransactionDepth() returns a value greater than zero.

Returns
true
if there's a transaction going on, otherwise
false
.
See also
#beginTransaction(String)
endTransaction()
endTransaction(boolean)
endAllTransactions()
getTransactionDepth()

◆ isAreaEmpty()

boolean net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isAreaEmpty ( int  left,
int  top,
int  width,
int  height 
)

Checks whether an area of a map is completely empty.

Parameters
leftthe left border of the area
topthe top border of the area
widththe with of the area
heightthe height of the area
Returns
whether the area is completely empty

◆ isEmpty()

boolean net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isEmpty ( )

Returns whether the map is empty.

Returns
true
if the map is empty, or
false
if the map is not empty

Referenced by net.sf.gridarta.gui.copybuffer.CopyBuffer< G, A, R >.isEmpty().

+ Here is the caller graph for this function:

◆ isModified()

◆ isMultiArchFittingToMap()

boolean net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isMultiArchFittingToMap ( @NotNull Archetype< G, A, R >  archetype,
@NotNull Point  pos,
boolean  allowDouble 
)

Checks whether an GameObject (multi-arch) would still fit on this map.

Parameters
archetypethe archetype to check
posposition of multi-square head
allowDoublewhether overlapping multi-square arches should be allowed (check is done using the archetype name)
Returns
whether the multi-arch would still fit on this map
Return values

Referenced by net.sf.gridarta.action.MoveSquareEnvAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction().

+ Here is the caller graph for this function:

◆ mapClosed()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.mapClosed ( )

This function must be called if this instance is freed.

◆ moveEnv()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.moveEnv ( @NotNull G  gameObject,
@NotNull Point  pos,
@NotNull G  nextGameObject 
)

Moves a GameObject to its environment.

Parameters
gameObjectthe game object to move
posthe insertion position
nextGameObjectthe next game object

Referenced by net.sf.gridarta.action.MoveSquareEnvAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction().

+ Here is the caller graph for this function:

◆ moveInv()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.moveInv ( @NotNull G  gameObject,
@NotNull GameObject< G, A, R >  prevGameObject 
)

Moves a GameObject to the inventory of another game object.

Parameters
gameObjectthe game object to move
prevGameObjectthe previous game object

Referenced by net.sf.gridarta.action.MoveSquareInvAction< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doAction().

+ Here is the caller graph for this function:

◆ nextPoint()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.nextPoint ( Point  point,
int  direction 
)

Moves the given point forward or backward one map square.

Parameters
pointthe point to start with and modify
directionthe direction (
-1
or
+1
)

Referenced by net.sf.gridarta.gui.map.mapactions.ExitIterator< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.findNext().

+ Here is the caller graph for this function:

◆ removeGameObject()

◆ removeMapModelListener()

◆ removeMapTransactionListener()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.removeMapTransactionListener ( @NotNull MapTransactionListener< G, A, R >  listener)

Unregisters a map transaction listener.

Parameters
listenerthe listener to unregister

◆ resetModified()

◆ setErrors()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setErrors ( @NotNull ErrorCollector< G, A, R >  errors)

Sets the errors in this map.

Parameters
errorsthe errors

◆ setMapFile()

◆ transientGameObjectChange()

void net.sf.gridarta.model.mapmodel.MapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.transientGameObjectChange ( @NotNull G  gameObject)

Method to notify the model that a game object was changed but need not be restored by undo/redo.

A change to a game object is atomic if getTransactionDepth() returns 0, otherwise it is transactional. The model then notifies the registered listeners of the changes.

Parameters
gameObjectthe game object that has changed

Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.notifyTransientChange().

+ Here is the caller graph for this function:

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