public class GridPoint
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
GridPoint(int col,
int row)
Creates a point at the given column and row indices.
|
Modifier and Type | Method and Description |
---|---|
GridPoint |
add(GridPoint other)
Adds another grid point to this one and returns the result.
|
GridPoint |
add(int columnDelta,
int rowDelta)
Adds a column and a row delta to this point and returns the result.
|
void |
applyTo(javafx.scene.Node node)
Sets the column and row indices of a node to this point.
|
boolean |
equals(java.lang.Object obj) |
static GridPoint |
fromNode(javafx.scene.Node node)
Creates a new point from a node.
|
int |
getCol() |
int |
getRow() |
int |
hashCode() |
GridPoint |
subtract(GridPoint other)
Subtracts another grid point from this one.
|
java.lang.String |
toString() |
public GridPoint(int col, int row)
java.lang.IllegalArgumentException
- if either col
or row
is negativepublic static GridPoint fromNode(javafx.scene.Node node)
GridPane.columnIndex
and GridPane.rowIndex
set.node
- the node to get the grid point ofjava.lang.IllegalArgumentException
- if either columnIndex or rowIndex has not been setpublic void applyTo(javafx.scene.Node node)
node
- the node to set the position ofpublic GridPoint subtract(GridPoint other)
row
or col
would be negative,
it is set to zero.other
- the point to subtract from this onepublic GridPoint add(GridPoint other)
other
- the point to add to this onepublic GridPoint add(int columnDelta, int rowDelta)
columnDelta
- the change in the column indexrowDelta
- the change in the row indexpublic int getCol()
public int getRow()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object