|
Gridarta Editor
|
Base class for classes that contain GameObjects as children in the sense of containment. More...
Inheritance diagram for net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
Collaboration diagram for net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:Classes | |
| class | ReverseIterator |
| An iterator for iterating over a list in reverse order. More... | |
Public Member Functions | |
| void | addFirst (@NotNull final G gameObject) |
| Add the given GameObject at the end of this Container. More... | |
| void | addLast (@NotNull final G gameObject) |
| Add the given GameObject at the end of this Container. More... | |
| abstract G | asGameObject () |
| Returns this instance as a GameObject or. More... | |
| G | getFirst () |
| Return the first GameObject contained in this container. More... | |
| G | getLast () |
| Return the last GameObject contained in this container. More... | |
| abstract MapSquare< G, A, R > | getMapSquare () |
| Returns the MapSquare of this container. More... | |
| G | getNext (@NotNull final G gameObject) |
| Return the GameObject succeeding a given game object. More... | |
| G | getPrev (@NotNull final G gameObject) |
| Return the GameObject preceding a given game object. More... | |
| boolean | hasSameContents (@NotNull final GameObjectContainer<?, ?, ?> gameObjectContainer) |
| Compare this object to another game object container. More... | |
| void | insertAfter (@Nullable final G previousGameObject, @NotNull final G gameObject) |
| Add a GameObject after another. More... | |
| void | insertBefore (@NotNull final G gameObject, @Nullable final G nextGameObject) |
| Add a GameObject before another. More... | |
| boolean | isBottom (@NotNull final G gameObject) |
| Returns whether this game object is the bottom-most one. More... | |
| boolean | isEmpty () |
| Check whether this square is empty. More... | |
| boolean | isTop (@NotNull final G gameObject) |
| Returns whether this game object is the top-most one. More... | |
| Iterator< G > | iterator () |
| The Iterator returned does not recurse, it only contains objects on the first level. More... | |
| void | moveBottom (@NotNull final G gameObject) |
| Move an item to bottom. More... | |
| void | moveDown (@NotNull final G gameObject) |
| Move an item down. More... | |
| void | moveTop (@NotNull final G gameObject) |
| Move an item to top. More... | |
| void | moveUp (@NotNull final G gameObject) |
| Move an item up. More... | |
| Iterable< G > | recursive () |
| Return an object that is a recursive representation. More... | |
| void | remove (@NotNull final G gameObject) |
| Remove a GameObject from this container. More... | |
| void | removeAll () |
| Removes all GameObjects from this container. More... | |
| void | replace (@NotNull final G oldGameObject, @NotNull final G newGameObject) |
| Replace an GameObject with another one. More... | |
| Iterable< G > | reverse () |
| Return an object that is the reverse representation. More... | |
| String | toString () |
Protected Member Functions | |
| Object | clone () |
| GameObjectContainer () | |
| Create a new GameObjectContainer. More... | |
| abstract void | notifyBeginChange () |
| Notify the map model that this container is about to change. More... | |
| abstract void | notifyEndChange () |
| Notify the map model that this container has changed. More... | |
| abstract void | setThisContainer (@NotNull G gameObject) |
| Sets a GameObject's container to this container. More... | |
Private Member Functions | |
| void | initData () |
| Initialize the fields. More... | |
| void | readObject (@NotNull final ObjectInputStream stream) throws IOException, ClassNotFoundException |
Private Attributes | |
| List< G > | contents |
| The contents of this container. More... | |
| transient Iterable< G > | recursive |
| Iterable implementation for recursive traversal. More... | |
| transient Iterable< G > | reverse |
| Iterable implementation for reverse traversal. More... | |
Static Private Attributes | |
| static final long | serialVersionUID = 1L |
| The serial version UID. More... | |
Base class for classes that contain GameObjects as children in the sense of containment.
The interface serves 2 main purposes:
Definition at line 50 of file GameObjectContainer.java.
|
protected |
Create a new GameObjectContainer.
Definition at line 80 of file GameObjectContainer.java.
| void net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addFirst | ( | @NotNull final G | gameObject | ) |
Add the given GameObject at the end of this Container.
| gameObject | the free yet unlinked GameObject |
| IllegalArgumentException | if gameObject |
Definition at line 450 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testAddFirst().
Here is the caller graph for this function:| void net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addLast | ( | @NotNull final G | gameObject | ) |
Add the given GameObject at the end of this Container.
| gameObject | the free yet unlinked GameObject |
| IllegalArgumentException | if gameObject |
Definition at line 428 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.mapmodel.SavedSquares< G, A, R >.applyChanges(), net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.newContainer(), and net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testAddLast().
Here is the caller graph for this function:
|
abstract |
Returns this instance as a GameObject or.
if this instance is not a game object.
Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.getContainerGameObject(), and net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.getTopContainer().
Here is the caller graph for this function:
|
protected |
Definition at line 604 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.baseobject.GameObjectContainer<?, ?, ?>.clone().
Here is the caller graph for this function:| G net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getFirst | ( | ) |
Return the first GameObject contained in this container.
Definition at line 206 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testInsertAfter().
Here is the caller graph for this function:| G net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getLast | ( | ) |
Return the last GameObject contained in this container.
You should not invoke this method to iterate over GameObjects, such invocation is regarded deprecated.
Definition at line 254 of file GameObjectContainer.java.
|
abstract |
Returns the MapSquare of this container.
Referenced by net.sf.gridarta.model.mapmodel.SavedSquares< G, A, R >.applyChanges(), net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.getMapSquare(), and net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.moveEnv().
Here is the caller graph for this function:| G net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getNext | ( | @NotNull final G | gameObject | ) |
Return the GameObject succeeding a given game object.
| gameObject | the given game object |
Definition at line 234 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.deleteSelectedGameObject(), net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.getNext(), and net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.selectBelow().
Here is the caller graph for this function:| G net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getPrev | ( | @NotNull final G | gameObject | ) |
Return the GameObject preceding a given game object.
| gameObject | the given game object |
Definition at line 217 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.getPrev(), and net.sf.gridarta.model.mapcursor.MapCursor< G, A, R >.selectAbove().
Here is the caller graph for this function:| boolean net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.hasSameContents | ( | @NotNull final GameObjectContainer<?, ?, ?> | gameObjectContainer | ) |
Compare this object to another game object container.
| gameObjectContainer | the other game object container |
Definition at line 634 of file GameObjectContainer.java.
|
private |
Initialize the fields.
This is needed because there are two ways of object construction,
Definition at line 92 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.baseobject.GameObjectContainer<?, ?, ?>.clone().
Here is the caller graph for this function:| void net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.insertAfter | ( | @Nullable final G | previousGameObject, |
| @NotNull final G | gameObject | ||
| ) |
Add a GameObject after another.
| previousGameObject | previous anchor or null |
| gameObject | GameObject to insert |
| IllegalArgumentException | if gameObject previousGameObject |
Definition at line 477 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.insertAfter(), net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.moveEnv(), and net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testInsertAfter().
Here is the caller graph for this function:| void net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.insertBefore | ( | @NotNull final G | gameObject, |
| @Nullable final G | nextGameObject | ||
| ) |
Add a GameObject before another.
| gameObject | GameObject to insert |
| nextGameObject | nextGameObject anchor or null |
| IllegalArgumentException | if gameObject prev |
Definition at line 523 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.insertBefore(), and net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testInsertBefore().
Here is the caller graph for this function:| boolean net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isBottom | ( | @NotNull final G | gameObject | ) |
Returns whether this game object is the bottom-most one.
| gameObject | item to move to top |
| IllegalArgumentException | if gameObject |
Definition at line 319 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.isBottom().
Here is the caller graph for this function:| boolean net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isEmpty | ( | ) |
Check whether this square is empty.
Definition at line 196 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.mainactions.MainActions< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.doExpandEmptySelection(), and net.sf.gridarta.gui.map.renderer.AbstractSimpleIsoMapRenderer< G, A, R >.paintComponent2().
Here is the caller graph for this function:| boolean net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isTop | ( | @NotNull final G | gameObject | ) |
Returns whether this game object is the top-most one.
| gameObject | item to move to top |
| IllegalArgumentException | if gameObject |
Definition at line 308 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.isTop().
Here is the caller graph for this function:| Iterator<G> net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.iterator | ( | ) |
The Iterator returned does not recurse, it only contains objects on the first level.
The Iterator returned is transparent, that means modifying the iterator's collection actually modifies the underlying GameObjectContainer.
The basic iterator.
Current element (last element returned by next()).
Definition at line 120 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.mapmodel.AutoInsertionModeTest.testInsertSystemObject1(), net.sf.gridarta.model.mapmodel.AutoInsertionModeTest.testInsertSystemObject2(), and net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testIterator().
Here is the caller graph for this function:| void net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.moveBottom | ( | @NotNull final G | gameObject | ) |
Move an item to bottom.
| gameObject | item to move to bottom |
| IllegalArgumentException | if gameObject |
Definition at line 404 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.moveBottom(), and net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testMoveBottom().
Here is the caller graph for this function:| void net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.moveDown | ( | @NotNull final G | gameObject | ) |
Move an item down.
| gameObject | item to move down |
| IllegalArgumentException | if gameObject |
Definition at line 379 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.moveDown(), and net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testMoveDown().
Here is the caller graph for this function:| void net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.moveTop | ( | @NotNull final G | gameObject | ) |
Move an item to top.
| gameObject | item to move to top |
| IllegalArgumentException | if gameObject |
Definition at line 329 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.moveTop(), and net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testMoveTop().
Here is the caller graph for this function:| void net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.moveUp | ( | @NotNull final G | gameObject | ) |
Move an item up.
| gameObject | item to move up |
| IllegalArgumentException | if gameObject |
Definition at line 354 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.moveUp(), and net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testMoveUp().
Here is the caller graph for this function:
|
abstractprotected |
Notify the map model that this container is about to change.
|
abstractprotected |
Notify the map model that this container has changed.
|
private |
Definition at line 623 of file GameObjectContainer.java.
| Iterable<G> net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.recursive | ( | ) |
Return an object that is a recursive representation.
Invoke this method if you want to iterate over the contained GameObjects recursively.
Definition at line 188 of file GameObjectContainer.java.
| void net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.remove | ( | @NotNull final G | gameObject | ) |
Remove a GameObject from this container.
| gameObject | GameObject to remove |
| IllegalArgumentException | if gameObject |
Definition at line 265 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.gameobject.AbstractGameObject< GameObject, MapArchObject, Archetype >.remove(), net.sf.gridarta.model.mapmodel.DefaultMapModel< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.removeGameObject(), and net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testRemove().
Here is the caller graph for this function:| void net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.removeAll | ( | ) |
Removes all GameObjects from this container.
this implementation does not take care of multi square objects.
Definition at line 285 of file GameObjectContainer.java.
| void net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.replace | ( | @NotNull final G | oldGameObject, |
| @NotNull final G | newGameObject | ||
| ) |
Replace an GameObject with another one.
| oldGameObject | old GameObject to be replaced |
| newGameObject | new GameObject that replaces oldGameObject |
| IllegalArgumentException | if oldGameObject |
Definition at line 558 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testReplace().
Here is the caller graph for this function:| Iterable<G> net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.reverse | ( | ) |
Return an object that is the reverse representation.
Invoke this method if you want to iterate over the contained GameObjects in reverse order.
Definition at line 178 of file GameObjectContainer.java.
Referenced by 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.mapmodel.MapSquare< G, A, R >.getAfterLast(), net.sf.gridarta.model.mapmodel.MapSquare< G, A, R >.getLast(), and net.sf.gridarta.gui.map.renderer.AbstractMapRenderer< TestGameObject, TestMapArchObject, TestArchetype >.getToolTipText().
Here is the caller graph for this function:
|
abstractprotected |
Sets a GameObject's container to this container.
| gameObject | the game object |
Referenced by net.sf.gridarta.model.baseobject.GameObjectContainer<?, ?, ?>.clone().
Here is the caller graph for this function:| String net.sf.gridarta.model.baseobject.GameObjectContainer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.toString | ( | ) |
Definition at line 664 of file GameObjectContainer.java.
|
private |
The contents of this container.
Definition at line 63 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.model.baseobject.GameObjectContainer<?, ?, ?>.clone().
|
private |
Iterable implementation for recursive traversal.
Definition at line 69 of file GameObjectContainer.java.
|
private |
Iterable implementation for reverse traversal.
Definition at line 75 of file GameObjectContainer.java.
Referenced by net.sf.gridarta.var.crossfire.model.gameobject.PropagateElevationTest.testReverse().
|
staticprivate |
The serial version UID.
Definition at line 55 of file GameObjectContainer.java.