public interface CellGraphicFactory<T extends javafx.scene.Node>
SpreadsheetCell, a solution is to provide a Node (for example a
WebView) that will be displayed in the cell.
Because a Node can consume a lot of memory, this CellGraphicFactory
will recycle the Nodes to only provide them for visible cells.| Modifier and Type | Method and Description |
|---|---|
javafx.scene.Node |
getNode(SpreadsheetCell cell)
Returns a
Node to display in the cell graphic. |
java.lang.Class |
getType()
Returns the exact class used in this CellGraphicFactory.
|
void |
load(T node,
SpreadsheetCell cell)
When a
Node is reused (transfered from one cell to another for
example), we ask the Node to reload. |
void |
loadStyle(T node,
SpreadsheetCell cell,
javafx.scene.text.Font font,
javafx.scene.paint.Paint textFill,
javafx.geometry.Pos alignment,
javafx.scene.layout.Background background)
Once a
SpreadsheetCell has been effectively loaded in the grid,
this method is called if the Node wants to access the cell's
graphic details. |
void |
setUnusedNode(T node)
Once a
Node is no longer used in a cell, it is given back. |
javafx.scene.Node getNode(SpreadsheetCell cell)
Node to display in the cell graphic. This is called
internally by the SpreadsheetView when a cell is being visible and needs
to display a Node.cell - the considered SpreadsheetCellNode to display in the cell graphicvoid load(T node, SpreadsheetCell cell)
Node is reused (transfered from one cell to another for
example), we ask the Node to reload. Beware, only reload when necessary :
This method can be called several times with the same node and
cell.node - the Node affected to the cellcell - the considered SpreadsheetCellvoid loadStyle(T node, SpreadsheetCell cell, javafx.scene.text.Font font, javafx.scene.paint.Paint textFill, javafx.geometry.Pos alignment, javafx.scene.layout.Background background)
SpreadsheetCell has been effectively loaded in the grid,
this method is called if the Node wants to access the cell's
graphic details.node - the considered Node, may be null for empty
cell.cell - the considered SpreadsheetCellfont - the cell FonttextFill - the text's coloralignment - the cell's vertical and horizontal alignmentbackground - the cell's backgroundvoid setUnusedNode(T node)
Node is no longer used in a cell, it is given back.node - the Nodejava.lang.Class getType()