Class BoundedGrid
java.lang.Object
com.levigo.jadice.web.client.grid.BoundedGrid
- All Implemented Interfaces:
Grid
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.levigo.jadice.web.client.grid.Grid
Grid.SnapTo
-
Constructor Summary
ConstructorsConstructorDescriptionBoundedGrid
(double cellWidth, double cellHeight) Creates a new unbounded grid (infinite width / height of the full grid) with the given cell size.BoundedGrid
(Rectangle2D bounds, double cellWidth, double cellHeight) Creates a new grid with the given bounds and cell size. -
Method Summary
Modifier and TypeMethodDescriptionReturns the full grid bounds as a Rectangle2D.Returns theCell
corresponding to the given point.getCellBounds
(Cell cell) Returns a rectangle in jadice document units which represents the grid at the givenCell
.double
Returns the cell height of the grid.double
Returns the cell width of the grid.snap
(Point2D srcPoint, Grid.SnapTo snapTo) Returns an aligned point which is residing on its correspondingCell
at the position determined byGrid.SnapTo
.toString()
-
Constructor Details
-
BoundedGrid
public BoundedGrid(double cellWidth, double cellHeight) Creates a new unbounded grid (infinite width / height of the full grid) with the given cell size.- Parameters:
cellWidth
- the width of a single cell in docp unitscellHeight
- the height of a single cell in docp units
-
BoundedGrid
Creates a new grid with the given bounds and cell size.- Parameters:
bounds
- the bounds of the grid in docp units; null is allowed here and represents a grid without offset or boundscellWidth
- the cell width in docp unitscellHeight
- the cell height in docp units
-
-
Method Details
-
getCellWidth
public double getCellWidth()Description copied from interface:Grid
Returns the cell width of the grid.- Specified by:
getCellWidth
in interfaceGrid
-
getCellHeight
public double getCellHeight()Description copied from interface:Grid
Returns the cell height of the grid.- Specified by:
getCellHeight
in interfaceGrid
-
snap
Description copied from interface:Grid
Returns an aligned point which is residing on its correspondingCell
at the position determined byGrid.SnapTo
. -
getCell
Description copied from interface:Grid
Returns theCell
corresponding to the given point. A point located on the border of two cells belongs to the right / bottom cell. -
getCellBounds
Description copied from interface:Grid
Returns a rectangle in jadice document units which represents the grid at the givenCell
.- Specified by:
getCellBounds
in interfaceGrid
- Parameters:
cell
- the cell- Returns:
- the rectangle representing the bounds of the given cell in jadice document units
-
getBounds
Description copied from interface:Grid
Returns the full grid bounds as a Rectangle2D.This makes it possible to create margins/offsets. E.g. if the page size is 100x100, the grid bounds could be set to (10, 10, 80, 80) to specify a border of 10 on each edge.
-
toString
-