Module javafx.controls
Package javafx.scene.control.skin
Class TableRowSkinBase<T,C extends IndexedCell,R extends IndexedCell>
- java.lang.Object
-
- javafx.scene.control.SkinBase<C>
-
- javafx.scene.control.skin.LabeledSkinBase<C>
-
- javafx.scene.control.skin.CellSkinBase<C>
-
- javafx.scene.control.skin.TableRowSkinBase<T,C,R>
-
- Type Parameters:
T
- The type of the cell (i.e. the generic type of theIndexedCell
subclass).C
- The cell type (e.g. TableRow or TreeTableRow)R
- The type of cell that is contained within each row (e.g.or {@link javafx.scene.control.TreeTableCell}
).
- All Implemented Interfaces:
Skin<C>
- Direct Known Subclasses:
TableRowSkin
,TreeTableRowSkin
public abstract class TableRowSkinBase<T,C extends IndexedCell,R extends IndexedCell> extends CellSkinBase<C>
TableRowSkinBase is the base skin class used by controls such asTableRow
andTreeTableRow
(the concrete classes areTableRowSkin
andTreeTableRowSkin
, respectively).- Since:
- 9
- See Also:
TableRow
,TreeTableRow
,TableRowSkin
,TreeTableRowSkin
-
-
Property Summary
Properties Type Property Description protected ObjectProperty<Node>
graphic
Returns the graphic to draw on the inside of the disclosure node.-
Properties inherited from class javafx.scene.control.skin.CellSkinBase
cellSize
-
-
Constructor Summary
Constructors Constructor Description TableRowSkinBase(C control)
Creates a new instance of TableRowSkinBase, although note that this instance does not handle any behavior / input mappings - this needs to be handled appropriately by subclasses.
-
Method Summary
Modifier and Type Method Description protected double
computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
Computes the maximum allowable height of the Skin, based on the provided width.protected double
computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
Computes the minimum allowable height of the Skin, based on the provided width.protected double
computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
Calculates the preferred height of thisSkinBase
.protected double
computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
Calculates the preferred width of thisSkinBase
.protected abstract R
createCell(TableColumnBase<T,?> tc)
Creates a new cell instance that is suitable for representing the given table column instance.protected abstract TableColumnBase<T,?>
getTableColumn(R cell)
Returns theTableColumnBase
instance for the given cell instance.protected abstract ObservableList<? extends TableColumnBase>
getVisibleLeafColumns()
Returns an unmodifiable list containing the currently visible leaf columns.protected ObjectProperty<Node>
graphicProperty()
Returns the graphic to draw on the inside of the disclosure node.protected void
layoutChildren(double x, double y, double w, double h)
The Layout algorithm works like this: - Get the labeled w/h, graphic w/h, text w/h - Compute content w/h based on graphicVPos, graphicHPos, graphicTextGap, and graphic w/h and text w/h - (Note that the text content has been pre-truncated where necessary) - compute content x/y based on content w/h and labeled w/h and the labeled's hpos and vpos - position the graphic and textprotected abstract void
updateCell(R cell, C row)
A method to allow the given cell to be told that it is a member of the given row.-
Methods inherited from class javafx.scene.control.skin.CellSkinBase
cellSizeProperty, getCellSize, getClassCssMetaData, getCssMetaData
-
Methods inherited from class javafx.scene.control.skin.LabeledSkinBase
computeBaselineOffset, computeMaxWidth, computeMinWidth, layoutLabelInArea, layoutLabelInArea, queryAccessibleAttribute, updateChildren
-
Methods inherited from class javafx.scene.control.SkinBase
consumeMouseEvents, dispose, executeAccessibleAction, getChildren, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, registerChangeListener, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, unregisterChangeListeners
-
-
-
-
Property Detail
-
graphic
protected ObjectProperty<Node> graphicProperty
Returns the graphic to draw on the inside of the disclosure node. Null is acceptable when no graphic should be shown. Commonly this is the graphic associated with a TreeItem (i.e. treeItem.getGraphic()), rather than a graphic associated with a cell.
-
-
Constructor Detail
-
TableRowSkinBase
public TableRowSkinBase(C control)
Creates a new instance of TableRowSkinBase, although note that this instance does not handle any behavior / input mappings - this needs to be handled appropriately by subclasses.- Parameters:
control
- The control that this skin should be installed onto.
-
-
Method Detail
-
createCell
protected abstract R createCell(TableColumnBase<T,?> tc)
Creates a new cell instance that is suitable for representing the given table column instance.- Parameters:
tc
- the table column- Returns:
- the created cell
-
updateCell
protected abstract void updateCell(R cell, C row)
A method to allow the given cell to be told that it is a member of the given row. How this is implemented is dependent on the actual cell implementation.- Parameters:
cell
- The cell for which we want to inform it of its owner row.row
- The row which will be set on the given cell.
-
getTableColumn
protected abstract TableColumnBase<T,?> getTableColumn(R cell)
Returns theTableColumnBase
instance for the given cell instance.- Parameters:
cell
- The cell for which a TableColumn is desired.- Returns:
- the table column
-
getVisibleLeafColumns
protected abstract ObservableList<? extends TableColumnBase> getVisibleLeafColumns()
Returns an unmodifiable list containing the currently visible leaf columns.- Returns:
- the list of visible leaf columns
-
graphicProperty
protected ObjectProperty<Node> graphicProperty()
Returns the graphic to draw on the inside of the disclosure node. Null is acceptable when no graphic should be shown. Commonly this is the graphic associated with a TreeItem (i.e. treeItem.getGraphic()), rather than a graphic associated with a cell.
-
layoutChildren
protected void layoutChildren(double x, double y, double w, double h)
The Layout algorithm works like this: - Get the labeled w/h, graphic w/h, text w/h - Compute content w/h based on graphicVPos, graphicHPos, graphicTextGap, and graphic w/h and text w/h - (Note that the text content has been pre-truncated where necessary) - compute content x/y based on content w/h and labeled w/h and the labeled's hpos and vpos - position the graphic and text- Overrides:
layoutChildren
in classLabeledSkinBase<C extends IndexedCell>
- Parameters:
x
- the x positiony
- the y positionw
- the widthh
- the height
-
computePrefWidth
protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)
Calculates the preferred width of thisSkinBase
. The default implementation calculates this width as the width of the area occupied by its managed children when they are positioned at their current positions at their preferred widths.- Overrides:
computePrefWidth
in classLabeledSkinBase<C extends IndexedCell>
- Parameters:
height
- the height that should be used if preferred width depends on ittopInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left inset- Returns:
- the calculated preferred width
-
computePrefHeight
protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
Calculates the preferred height of thisSkinBase
. The default implementation calculates this height as the height of the area occupied by its managed children when they are positioned at their current positions at their preferred heights.- Overrides:
computePrefHeight
in classLabeledSkinBase<C extends IndexedCell>
- Parameters:
width
- the width that should be used if preferred height depends on ittopInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left inset- Returns:
- the calculated preferred height
-
computeMinHeight
protected double computeMinHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
Computes the minimum allowable height of the Skin, based on the provided width.- Overrides:
computeMinHeight
in classLabeledSkinBase<C extends IndexedCell>
- Parameters:
width
- The width of the Skin, in case this value might dictate the minimum height.topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left inset- Returns:
- A double representing the minimum height of this Skin.
-
computeMaxHeight
protected double computeMaxHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)
Computes the maximum allowable height of the Skin, based on the provided width.- Overrides:
computeMaxHeight
in classLabeledSkinBase<C extends IndexedCell>
- Parameters:
width
- The width of the Skin, in case this value might dictate the maximum height.topInset
- the pixel snapped top insetrightInset
- the pixel snapped right insetbottomInset
- the pixel snapped bottom insetleftInset
- the pixel snapped left inset- Returns:
- A double representing the maximum height of this Skin.
-
-