public class AreaGrid extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
GRID_THRESHOLD
The maximal difference between two lengths that are considered a "being the same"
|
| Constructor and Description |
|---|
AreaGrid(DefaultArea area) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cellEmpty(int x,
int y)
Checks if the cell with the specified coordinates is empty.
|
int |
findCellX(int x)
Finds a grid cell that contains the specified point
|
int |
findCellY(int y)
Finds a grid cell that contains the specified point
|
DefaultArea |
getAreaAt(int x,
int y)
Find an area at the specified position in the grid.
|
Rectangular |
getAreaBoundsAbsolute(Rectangular area) |
Rectangular |
getCellBoundsAbsolute(int x,
int y) |
Rectangular |
getCellBoundsRelative(int x,
int y) |
int |
getColOfs(int col) |
int[] |
getCols() |
int |
getHeight() |
int |
getMaxIndent() |
int |
getMinIndent() |
int |
getRowOfs(int row) |
int[] |
getRows() |
int |
getWidth() |
String |
toString() |
public static final int GRID_THRESHOLD
public AreaGrid(DefaultArea area)
public int[] getCols()
public int getHeight()
public int[] getRows()
public int getWidth()
public int getMinIndent()
public int getMaxIndent()
public DefaultArea getAreaAt(int x, int y)
x - the x coordinate of the grid celly - the y coordinate of the grid cellpublic boolean cellEmpty(int x,
int y)
x - the x coordinate of the grid celly - the y coordinate of the grid cellpublic int getColOfs(int col)
throws ArrayIndexOutOfBoundsException
ArrayIndexOutOfBoundsExceptionpublic int getRowOfs(int row)
throws ArrayIndexOutOfBoundsException
ArrayIndexOutOfBoundsExceptionpublic Rectangular getCellBoundsRelative(int x, int y)
public Rectangular getCellBoundsAbsolute(int x, int y)
public Rectangular getAreaBoundsAbsolute(Rectangular area)
public int findCellX(int x)
x - the x coordinate of the specified pointpublic int findCellY(int y)
y - the y coordinate of the specified pointCopyright © 2015. All rights reserved.