TableView

open class TableView<T>(    posX: Number = 0,     posY: Number = 0,     width: Number = DEFAULT_TABLE_VIEW_WIDTH,     height: Number = DEFAULT_TABLE_VIEW_HEIGHT,     columns: List<TableColumn<T>> = emptyList(),     items: List<T> = emptyList(),     visual: Visual = ColorVisual.WHITE,     selectionMode: SelectionMode = SelectionMode.SINGLE,     selectionBackground: ColorVisual = ColorVisual.BLUE) : StructuredDataView<T>

A TableView may be used to visualize a data table.

The items list is used as the data model. The columns list defines how the data is represented.

Simplified example on how the columns list is used to represent the data:

items: 1, 2, 3

columns: ("first", {x -> x+1}, 10),

    ("second", {x -> "nice string " + x}, 14),

("third", {x -> "" + x*x + "!"}, 10)

Representation:

|first |second |third |

|----------|--------------|----------|

|2 |nice string 1 |1! |

|3 |nice string 2 |4! |

|4 |nice string 3 |9! |

Note that the components Font will be ignored. Use the font field for each TableColumn.

See also

Parameters

T

Generic TableView content.

posX

Horizontal coordinate for this TableView. Default: 0.

posY

Vertical coordinate for this TableView. Default: 0.

width

Width for this TableView. Default: DEFAULT_TABLE_VIEW_WIDTH.

height

Height for this TableView. Default: DEFAULT_TABLE_VIEW_HEIGHT.

columns

Initial columns for this TableView. Default: empty list.

items

Initial list of items for this TableView. Default: empty list.

visual

Background Visual. Default: ColorVisual.WHITE.

selectionMode

Selection mode to be used for this TableView. Default: SelectionMode.SINGLE.

selectionBackground

Background for selected items in this TableView. Default: ColorVisual.BLUE.

Constructors

Link copied to clipboard
fun <T> TableView(    posX: Number = 0,     posY: Number = 0,     width: Number = DEFAULT_TABLE_VIEW_WIDTH,     height: Number = DEFAULT_TABLE_VIEW_HEIGHT,     columns: List<TableColumn<T>> = emptyList(),     items: List<T> = emptyList(),     visual: Visual = ColorVisual.WHITE,     selectionMode: SelectionMode = SelectionMode.SINGLE,     selectionBackground: ColorVisual = ColorVisual.BLUE)

Creates a TableView.

Functions

Link copied to clipboard
fun clearSelection()

Clears selection of items. Instantly returns if no item is currently selected.

Link copied to clipboard
fun offset(offsetX: Number, offsetY: Number)

Adds an offset to this ComponentView's Position.

Link copied to clipboard
fun removeFromParent(): ComponentView

Removes this component from its parent.

Link copied to clipboard
fun reposition(posX: Number, posY: Number)

Repositions this ComponentView to the specified coordinates.

Link copied to clipboard
fun resize(width: Number, height: Number)

Resizes this ComponentView to the specified width and height.

Link copied to clipboard
fun rotate(degrees: Number)

Rotates this ComponentView by the given number of degrees.

Link copied to clipboard
fun scale(scalar: Number)

Scales this ComponentView by the given scalar.

Link copied to clipboard
fun scaleX(scalar: Number)

Scales this ComponentView's width by the given scalar.

Link copied to clipboard
fun scaleY(scalar: Number)

Scales this ComponentView's height by the given scalar.

Link copied to clipboard
fun select(element: T)

Selects the specified element. Clears current selection.

fun select(index: Int)

Selects the element at the specified index in this UIComponent. Clears current selection.

Link copied to clipboard
fun selectAll()

Selects all items in this UIComponent.

Link copied to clipboard
fun selectFirst()

Selects the first element in this UIComponent. Clears current selection.

Link copied to clipboard
fun selectLast()

Selects the last element in this UIComponent. Clears current selection.

Link copied to clipboard
fun selectNext()

Selects the next element in this UIComponent. Clears current selection.

Link copied to clipboard
fun selectPrevious()

Selects the previous element in this UIComponent. Clears current selection.

Link copied to clipboard
fun toBack()

Puts the ComponentView to the back inside its parent and Changes its zIndex accordingly.

Link copied to clipboard
fun toFront()

Puts the ComponentView to the front inside its parent and Changes its zIndex accordingly.

Properties

Link copied to clipboard
var actualHeight: Double

The actual height for this ComponentView considering scale.

Link copied to clipboard
var actualPosX: Double

Horizontal position of this ComponentView considering scale.

Link copied to clipboard
var actualPosY: Double

Vertical position of this ComponentView considering scale.

Link copied to clipboard
var actualWidth: Double

The actual width for this ComponentView considering scale.

Link copied to clipboard
var backgroundStyle: String

Css style that gets applied to this UIComponent's background.

Link copied to clipboard
val backgroundStyleProperty: StringProperty

Property for the css style that gets applied to this UIComponent's background.

Link copied to clipboard
val columns: ObservableList<TableColumn<T>>

An ObservableList that contains TableColumns which specify how the data is represented in that column. The first TableColumn in this ObservableList will be the leftmost column in the rendered TableView.

Link copied to clipboard
var componentStyle: String

Css style that gets applied to this UIComponent.

Link copied to clipboard
val componentStyleProperty: StringProperty

Property for the css style that gets applied to this UIComponent.

Link copied to clipboard
var dropAcceptor: (DragEvent) -> Boolean?

Returns whether this ComponentView is a valid drop target for the dragged component in the given DragEvent or not.

Link copied to clipboard
var font: Font

Font of this UIComponent. Usage depends on subclass.

Link copied to clipboard
val fontProperty: Property<Font>

Property for the Font of this UIComponent. Usage depends on subclass.

Link copied to clipboard
var height: Double

The height for this ComponentView.

Link copied to clipboard
val heightProperty: DoubleProperty

Property for the height of this ComponentView.

Link copied to clipboard
var isDisabled: Boolean

Controls if user input events cause input functions of this ComponentView to get invoked.

Link copied to clipboard
val isDisabledProperty: BooleanProperty

Property that controls if user input events cause input functions of this ComponentView to get invoked.

Link copied to clipboard
var isFocusable: Boolean

Controls whether this ComponentView is focusable or not.

Link copied to clipboard
val isFocusableProperty: BooleanProperty

Property that controls whether this ComponentView is focusable or not.

Link copied to clipboard
var isVisible: Boolean

Visibility of this ComponentView.

Link copied to clipboard
val isVisibleProperty: BooleanProperty

Property for the visibility of this ComponentView.

Link copied to clipboard
val items: ObservableList<T>

An ObservableList that contains the data objects. The first object in this ObservableList will be the topmost row in the rendered UIComponent.

Link copied to clipboard
var layoutBounds: CoordinatePlain

Returns a CoordinatePlain containing the component's corner Coordinates and its layout bounds.

Link copied to clipboard
var name: String

Name field only for debugging purposes. Has no effect on rendering.

Link copied to clipboard
var onDragDropped: (DragEvent) -> Unit?

Gets invoked with a DragEvent whenever a drag and drop gesture finishes over this ComponentView and the dropAcceptor returns true for the given DragEvent.

Link copied to clipboard
var onDragGestureEntered: (DragEvent) -> Unit?

Gets invoked with a DragEvent whenever the mouse enters this ComponentView while performing a drag gesture.

Link copied to clipboard
var onDragGestureExited: (DragEvent) -> Unit?

Gets invoked with a DragEvent whenever the mouse leaves this ComponentView while performing a drag gesture.

Link copied to clipboard
var onKeyPressed: (KeyEvent) -> Unit?

Gets invoked with a KeyEvent whenever a key is pressed while this ComponentView has focus.

Link copied to clipboard
var onKeyReleased: (KeyEvent) -> Unit?

Gets invoked with a KeyEvent whenever a key is released while this ComponentView has focus.

Link copied to clipboard
var onKeyTyped: (KeyEvent) -> Unit?

Gets invoked with a KeyEvent whenever a Character is typed while this ComponentView has focus. Gets invoked after onKeyPressed.

Link copied to clipboard
var onMouseClicked: (MouseEvent) -> Unit?

Gets invoked with a MouseEvent whenever the mouse is clicked inside this ComponentView. Gets invoked after onMousePressed and onMouseReleased.

Link copied to clipboard
var onMouseEntered: (MouseEvent) -> Unit?

Gets invoked with a MouseEvent whenever the mouse enters this ComponentView.

Link copied to clipboard
var onMouseExited: (MouseEvent) -> Unit?

Gets invoked with a MouseEvent whenever the mouse leaves this ComponentView.

Link copied to clipboard
var onMousePressed: (MouseEvent) -> Unit?

Gets invoked with a MouseEvent whenever the mouse is pressed inside this ComponentView.

Link copied to clipboard
var onMouseReleased: (MouseEvent) -> Unit?

Gets invoked with a MouseEvent whenever the mouse is released inside this ComponentView.

Link copied to clipboard
var onScroll: (ScrollEvent) -> Unit?

Gets invoked with a ScrollEvent whenever the mouse wheel is turned while the mouse is inside this ComponentView.

Link copied to clipboard
var opacity: Double

Opacity of this ComponentView.

Link copied to clipboard
val opacityProperty: LimitedDoubleProperty

Property for the opacity of this ComponentView.

Link copied to clipboard
var parent: ComponentView?

The parent of this ComponentView.

Link copied to clipboard
var posX: Double

Horizontal position of this ComponentView.

Link copied to clipboard
val posXProperty: DoubleProperty

Property for the horizontal position of this ComponentView.

Link copied to clipboard
var posY: Double

Vertical position of this ComponentView.

Link copied to clipboard
val posYProperty: DoubleProperty

Property for the vertical position of this ComponentView.

Link copied to clipboard
var rotation: Double

Rotation of this ComponentView in degrees.

Link copied to clipboard
val rotationProperty: DoubleProperty

Property for the rotation of this ComponentView in degrees.

Link copied to clipboard
var scale: Double

Scale of this ComponentView.

Link copied to clipboard
var scaleX: Double

Horizontal scale of this ComponentView.

Link copied to clipboard
val scaleXProperty: DoubleProperty

Property for the horizontal scale of this ComponentView.

Link copied to clipboard
var scaleY: Double

Vertical scale of this ComponentView.

Link copied to clipboard
val scaleYProperty: DoubleProperty

Property for the vertical scale of this ComponentView.

Link copied to clipboard
val selectedIndices: ReadonlyObservableList<Int>

ReadonlyObservableList containing indices of all currently selected items in this UIComponent. Register a listener to listen for selection changes. Item selection is enabled via selectionMode.

Link copied to clipboard
val selectedItems: ReadonlyObservableList<T>

ReadonlyObservableList containing all currently selected items in this UIComponent. Register a listener to listen for selection changes. Item selection is enabled via selectionMode.

Link copied to clipboard
var selectionBackground: ColorVisual

Background color for selected items in this UIComponent. Item selection is enabled via selectionMode.

Link copied to clipboard
val selectionBackgroundProperty: Property<ColorVisual>

Property for the background color for selected items in this UIComponent. Item selection is enabled via selectionMode.

Link copied to clipboard
var selectionMode: SelectionMode

Selection mode to be used for this UIComponent.

Link copied to clipboard
val selectionModeProperty: Property<SelectionMode>
Link copied to clipboard
var selectionStyle: String

Style of selected items in this UIComponent. Item selection is enabled via selectionMode.

Link copied to clipboard
val selectionStyleProperty: Property<String>

Property for the style of selected items in this UIComponent. Item selection is enabled via selectionMode.

Link copied to clipboard
open var visual: Visual

Current Visual.

Link copied to clipboard
var width: Double

The width for this ComponentView.

Link copied to clipboard
val widthProperty: DoubleProperty

Property for the width of this ComponentView.

Link copied to clipboard
var zIndex: Int

for the order of ComponentView inside of parent.#

Link copied to clipboard
val zIndexProperty: IntegerProperty

Property for the order of ComponentView inside of parent.#