|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.frag.umlplugin.classcloud.Grid
public class Grid
Regular grid that is used as intermediate storage for class cloud cells.
Constructor Summary | |
---|---|
Grid(int width,
int height)
Creates a grid that can contain "width" times "height" cells. |
Method Summary | |
---|---|
CellCoordinate |
chooseCoordinate(Cell cell)
Chooses a cell coordinate that has the nearest distance to all available cell candidates. |
java.util.List<CellCoordinate> |
getCandidates()
Current list of cell candidates. |
Cell |
getCell(int x,
int y)
Gets cell at given coordinates. |
int |
getHeight()
Gets grid height. |
int |
getWidth()
Gets grid width. |
void |
placeCell(Cell cell)
Places a single cell by choosing a coordinate from the current list of candidates that is nearest to the preferred coordinate of the cell. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Grid(int width, int height)
width
- width of grid in cellsheight
- height of grid in cellsMethod Detail |
---|
public void placeCell(@NotNull Cell cell)
cell
- cell to be placed.@NotNull public CellCoordinate chooseCoordinate(@NotNull Cell cell)
cell
- cell to choose coordinate for
@NotNull public java.util.List<CellCoordinate> getCandidates()
public int getWidth()
public int getHeight()
@Nullable public Cell getCell(int x, int y)
x
- x-coordinatey
- y-coordinate
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |