java.lang.Object
javafx.scene.control.SkinBase<C>
javafx.scene.control.skin.VirtualContainerBase<C,I>
javafx.scene.control.skin.TableViewSkinBase<ObservableList<SpreadsheetCell>,ObservableList<SpreadsheetCell>,TableView<ObservableList<SpreadsheetCell>>,TableRow<ObservableList<SpreadsheetCell>>,TableColumn<ObservableList<SpreadsheetCell>,?>>
impl.org.controlsfx.spreadsheet.GridViewSkin
- All Implemented Interfaces:
Skin<TableView<ObservableList<SpreadsheetCell>>>
public class GridViewSkin
extends TableViewSkinBase<ObservableList<SpreadsheetCell>,ObservableList<SpreadsheetCell>,TableView<ObservableList<SpreadsheetCell>>,TableRow<ObservableList<SpreadsheetCell>>,TableColumn<ObservableList<SpreadsheetCell>,?>>
This skin is actually the skin of the SpreadsheetGridView (tableView)
contained within the SpreadsheetView. The skin for the SpreadsheetView itself
currently resides inside the SpreadsheetView constructor!
We need to extends directly from TableViewSkinBase in order to work-around
https://javafx-jira.kenai.com/browse/RT-34753 if we want to set a custom
TableViewBehavior.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault height of a row.protected final SpreadsheetHandleprotected HorizontalPickerprotected SpreadsheetViewprotected VerticalHeader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidWe compute the total height of the fixedRows so that the selection can use it without performance regression.final booleancontainsRow(int index) Indicate whether or not the row at the specified index is currently being displayed.protected TableHeaderRowprotected VirtualFlow<TableRow<ObservableList<SpreadsheetCell>>>intprotected final ObservableSet<Integer>intgetFirstRow(SpreadsheetCell cell, int index) This return the first index displaying a cell in case of a rowSpan.doublegetHBar()final intgetRow(int index) This return the row at the specified index in the list.doublegetRowHeight(int row) Compute the height of a particular row.getRowIndexed(int index) This return the GridRow which has the specified index if found.Contains the index of the sortedList.getVBar()protected final voidinit()* PRIVATE/PROTECTED METHOD * *protected voidlayoutChildren(double x, double y, double w, double h) protected voidprotected voidprotected voidprotected voidvoidresize(TableColumnBase<?, ?> tc, int maxRows) Used in the HorizontalColumnHeader when we need to resize in double click.voidresizeColumnToFitContent(TableColumn<ObservableList<SpreadsheetCell>, ?> tc, int maxRows) We want to have extra space when displaying LocalDate because they will use an editor that display a little icon on the right.voidvoidWill compute for every row the necessary height and fit the line.voidvoidresizeRowToFitContent(int modelRow) Will compute for the row the necessary height and fit the line.voidprotected voidvoidsetHbarValue(double value) If the scene is not yet instantiated, we need to wait otherwise the VirtualFlow will not shift the cells properly.voidsetHbarValue(double value, int count) Methods inherited from class javafx.scene.control.skin.TableViewSkinBase
computePrefHeight, computePrefWidth, dispose, getTableHeaderRow, onFocusLeftCell, onFocusRightCell, onMoveToFirstCell, onMoveToLastCell, onScrollPageDown, onScrollPageUp, onSelectLeftCell, onSelectRightCell, queryAccessibleAttribute, updateItemCountMethods inherited from class javafx.scene.control.skin.VirtualContainerBase
getVirtualFlow, markItemCountDirtyMethods inherited from class javafx.scene.control.SkinBase
computeBaselineOffset, computeMaxHeight, computeMaxWidth, computeMinHeight, computeMinWidth, consumeMouseEvents, executeAccessibleAction, getChildren, getClassCssMetaData, getCssMetaData, getNode, getSkinnable, layoutInArea, layoutInArea, layoutInArea, positionInArea, positionInArea, pseudoClassStateChanged, registerChangeListener, registerInvalidationListener, registerListChangeListener, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, unregisterChangeListeners, unregisterInvalidationListeners, unregisterListChangeListeners
-
Field Details
-
DEFAULT_CELL_HEIGHT
public static final double DEFAULT_CELL_HEIGHTDefault height of a row.- See Also:
-
handle
-
spreadsheetView
-
verticalHeader
-
horizontalPickers
-
-
Constructor Details
-
GridViewSkin
* CONSTRUCTOR * *
-
-
Method Details
-
getRowHeight
public double getRowHeight(int row) Compute the height of a particular row. If the row is inGrid.AUTOFIT,DEFAULT_CELL_HEIGHTis returned.- Parameters:
row-- Returns:
-
getFixedRowHeight
public double getFixedRowHeight() -
getSelectedRows
Contains the index of the sortedList.- Returns:
-
getSelectedColumns
-
getSpreadsheetCellEditorImpl
-
getRowIndexed
This return the GridRow which has the specified index if found. Otherwise null is returned.- Parameters:
index-- Returns:
-
getFirstRow
This return the first index displaying a cell in case of a rowSpan. If the returned index is the same as given, it means the current cell is the one showing. Otherwise, it means another cell above will be the one drawn.- Parameters:
cell-index-- Returns:
-
getRow
This return the row at the specified index in the list. The index specified HAS NOTHING to do with the index of the row.- Parameters:
index-- Returns:
- See Also:
-
containsRow
public final boolean containsRow(int index) Indicate whether or not the row at the specified index is currently being displayed.- Parameters:
index-- Returns:
-
getCellsSize
public int getCellsSize() -
getHBar
-
getVBar
-
resizeRowsToFitContent
public void resizeRowsToFitContent()Will compute for every row the necessary height and fit the line. This can degrade performance a lot so need to use it wisely. But I don't see other solutions right now. -
resizeRowToFitContent
public void resizeRowToFitContent(int modelRow) Will compute for the row the necessary height and fit the line. This can degrade performance a lot so need to use it wisely. But I don't see other solutions right now.- Parameters:
modelRow-
-
resizeRowsToMaximum
public void resizeRowsToMaximum() -
resizeRowsToDefault
public void resizeRowsToDefault() -
resizeColumnToFitContent
public void resizeColumnToFitContent(TableColumn<ObservableList<SpreadsheetCell>, ?> tc, int maxRows) We want to have extra space when displaying LocalDate because they will use an editor that display a little icon on the right. Thus, that icon is reducing the visibility of the date string. -
init
protected final void init()* PRIVATE/PROTECTED METHOD * * -
getBehavior
-
getCurrentlyFixedRow
-
getColumns
-
resize
Used in the HorizontalColumnHeader when we need to resize in double click.- Parameters:
tc-maxRows-
-
layoutChildren
protected void layoutChildren(double x, double y, double w, double h) -
onFocusAboveCell
protected void onFocusAboveCell() -
onFocusBelowCell
protected void onFocusBelowCell() -
onSelectAboveCell
protected void onSelectAboveCell() -
onSelectBelowCell
protected void onSelectBelowCell() -
createVirtualFlow
- Overrides:
createVirtualFlowin classVirtualContainerBase<TableView<ObservableList<SpreadsheetCell>>,TableRow<ObservableList<SpreadsheetCell>>>
-
createTableHeaderRow
-
getHorizontalHeader
-
scrollHorizontally
public void scrollHorizontally() -
scrollHorizontally
-
computeFixedRowHeight
public void computeFixedRowHeight()We compute the total height of the fixedRows so that the selection can use it without performance regression. -
getItemCount
public final int getItemCount()- Specified by:
getItemCountin classVirtualContainerBase<TableView<ObservableList<SpreadsheetCell>>,TableRow<ObservableList<SpreadsheetCell>>>
-
setHbarValue
public void setHbarValue(double value) If the scene is not yet instantiated, we need to wait otherwise the VirtualFlow will not shift the cells properly.- Parameters:
value-
-
setHbarValue
public void setHbarValue(double value, int count)
-