20 package net.sf.gridarta.actions;
22 import java.awt.GraphicsEnvironment;
23 import java.awt.Point;
39 import org.jetbrains.annotations.NotNull;
40 import org.junit.Assert;
41 import org.junit.Test;
56 if (GraphicsEnvironment.isHeadless()) {
63 for (
int i = 0; i < 16; i++) {
67 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"a7",
"a8",
"a9",
"a10",
"a11",
"a12",
"a13",
"a14",
"a15");
72 mapArchObject.setMapSize(
new Size2D(2, 1));
116 Assert.assertNotNull(
object);
117 Assert.assertEquals(face,
object.getAttributeString(
BaseObject.
FACE));
Implements the controller for undo/redo actions.
MapSquare< G, A, R > getMapSquare()
A MapModel reflects the data of a map.
Graphical User Interface of Gridarta.
Helper class for regression tests to create MapModel instances.
Implements AutojoinList related functions.
UI parts of the implementation of an Undo / Redo in Gridarta.
void endTransaction()
End a transaction.
Helper class for creating MapModel instances for regression tests.
void undo()
"Undo" was selected.
TestMapModelCreator getMapModelCreator()
Returns the TestMapModelCreator instance.
Helper class for creating MapControl instances for regression tests.
String FACE
The attribute name of the object's face.
void setAutojoin(boolean autojoin)
Sets the "autojoin" state.
Regression tests for UndoActions.
void testInsert1()
Checks that undo correctly sets the "face" attribute.
A MapArchObject implementation for testing purposes.
MapModel< G, A, R > getMapModel()
Returns the map model.
Base package of all Gridarta classes.
TestGameObject insertArchetype(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, final int x, final int y, @NotNull final BaseObject< TestGameObject, TestMapArchObject, TestArchetype, ?> archetype, final boolean join)
Inserts an archetype game object into a map model.
AutojoinListsHelper newAutojoinListsHelper()
Returns a new AutojoinListsHelper instance.
An Exception indicating that an Archetype name is not unique.
GameObjects are the objects based on Archetypes found on maps.
Exception thrown if an AutojoinList is invalid.
static void checkMapContents(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, @NotNull final String... lines)
Checks for expected MapModel's contents.
G getFirst(@NotNull final GameObjectMatcher gameObjectMatcher)
Returns the first occurrence of a matching game object.
TestArchetype getArchetype(@NotNull final String archetypeName)
Returns an archetype.
TestMapModelHelper newTestMapModelHelper()
Creates a new TestMapModelHelper instance.
static void checkFace(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, final int x, final int y, @NotNull final String face)
Checks the face name of the first object in a map square.
void newAutojoinLists(@NotNull final String... archetypeNames)
Creates a new AutojoinLists instance.
Currently nothing more than a marker interface for unification.
MapViewSettings getMapViewSettings()
Returns the MapViewSettings instance.
An Archetype implementation for testing purposes.
A GameObject implementation for testing purposes.
GameObjectMatchers getGameObjectMatchers()
Returns the GameObjectMatchers instance.
void beginTransaction(@NotNull String name)
Starts a new transaction.
GameObjectFactory< TestGameObject, TestMapArchObject, TestArchetype > getGameObjectFactory()
Returns the GameObjectFactory instance.
MapManager< TestGameObject, TestMapArchObject, TestArchetype > getMapManager()
Returns the MapManager.
The class Size2D represents a 2d rectangular area.