public enum PolygonGridShift extends java.lang.Enum<PolygonGridShift>
PolygonGrid
.
Valid choices dependon on the underlying RegularPolygon
. Specifies how
even-numbered rows or columns are shifted, relative to odd-numbered ones. For
this purpose, counting starts at one for the PolygonGrid
row or column
at index position zero, so the first row or column is considered odd-numbered.Enum Constant and Description |
---|
COLUMN_DOWN
Specifies that even-numbered columns are shifted downward.
|
COLUMN_UP
Specifies that even-numbered columns are shifted upward.
|
NONE
Specifies that no rows or columns are shifted.
|
ROW_LEFT
Specifies that even-numbered rows are shifted left.
|
ROW_RIGHT
Specifies that even-numbered rows are shifted right.
|
Modifier and Type | Method and Description |
---|---|
boolean |
anyColumns()
Indicates whether the
PolygonGridShift shifts any columns. |
boolean |
anyRows()
Indicates whether the
PolygonGridShift shifts any rows. |
boolean |
isDownColumn(int column)
Determines whether the specified column is shifted down compared to its neighbors.
|
boolean |
isLeftRow(int row)
Determines whether the specified row is shifted left compared to its neighbors.
|
boolean |
isRightRow(int row)
Determines whether the specified row is shifted right compared to its neighbors.
|
boolean |
isUpColumn(int column)
Determines whether the specified column is shifted up compared to its neighbors.
|
static PolygonGridShift |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static PolygonGridShift[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PolygonGridShift NONE
NONE
is the only valid choice for a square grid
with PolygonOrientation.ON_EDGE
orientation.public static final PolygonGridShift COLUMN_UP
COLUMN_UP
and COLUMN_DOWN
are the only valid choices
for a hexagon grid with PolygonOrientation.ON_EDGE
orientation.public static final PolygonGridShift COLUMN_DOWN
COLUMN_UP
and COLUMN_DOWN
are the only valid choices
for a hexagon grid with PolygonOrientation.ON_EDGE
orientation.public static final PolygonGridShift ROW_RIGHT
ROW_RIGHT
and ROW_LEFT
are the only valid choices
for a hexagon grid with PolygonOrientation.ON_VERTEX
orientation.public static final PolygonGridShift ROW_LEFT
ROW_RIGHT
and ROW_LEFT
are the only valid choices
for a hexagon grid with PolygonOrientation.ON_VERTEX
orientation.public static PolygonGridShift[] values()
for (PolygonGridShift c : PolygonGridShift.values()) System.out.println(c);
public static PolygonGridShift valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic boolean anyColumns()
PolygonGridShift
shifts any columns.true
for COLUMN_UP
or COLUMN_DOWN
, else false
public boolean anyRows()
PolygonGridShift
shifts any rows.public boolean isDownColumn(int column)
false
if anyColumns()
is false
.column
- the zero-based index of the column to testtrue
if column
is shifted down, else false
public boolean isLeftRow(int row)
false
if anyRows()
is false
.row
- the zero-based index of the row to testtrue
if row
is shifted left, else false
public boolean isRightRow(int row)
false
if anyRows()
is false
.row
- the zero-based index of the row to testtrue
if row
is shifted right, else false
public boolean isUpColumn(int column)
false
if anyColumns()
is false
.column
- the zero-based index of the column to testtrue
if column
is shifted up, else false