| Constructor and Description |
|---|
TableGrid(float x,
float y,
float w,
float h,
int columns,
int rows,
float paddingX,
float paddingY)
Builds a new grid.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Float |
cellHeight()
Returns the height of any element in this grid.
|
java.lang.Float |
cellWidth()
Returns the width of any element in this grid.
|
java.lang.Integer |
columns()
Returns the number of columns of this grid.
|
java.lang.Integer |
getColumn(int index)
Returns the column index [0, rows()] with a given element index.
|
java.lang.Float |
getColumnX(java.lang.Integer columnIndex)
Returns the x-location of the column with a given column index.
|
java.lang.Float |
getColumnY(java.lang.Integer columnIndex)
Returns the y-location of the column with a given column index.
|
processing.core.PVector[] |
getCoordinates()
Returns all positions of all elements in the grid.
|
java.lang.Float |
getHeight()
Returns the current height of the grid.
|
java.lang.Float |
getHeight(java.lang.Integer i)
Returns the current height of the grid.
|
java.lang.Float |
getPadding()
Returns the space between the elements of the grid.
|
java.lang.Float |
getPaddingX()
Returns the horizontal padding of this grid.
|
java.lang.Float |
getPaddingY()
Returns the vertical padding of this grid.
|
java.lang.Integer |
getRow(java.lang.Integer index)
Returns the row index [0, rows()] with a given element index.
|
java.lang.Float |
getRowX(java.lang.Integer rowIndex)
Returns the x-location of the row with a given row index.
|
java.lang.Float |
getRowY(java.lang.Integer rowIndex)
Returns the y-location of the row with a given row index.
|
java.lang.Float |
getWidth()
Returns the width of the element at the given index.
|
java.lang.Float |
getWidth(java.lang.Integer i)
Returns the current width of the grid.
|
java.lang.Float |
getX()
Returns the current x-position of the grid.
|
java.lang.Float |
getX(java.lang.Integer index)
Returns the x-position of the element at the given index.
|
java.lang.Float |
getY()
Returns the current y-position of the grid.
|
java.lang.Float |
getY(java.lang.Integer index)
Returns the y-position of the element at the given index.
|
java.lang.Integer |
index(java.lang.Integer row,
java.lang.Integer column)
Returns the element index with given column and row index.
|
boolean |
isEvenColumn(int index)
Returns if the element with the given index is member of an even column.
|
boolean |
isEvenRow(int index)
Returns if the element with the given index is member of an even row.
|
java.lang.Integer |
rows()
Returns the number of rows of this grid.
|
TableGrid |
setCellHeight(float cellHeight)
Sets the height of the grid elements.
|
TableGrid |
setCellWidth(float cellWidth)
Sets the width of the grid elements.
|
TableGrid |
setColumns(java.lang.Integer columns)
Sets the number of columns for this grid.
|
TableGrid |
setDimension(float s)
Sets the width and height of this grid (width and height will have the
same value).
|
TableGrid |
setDimension(float w,
float h)
Sets the width and height of this grid.
|
TableGrid |
setHeight(float h)
Sets the height of this grid.
|
TableGrid |
setPadding()
Sets the horizontal and vertical padding.
|
TableGrid |
setPadding(float padding)
Sets the horizontal and vertical padding.
|
TableGrid |
setPaddingX()
Sets the horizontal padding.
|
TableGrid |
setPaddingX(float paddingX)
Sets the horizontal padding.
|
TableGrid |
setPaddingY()
Sets the vertical padding.
|
TableGrid |
setPaddingY(float paddingY)
Sets the vertical padding.
|
TableGrid |
setRows(java.lang.Integer rows)
Sets the number of rows for this grid.
|
TableGrid |
setSize(java.lang.Integer size)
Sets the number of elements for this grid.
|
TableGrid |
setWidth(float w)
Sets the width of this grid.
|
TableGrid |
setX(float x)
Set to x-position of the grid.
|
TableGrid |
setY(float y)
Set to y-position of the grid.
|
java.lang.Integer |
size()
Returns the number of elements in the grid.
|
public TableGrid(float x,
float y,
float w,
float h,
int columns,
int rows,
float paddingX,
float paddingY)
x - The x-location of the grid (top-left corner).y - The y-location of the grid (top-left corner).w - The width of the grid.h - The height of the grid.columns - The number of columns of the grid.rows - The number of rows of the grid.paddingX - The horizontal padding of the elements of the grid (>= 0).paddingY - The vertical padding of the elements of the grid (>= 0).public TableGrid setX(float x)
RGridpublic TableGrid setY(float y)
RGridpublic TableGrid setWidth(float w)
w - The new grid width.public TableGrid setHeight(float h)
h - The new grid height.public TableGrid setDimension(float s)
s - The new grid dimension (width and height).public TableGrid setDimension(float w, float h)
w - The new grid width.h - The new grid height.public TableGrid setCellWidth(float cellWidth)
cellWidth - The new width of the cells.public TableGrid setCellHeight(float cellHeight)
cellHeight - The new width of the cells.public TableGrid setPadding()
public TableGrid setPaddingX()
public TableGrid setPaddingY()
public TableGrid setPadding(float padding)
setPadding in interface RGridpadding - The new (horizontal / vertical) padding of this grid (>= 0).public TableGrid setPaddingX(float paddingX)
paddingX - The new horizontal padding of this grid (>= 0).public TableGrid setPaddingY(float paddingY)
paddingY - The new vertical padding of this grid (>= 0).public TableGrid setSize(java.lang.Integer size)
size - The new number of elements for this grid (>= 1).public TableGrid setColumns(java.lang.Integer columns)
columns - The new number of columns for this grid (>= 1).public TableGrid setRows(java.lang.Integer rows)
rows - The new number of rows for this grid (>= 1).public processing.core.PVector[] getCoordinates()
RGridgetCoordinates in interface RGridpublic java.lang.Integer columns()
public java.lang.Integer rows()
public java.lang.Integer size()
RGrid
for (int i = 0; i < myGrid.size(); i++) {
float x = myGrid.getX(i);
float y = myGrid.getY(i):
}
public java.lang.Float getPaddingX()
public java.lang.Float getPaddingY()
public java.lang.Float getPadding()
getPadding in interface RGridpublic java.lang.Float getWidth()
RGridpublic java.lang.Float getHeight()
RGridpublic java.lang.Float getX()
RGridpublic java.lang.Float getY()
RGridpublic java.lang.Float getRowX(java.lang.Integer rowIndex)
rowIndex - The row index [0, rows()].public java.lang.Float getRowY(java.lang.Integer rowIndex)
rowIndex - The row index [0, rows()].public java.lang.Float getColumnX(java.lang.Integer columnIndex)
columnIndex - The columnIndex index [0, columns()].public java.lang.Float getColumnY(java.lang.Integer columnIndex)
columnIndex - The columnIndex index [0, columns()].public java.lang.Float getX(java.lang.Integer index)
RGrid
for (int i = 0; i < myGrid.size(); i++) {
float x = myGrid.getX(i);
float y = myGrid.getY(i):
}
public java.lang.Float getY(java.lang.Integer index)
RGrid
for (int i = 0; i < myGrid.size(); i++) {
float x = myGrid.getX(i);
float y = myGrid.getY(i):
}
public java.lang.Integer getRow(java.lang.Integer index)
index - The index of any element [0, size()].public java.lang.Integer getColumn(int index)
index - The index of any element [0, size()].public boolean isEvenRow(int index)
index - The index of the element.public boolean isEvenColumn(int index)
index - The index of the element.public java.lang.Integer index(java.lang.Integer row,
java.lang.Integer column)
row - The row index [0, rows()].column - The column index [0, columns()].public java.lang.Float cellWidth()
public java.lang.Float cellHeight()
public java.lang.Float getWidth(java.lang.Integer i)
RGrid