public final class GridLayoutPainter extends java.lang.Object implements Painter
Painter that lays out other painters in a grid.
The delegate painters will be laid
out in a way that each of them is responsible for one grid cell.| Constructor and Description |
|---|
GridLayoutPainter(int cellsX,
int cellsY)
Creates a new instance
|
GridLayoutPainter(int cellsX,
int cellsY,
double relativeCellBorderSizeX,
double relativeCellBorderSizeY)
Creates a new instance with the given border sizes for the cells.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCellsX()
Returns the number of cells in x-direction
|
int |
getCellsY()
Returns the number of cells in y-direction
|
void |
paint(java.awt.Graphics2D g,
java.awt.geom.AffineTransform worldToScreen,
double w,
double h) |
void |
setDelegate(int x,
int y,
Painter delegate)
Set the painter for the cell with the given coordinates
|
public GridLayoutPainter(int cellsX,
int cellsY)
cellsX - The number of cells in x-directioncellsY - The number of cells in y-directionjava.lang.IllegalArgumentException - If any number of cells is negativepublic GridLayoutPainter(int cellsX,
int cellsY,
double relativeCellBorderSizeX,
double relativeCellBorderSizeY)
cellsX - The number of cells in x-directioncellsY - The number of cells in y-directionrelativeCellBorderSizeX - The border size of each cell in
x-directionrelativeCellBorderSizeY - The border size of each cell in
y-directionjava.lang.IllegalArgumentException - If any number of cells is negativepublic int getCellsX()
public int getCellsY()
public void setDelegate(int x,
int y,
Painter delegate)
x - The x-coordinate of the celly - The y-coordinate of the celldelegate - The delegatejava.lang.IndexOutOfBoundsException - If the given indices are invalidCopyright © 2018. All Rights Reserved.