Top Description Methods
org.controlsfx.control.spreadsheet

public Interface CellGraphicFactory<T extends Node>

Imports
javafx.geometry.Pos, javafx.scene.Node, javafx.scene.layout.Background, javafx.scene.paint.Paint, javafx.scene.text.Font

If anyone wants to display a specific Graphic in a 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, we need this CellGraphicFactory that will recycle the Nodes to only provide them for visible cells.

Method Summary

Modifier and TypeMethod and Description
public Node

Returns:

a Node to display in the cell graphic
getNode
(SpreadsheetCell
the considered SpreadsheetCell
cell
)

Returns a Node to display in the cell graphic.

public Class<T>

Returns:

the exact class used in this CellGraphicFactory
getType
()

Returns the exact class used in this CellGraphicFactory.

public void
load(T
the considered Node
node
,
SpreadsheetCell
the considered SpreadsheetCell
cell
)

When a Node is reused (transfered from one cell to another for example), we ask the Node to reload.

public void
loadStyle(T
the considered Node, may be null for empty cell.
node
,
SpreadsheetCell
the considered SpreadsheetCell
cell
,
Font
the cell Font
font
,
Paint
the text's color
textFill
,
Pos
the cell's vertical and horizontal alignment
alignment
,
Background
the cell's 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.

public void
setUnusedNode(T
the Node
node
)

Once a Node is no longer used in a cell, it is given back.

Method Detail

getNodeback to summary
public Node getNode(SpreadsheetCell cell)

Returns a 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.

Parameters
cell:SpreadsheetCell

the considered SpreadsheetCell

Returns:Node

a Node to display in the cell graphic

getTypeback to summary
public Class<T> getType()

Returns the exact class used in this CellGraphicFactory. It is used to determine if the cell's graphic is handled by the cell of by this interface.

Returns:Class<T>

the exact class used in this CellGraphicFactory

loadback to summary
public 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. Beware, only reload when necessary! This method can be called several times with the same Node and itemValue.

Parameters
node:T

the considered Node

cell:SpreadsheetCell

the considered SpreadsheetCell

loadStyleback to summary
public void loadStyle(T node, SpreadsheetCell cell, Font font, Paint textFill, Pos alignment, 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.

Parameters
node:T

the considered Node, may be null for empty cell.

cell:SpreadsheetCell

the considered SpreadsheetCell

font:Font

the cell Font

textFill:Paint

the text's color

alignment:Pos

the cell's vertical and horizontal alignment

background:Background

the cell's background

setUnusedNodeback to summary
public void setUnusedNode(T node)

Once a Node is no longer used in a cell, it is given back.

Parameters
node:T

the Node