Top Fields Constructors Methods
impl.org.controlsfx.spreadsheet

pack-priv final Class GridVirtualFlow<T extends IndexedCell<?>>

extends VirtualFlow<T extends IndexedCell<?>>
Class Inheritance
Imports
java.util.ArrayList, .Collections, .Comparator, .List, .Map.Entry, .Set, javafx.beans.Observable, javafx.beans.binding.When, javafx.beans.value.ChangeListener, .ObservableValue, javafx.collections.ObservableList, javafx.geometry.Pos, javafx.scene.Group, .Node, javafx.scene.control.IndexedCell, .ScrollBar, .TableRow, javafx.scene.control.skin.VirtualFlow, javafx.scene.input.MouseEvent, javafx.scene.layout.Region, .StackPane, javafx.scene.shape.Rectangle, javafx.scene.transform.Scale, org.controlsfx.control.spreadsheet.SpreadsheetCell, .SpreadsheetView

Field Summary

Modifier and TypeField and Description
private StackPane
private final GridViewSkin
private final ChangeListener<Number>
private final ArrayList<T>
myFixedCells

Store the fixedRow in order to place them at the top when necessary.

private static final Comparator<GridRow>
ROWCMP

With that comparator we can lay out our rows in the reverse order.

private Scale
public final List<Node>
private SpreadsheetView
spreadSheetView

Private Fields * *

Constructor Summary

AccessConstructor and Description
public
GridVirtualFlow(GridViewSkin gridViewSkin)

Constructor * *

Method Summary

Modifier and TypeMethod and Description
private T
containsRows(int i)

Verify if the row has been added to myFixedCell

private void
findCorner()

WARNING : This is bad but no other options right now.

private List<Node>
findSheetChildren()

WARNING : This is bad but no other options right now.

protected List<T>
getCells()

Overrides javafx.scene.control.skin.VirtualFlow.getCells.

Returns the list of cells displayed in the current viewport.

pack-priv List<T>
protected ScrollBar
pack-priv GridRow
getTopRow()

We need to return here the very top row in term of "z-order".

protected ScrollBar
public void
init(SpreadsheetView spv)

Public Methods * *

protected void
layoutChildren()

Overrides javafx.scene.control.skin.VirtualFlow.layoutChildren.

Invoked during the layout pass to layout the children in this Parent.

private void
layoutFixedRows()

Layout the fixed rows to position them correctly

protected void
layoutTotal()

Layout all the visible rows

private void
removeDeportedCells()

When we layout, we also remove the cell that have been deported into other rows in order not to have some TableCell hanging out.

public double
scrollPixels(final double delta)

Overrides javafx.scene.control.skin.VirtualFlow.scrollPixels.

Given a delta value representing a number of pixels, this method attempts to move the VirtualFlow in the given direction (positive is down/right, negative is up/left) the given number of pixels.

public void
scrollTo(int index)

Overrides javafx.scene.control.skin.VirtualFlow.scrollTo, javafx.scene.control.skin.VirtualFlow.scrollTo.

Adjusts the cells such that the cell in the given index will be fully visible in the viewport.

private void
sortRows()

Sort the rows so that they stay in order for layout

Inherited from javafx.scene.control.skin.VirtualFlow:
addAllToPilecellCountPropertycellFactoryPropertycomputePrefHeightcomputePrefWidthfixedCellSizePropertygetAvailableCellgetCellgetCellCountgetCellFactorygetCellIndexgetFirstVisibleCellgetFirstVisibleCellWithinViewportgetFixedCellSizegetHbargetLastVisibleCellgetLastVisibleCellWithinViewportgetPositiongetPrivateCellgetVbargetViewportLengthgetVisibleCellisPannableisVerticalpannablePropertypositionPropertyrebuildCellsreconfigureCellsrecreateCellsrequestCellLayoutrequestLayoutresizeCellscrollToBottomscrollToTopscrollToTopsetCellCountsetCellFactorysetCellIndexsetFixedCellSizesetHeightsetPannablesetPositionsetVerticalsetWidthverticalProperty

Field Detail

cornerback to summary
private StackPane corner

Hides javafx.scene.control.skin.VirtualFlow.corner.

gridViewSkinback to summary
private final GridViewSkin gridViewSkin
hBarValueChangeListenerback to summary
private final ChangeListener<Number> hBarValueChangeListener
myFixedCellsback to summary
private final ArrayList<T> myFixedCells

Store the fixedRow in order to place them at the top when necessary. That is to say, when the VirtualFlow has not already placed one.

ROWCMPback to summary
private static final Comparator<GridRow> ROWCMP

With that comparator we can lay out our rows in the reverse order. That is to say from the bottom to the very top. In that manner we are sure that our spanning cells will COVER the cell below so we don't have any problems with missing hovering, the editor jammed etc.
The only problem is for the fixed column but the getTopRow(int) now returns the very first row and allow us to put some privileged TableCell in it if they feel the need to be on top in term of z-order. FIXME The best would be to put a TreeList of something like that in order not to sort the rows everytime, need investigation..

scaleback to summary
private Scale scale
sheetChildrenback to summary
public final List<Node> sheetChildren

Hides javafx.scene.control.skin.VirtualFlow.sheetChildren.

spreadSheetViewback to summary
private SpreadsheetView spreadSheetView

Private Fields * *

Constructor Detail

GridVirtualFlowback to summary
public GridVirtualFlow(GridViewSkin gridViewSkin)

Constructor * *

Method Detail

containsRowsback to summary
private T containsRows(int i)

Verify if the row has been added to myFixedCell

findCornerback to summary
private void findCorner()

WARNING : This is bad but no other options right now. This will find the corner where the two scrollBars are joigning.

findSheetChildrenback to summary
private List<Node> findSheetChildren()

WARNING : This is bad but no other options right now. This will find the sheetChildren of the VirtualFlow, aka where the cells are kept and clipped. See layoutFixedRows() or getTopRow() for use.

getCellsback to summary
protected List<T> getCells()

Overrides javafx.scene.control.skin.VirtualFlow.getCells.

Doc from javafx.scene.control.skin.VirtualFlow.getCells.

Returns the list of cells displayed in the current viewport.

The cells are ordered such that the first cell in this list is the first in the view, and the last cell is the last in the view. When pixel scrolling, the list is simply shifted and items drop off the beginning or the end, depending on the order of scrolling.

Annotations
@Override
getFixedCellsback to summary
pack-priv List<T> getFixedCells()
getHorizontalBarback to summary
protected ScrollBar getHorizontalBar()
getTopRowback to summary
pack-priv GridRow getTopRow()

We need to return here the very top row in term of "z-order". Because we will add in this row the TableCell that are in fixedColumn and which needs to be drawn on top of all others.

getVerticalBarback to summary
protected ScrollBar getVerticalBar()
initback to summary
public void init(SpreadsheetView spv)

Public Methods * *

layoutChildrenback to summary
protected void layoutChildren()

Overrides javafx.scene.control.skin.VirtualFlow.layoutChildren.

Doc from javafx.scene.control.skin.VirtualFlow.layoutChildren.

Invoked during the layout pass to layout the children in this Parent. By default it will only set the size of managed, resizable content to their preferred sizes and does not do any node positioning.

Subclasses should override this function to layout content as needed.

Annotations
@Override
layoutFixedRowsback to summary
private void layoutFixedRows()

Layout the fixed rows to position them correctly

layoutTotalback to summary
protected void layoutTotal()

Layout all the visible rows

removeDeportedCellsback to summary
private void removeDeportedCells()

When we layout, we also remove the cell that have been deported into other rows in order not to have some TableCell hanging out. When scrolling with mouse wheel, we will request the layout of all rows, but only one row will be really called. Thus by wiping entirely the deportedCell, all cells in fixedColumns are gone. So we must be smarter.

scrollPixelsback to summary
public double scrollPixels(final double delta)

Overrides javafx.scene.control.skin.VirtualFlow.scrollPixels.

Doc from javafx.scene.control.skin.VirtualFlow.scrollPixels.

Given a delta value representing a number of pixels, this method attempts to move the VirtualFlow in the given direction (positive is down/right, negative is up/left) the given number of pixels. It returns the number of pixels actually moved.

Annotations
@Override
scrollToback to summary
public void scrollTo(int index)

Overrides javafx.scene.control.skin.VirtualFlow.scrollTo, javafx.scene.control.skin.VirtualFlow.scrollTo.

Doc from javafx.scene.control.skin.VirtualFlow.scrollTo.

Adjusts the cells such that the cell in the given index will be fully visible in the viewport.

Annotations
@Override
sortRowsback to summary
private void sortRows()

Sort the rows so that they stay in order for layout