 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.mapgrid;
22 import java.awt.Point;
24 import org.junit.Assert;
25 import org.junit.Test;
87 final StringBuilder sb =
new StringBuilder();
89 for (
int y = 0; y < size.
getHeight(); y++) {
90 for (
int x = 0; x < size.
getWidth(); x++) {
91 final int flags = mapGrid.
getFlags(x, y);
105 sb.append(Integer.toHexString(value));
108 Assert.assertEquals(expectedBorder, sb.toString());
int getWidth()
Returns the width of the area.
int getFlags(final int x, final int y)
Returns the flags of a square.
Base package of all Gridarta classes.
static final int GRID_FLAG_SELECTION_EAST
Selection - is set for squares at the east edge of the selected area.
SUB
All squares that are preselected get unselected.
FLIP
All squares that are preselected change state of selection.
static final int GRID_FLAG_SELECTION_SOUTH
Selection - is set for squares at the south edge of the selected area.
int getHeight()
Returns the height of the area.
Size2D getSize()
Returns size of grid.
static final int GRID_FLAG_SELECTION_WEST
Selection - is set for squares at the west edge of the selected area.
Modes that describe how squares get selected.
static void checkSelectionBorder(final MapGrid mapGrid, final String expectedBorder)
Checks that the map border selection flags of a MapGrid instance is as expected.
void select(@NotNull final Point pos, @NotNull final SelectionMode selectionMode)
Selects or deselects a single square.
2D-Grid containing flags for selection, pre-selection, cursor, warnings and errors.
ADD
All squares that are preselected get selected.
void resize(@NotNull final Size2D newSize)
Resizes the MapGrid.
static final int GRID_FLAG_SELECTION_NORTH
Selection - is set for squares at the north edge of the selected area.
void selectArea(@NotNull final Point pos1, @NotNull final Point pos2, @NotNull final SelectionMode selectionMode)
Selects or deselects all squares in an area.
The class Size2D represents a 2d rectangular area.
void testSelectionBorderUpdates()
Test case for selection border updates.