Top Description Fields Constructors Methods
impl.org.controlsfx.spreadsheet

public Class CellViewSkin

extends TableCellSkin<ObservableList<SpreadsheetCell>, SpreadsheetCell>
Class Inheritance
Imports
java.util.UUID, javafx.beans.value.ChangeListener, .ObservableValue, .WeakChangeListener, javafx.collections.ObservableList, javafx.event.Event, .EventHandler, .EventType, .WeakEventHandler, javafx.geometry.HPos, .Insets, .Pos, .VPos, javafx.scene.Node, javafx.scene.control.MenuButton, .TableColumn, javafx.scene.control.skin.TableCellSkin, javafx.scene.image.ImageView, javafx.scene.layout.Region, org.controlsfx.control.spreadsheet.Filter, .SpreadsheetCell, .SpreadsheetCell.CornerPosition

This is the skin for the CellView. Its main goal is to draw an object (a triangle) on cells which have their SpreadsheetCell#commentedProperty() set to true.

Field Summary

Modifier and TypeField and Description
private static final String
private static final String
private Region
private Region
private final ChangeListener<TableColumn<S, T>>
public static final EventType<Event>
FILTER_EVENT_TYPE

This EventType can be used with an EventHandler in order to catch when a SpreadsheetCell filter is activated/deactivated on this column.

private MenuButton
private final ChangeListener<SpreadsheetCell>
private static final String
private static final String
private Region
topLeftRegion

The region we will add on the cell when necessary.

private Region
private static final int
TRIANGLE_SIZE

The size of the edge of the triangle FIXME Handling of static variable will be changed.

private final EventHandler<Event>
private final WeakChangeListener<TableColumn<S, T>>
private final WeakChangeListener<SpreadsheetCell>
private final WeakEventHandler<T extends Event>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected double
computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.skin.LabeledSkinBase.computePrefHeight.

Calculates the preferred height of this SkinBase.

protected double
computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.skin.TableCellSkinBase.computePrefWidth.

Calculates the preferred width of this SkinBase.

private static Region
private void
private void
private void
handleFilter(double x, final double y, final double w, final double h)

private void
private void
protected void
layoutChildren(double x, final double y, final double w, final double h)

Overrides javafx.scene.control.skin.TableCellSkinBase.layoutChildren.

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

private void
private void
Inherited from javafx.scene.control.skin.TableCellSkin:
disposetableColumnProperty

Field Detail

BOTTOM_LEFT_CLASSback to summary
private static final String BOTTOM_LEFT_CLASS
BOTTOM_RIGHT_CLASSback to summary
private static final String BOTTOM_RIGHT_CLASS
bottomLeftRegionback to summary
private Region bottomLeftRegion
bottomRightRegionback to summary
private Region bottomRightRegion
columnChangeListenerback to summary
private final ChangeListener<TableColumn<S, T>> columnChangeListener
FILTER_EVENT_TYPEback to summary
public static final EventType<Event> FILTER_EVENT_TYPE

This EventType can be used with an EventHandler in order to catch when a SpreadsheetCell filter is activated/deactivated on this column.

filterButtonback to summary
private MenuButton filterButton
itemChangeListenerback to summary
private final ChangeListener<SpreadsheetCell> itemChangeListener
TOP_LEFT_CLASSback to summary
private static final String TOP_LEFT_CLASS
TOP_RIGHT_CLASSback to summary
private static final String TOP_RIGHT_CLASS
topLeftRegionback to summary
private Region topLeftRegion

The region we will add on the cell when necessary.

topRightRegionback to summary
private Region topRightRegion
TRIANGLE_SIZEback to summary
private static final int TRIANGLE_SIZE

The size of the edge of the triangle FIXME Handling of static variable will be changed.

triangleEventHandlerback to summary
private final EventHandler<Event> triangleEventHandler
weakColumnChangeListenerback to summary
private final WeakChangeListener<TableColumn<S, T>> weakColumnChangeListener
weakItemChangeListenerback to summary
private final WeakChangeListener<SpreadsheetCell> weakItemChangeListener
weakTriangleEventHandlerback to summary
private final WeakEventHandler<T extends Event> weakTriangleEventHandler

Constructor Detail

CellViewSkinback to summary
public CellViewSkin(CellView tableCell)

Method Detail

computePrefHeightback to summary
protected double computePrefHeight(double width, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.skin.LabeledSkinBase.computePrefHeight.

Doc from javafx.scene.control.skin.LabeledSkinBase.computePrefHeight.

Calculates the preferred height of this SkinBase. 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.

Annotations
@Override
computePrefWidthback to summary
protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset)

Overrides javafx.scene.control.skin.TableCellSkinBase.computePrefWidth.

Doc from javafx.scene.control.skin.TableCellSkinBase.computePrefWidth.

Calculates the preferred width of this SkinBase. 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.

Annotations
@Override
getRegionback to summary
private static Region getRegion(SpreadsheetCell.CornerPosition position)
handleBottomLeftback to summary
private void handleBottomLeft(SpreadsheetCell cell)
handleBottomRightback to summary
private void handleBottomRight(SpreadsheetCell cell)
handleFilterback to summary
private void handleFilter(double x, final double y, final double w, final double h)
handleTopLeftback to summary
private void handleTopLeft(SpreadsheetCell cell)
handleTopRightback to summary
private void handleTopRight(SpreadsheetCell cell)
layoutChildrenback to summary
protected void layoutChildren(double x, final double y, final double w, final double h)

Overrides javafx.scene.control.skin.TableCellSkinBase.layoutChildren.

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

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

Annotations
@Override
layoutTriangleback to summary
private void layoutTriangle()
removeMenuButtonback to summary
private void removeMenuButton()