Class TerraTableViewSkin
- java.lang.Object
-
- org.apache.pivot.wtk.skin.ComponentSkin
-
- org.apache.pivot.wtk.skin.terra.TerraTableViewSkin
-
- All Implemented Interfaces:
ComponentKeyListener
,ComponentListener
,ComponentMouseButtonListener
,ComponentMouseListener
,ComponentMouseWheelListener
,ComponentStateListener
,ComponentTooltipListener
,ConstrainedVisual
,Skin
,TableView.Skin
,TableViewColumnListener
,TableViewListener
,TableViewRowListener
,TableViewSelectionListener
,Visual
public class TerraTableViewSkin extends ComponentSkin implements TableView.Skin, TableViewListener, TableViewColumnListener, TableViewRowListener, TableViewSelectionListener
Table view skin.TODO Add disableMouseSelection style to support the case where selection should be enabled but the caller wants to implement the management of it; e.g. changing a message's flag state in an email client.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter, ComponentKeyListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter, ComponentListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter, ComponentMouseButtonListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter, ComponentMouseListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseWheelListener
ComponentMouseWheelListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter, ComponentStateListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentTooltipListener
ComponentTooltipListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TableViewColumnListener
TableViewColumnListener.Adapter, TableViewColumnListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TableViewListener
TableViewListener.Adapter, TableViewListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TableViewRowListener
TableViewRowListener.Adapter, TableViewRowListener.Listeners
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TableViewSelectionListener
TableViewSelectionListener.Adapter, TableViewSelectionListener.Listeners
-
-
Constructor Summary
Constructors Constructor Description TerraTableViewSkin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
columnCellRendererChanged(TableView.Column column, TableView.CellRenderer previousCellRenderer)
Called when a column's cell renderer has changed.void
columnFilterChanged(TableView.Column column, java.lang.Object previousFilter)
Called when a column's filter has changed.void
columnHeaderDataChanged(TableView.Column column, java.lang.Object previousHeaderData)
Called when a column's header data has changed.void
columnHeaderDataRendererChanged(TableView.Column column, TableView.HeaderDataRenderer previousHeaderDataRenderer)
Called when a column's header data renderer has changed.void
columnInserted(TableView tableView, int index)
Called when a column is inserted into a table view's column sequence.void
columnNameChanged(TableView.Column column, java.lang.String previousName)
Called when a column's name has changed.void
columnSourceChanged(TableView tableView, TableView previousColumnSource)
Called when a table view's column source has changed.void
columnsRemoved(TableView tableView, int index, Sequence<TableView.Column> columns)
Called when columns are removed from a table view's column sequence.void
columnWidthChanged(TableView.Column column, int previousWidth, boolean previousRelative)
Called when a column's width has changed.void
columnWidthLimitsChanged(TableView.Column column, int previousMinimumWidth, int previousMaximumWidth)
Called when a column's width limits have changed.void
disabledRowFilterChanged(TableView tableView, Filter<?> previousDisabledRowFilter)
Called when a table view's disabled row filter has changed.void
enabledChanged(Component component)
Called when a component's enabled state has changed.void
focusedChanged(Component component, Component obverseComponent)
Called when a component's focused state has changed.java.awt.Color
getAlternateRowBackgroundColor()
java.awt.Color
getBackgroundColor()
int
getBaseline(int width, int height)
Should be implemented in every subclass.Bounds
getCellBounds(int rowIndex, int columnIndex)
java.awt.Color
getColor()
int
getColumnAt(int x)
Bounds
getColumnBounds(int columnIndex)
java.awt.Color
getColumnSelectionColor()
java.awt.Color
getColumnSelectionHorizontalGridColor()
static ArrayList<java.lang.Integer>
getColumnWidths(TableView tableView, int width)
java.awt.Color
getDisabledColor()
java.awt.Font
getFont()
java.awt.Color
getHighlightBackgroundColor()
java.awt.Color
getHorizontalGridColor()
java.awt.Color
getInactiveSelectionBackgroundColor()
java.awt.Color
getInactiveSelectionColor()
boolean
getIncludeTrailingHorizontalGridLine()
boolean
getIncludeTrailingVerticalGridLine()
int
getPreferredHeight(int width)
Returns the visual's preferred height given the provided width constraint.Dimensions
getPreferredSize()
Returns the visual's unconstrained preferred size.int
getPreferredWidth(int height)
Returns the visual's preferred width given the provided height constraint.static int
getPreferredWidth(TableView tableView, boolean includeTrailingVerticalGridLine)
int
getRowAt(int y)
Bounds
getRowBounds(int rowIndex)
java.awt.Color
getSelectionBackgroundColor()
java.awt.Color
getSelectionColor()
boolean
getShowHighlight()
boolean
getShowHorizontalGridLines()
boolean
getShowVerticalGridLines()
protected int
getVariableRowHeight(int rowIndex, ArrayList<java.lang.Integer> columnWidthsArgument)
java.awt.Color
getVerticalGridColor()
void
install(Component component)
Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.boolean
isEditOnMouseDown()
boolean
isFocusable()
By default, skins are focusable.boolean
isOpaque()
By default, skins are assumed to be opaque.boolean
isVariableRowHeight()
boolean
keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
Keyboard handling (arrow keys with modifiers and a few others).void
layout()
If the component on which the skin is installed is a container, lays out the container's children.boolean
mouseClick(Component component, Mouse.Button button, int x, int y, int count)
Called when a mouse button is clicked over a component.boolean
mouseDown(Component component, Mouse.Button button, int x, int y)
Called when a mouse button is pressed over a component.boolean
mouseMove(Component component, int x, int y)
Called when the mouse is moved over a component.void
mouseOut(Component component)
Called when the mouse exits a component.boolean
mouseUp(Component component, Mouse.Button button, int x, int y)
Called when a mouse button is released over a component.boolean
mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)
Called when the mouse wheel is scrolled over a component.void
paint(java.awt.Graphics2D graphics)
Paints the visual.void
rowEditorChanged(TableView tableView, TableView.RowEditor previousRowEditor)
Called when a table view's row editor has changed.void
rowInserted(TableView tableView, int index)
Called when a row has been inserted into the table view.void
rowsCleared(TableView listView)
Called when the rows in a table view have been cleared.void
rowsRemoved(TableView tableView, int index, int count)
Called when rows have been removed from the table view.void
rowsSorted(TableView tableView)
Called when the rows in a table have been sorted.void
rowUpdated(TableView tableView, int index)
Called when an row in the table view has been updated.void
selectedRangeAdded(TableView tableView, int rangeStart, int rangeEnd)
Called when a range has been added to a table view's selection.void
selectedRangeRemoved(TableView tableView, int rangeStart, int rangeEnd)
Called when a range has been removed from a table view's selection.void
selectedRangesChanged(TableView tableView, Sequence<Span> previousSelectedRanges)
Called when a table view's selection state has been reset.void
selectedRowChanged(TableView tableView, java.lang.Object previousSelectedRow)
Called when a table view's selected item has changed.void
selectModeChanged(TableView tableView, TableView.SelectMode previousSelectMode)
Called when a table view's select mode has changed.void
setAlternateRowBackgroundColor(int alternateRowBackgroundColor)
void
setAlternateRowBackgroundColor(java.awt.Color alternateRowBackgroundColor)
void
setAlternateRowBackgroundColor(java.lang.String alternateRowBackgroundColor)
void
setBackgroundColor(int backgroundColor)
void
setBackgroundColor(java.awt.Color backgroundColor)
void
setBackgroundColor(java.lang.String backgroundColor)
void
setColor(int color)
void
setColor(java.awt.Color color)
void
setColor(java.lang.String color)
void
setColumnSelectionColor(int columnSelectionColor)
void
setColumnSelectionColor(java.awt.Color columnSelectionColor)
void
setColumnSelectionColor(java.lang.String columnSelectionColor)
void
setColumnSelectionHorizontalGridColor(int columnSelectionHorizontalGridColor)
void
setColumnSelectionHorizontalGridColor(java.awt.Color columnSelectionHorizontalGridColor)
void
setColumnSelectionHorizontalGridColor(java.lang.String columnSelectionHorizontalGridColor)
void
setDisabledColor(int disabledColor)
void
setDisabledColor(java.awt.Color disabledColor)
void
setDisabledColor(java.lang.String disabledColor)
void
setEditOnMouseDown(boolean editOnMouseDown)
Set whether thisTableView
will go into edit mode on a mouse down or on a mouse double click (the default).void
setFont(java.awt.Font font)
void
setFont(java.lang.String font)
void
setFont(Dictionary<java.lang.String,?> font)
void
setHighlightBackgroundColor(int highlightBackgroundColor)
void
setHighlightBackgroundColor(java.awt.Color highlightBackgroundColor)
void
setHighlightBackgroundColor(java.lang.String highlightBackgroundColor)
void
setHorizontalGridColor(int horizontalGridColor)
void
setHorizontalGridColor(java.awt.Color horizontalGridColor)
void
setHorizontalGridColor(java.lang.String horizontalGridColor)
void
setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundColor)
void
setInactiveSelectionBackgroundColor(java.awt.Color inactiveSelectionBackgroundColor)
void
setInactiveSelectionBackgroundColor(java.lang.String inactiveSelectionBackgroundColor)
void
setInactiveSelectionColor(int inactiveSelectionColor)
void
setInactiveSelectionColor(java.awt.Color inactiveSelectionColor)
void
setInactiveSelectionColor(java.lang.String inactiveSelectionColor)
void
setIncludeTrailingHorizontalGridLine(boolean includeTrailingHorizontalGridLine)
void
setIncludeTrailingVerticalGridLine(boolean includeTrailingVerticalGridLine)
void
setSelectionBackgroundColor(int selectionBackgroundColor)
void
setSelectionBackgroundColor(java.awt.Color selectionBackgroundColor)
void
setSelectionBackgroundColor(java.lang.String selectionBackgroundColor)
void
setSelectionColor(int selectionColor)
void
setSelectionColor(java.awt.Color selectionColor)
void
setSelectionColor(java.lang.String selectionColor)
void
setShowHighlight(boolean showHighlight)
void
setShowHorizontalGridLines(boolean showHorizontalGridLines)
void
setShowVerticalGridLines(boolean showVerticalGridLines)
void
setVariableRowHeight(boolean variableRowHeight)
void
setVerticalGridColor(int verticalGridColor)
void
setVerticalGridColor(java.awt.Color verticalGridColor)
void
setVerticalGridColor(java.lang.String verticalGridColor)
void
tableDataChanged(TableView tableView, List<?> previousTableData)
Called when a table view's table data has changed.-
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
colorFromObject, colorFromObject, colorFromObject, colorFromObject, currentTheme, cursorChanged, decodeFont, defaultBackgroundColor, defaultForegroundColor, dragSourceChanged, dropTargetChanged, fontFromObject, getBaseline, getColor, getComponent, getFocusRectangleStroke, getHeight, getSize, getTextInputMethodListener, getThemeFont, getWidth, heightLimitsChanged, invalidateComponent, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseOver, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setDefaultStyles, setSize, sizeChanged, themeHasThickFocusRectangle, themeHasTransitionEnabled, themeIsDark, themeIsFlat, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
setSize
-
-
-
-
Method Detail
-
install
public void install(Component component)
Description copied from class:ComponentSkin
Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.- Specified by:
install
in interfaceSkin
- Overrides:
install
in classComponentSkin
- Parameters:
component
- The component to which the skin is being attached.
-
getPreferredWidth
public int getPreferredWidth(int height)
Description copied from interface:ConstrainedVisual
Returns the visual's preferred width given the provided height constraint.- Specified by:
getPreferredWidth
in interfaceConstrainedVisual
- Parameters:
height
- The height by which to constrain the preferred width, or-1
for no constraint.- Returns:
- The preferred width given the height constraint.
-
getPreferredWidth
public static int getPreferredWidth(TableView tableView, boolean includeTrailingVerticalGridLine)
-
getPreferredHeight
public int getPreferredHeight(int width)
Description copied from interface:ConstrainedVisual
Returns the visual's preferred height given the provided width constraint.- Specified by:
getPreferredHeight
in interfaceConstrainedVisual
- Parameters:
width
- The width by which to constrain the preferred height, or-1
for no constraint.- Returns:
- The preferred height given the width constraint.
-
getPreferredSize
public Dimensions getPreferredSize()
Description copied from interface:ConstrainedVisual
Returns the visual's unconstrained preferred size.- Specified by:
getPreferredSize
in interfaceConstrainedVisual
- Overrides:
getPreferredSize
in classComponentSkin
- Returns:
- The preferred size (width and height) of this component.
Depending on the component this can be a static value or derived (as for a container) from its subcomponents, etc.
The default implementation simply calls
ConstrainedVisual.getPreferredWidth(int)
andConstrainedVisual.getPreferredHeight(int)
.
-
getBaseline
public int getBaseline(int width, int height)
Description copied from class:ComponentSkin
Should be implemented in every subclass.The default implementation here simply returns -1 (no baseline).
- Specified by:
getBaseline
in interfaceConstrainedVisual
- Overrides:
getBaseline
in classComponentSkin
- Parameters:
width
- Constrained width to compute the baseline for.height
- Constrained height to compute the baseline for.- Returns:
- The baseline relative to the origin of this visual, or
-1
if this visual does not have a baseline.
-
layout
public void layout()
Description copied from interface:Skin
If the component on which the skin is installed is a container, lays out the container's children.
-
paint
public void paint(java.awt.Graphics2D graphics)
Description copied from interface:Visual
Paints the visual.
-
getVariableRowHeight
protected int getVariableRowHeight(int rowIndex, ArrayList<java.lang.Integer> columnWidthsArgument)
-
getRowAt
public int getRowAt(int y)
- Specified by:
getRowAt
in interfaceTableView.Skin
-
getColumnAt
public int getColumnAt(int x)
- Specified by:
getColumnAt
in interfaceTableView.Skin
-
getRowBounds
public Bounds getRowBounds(int rowIndex)
- Specified by:
getRowBounds
in interfaceTableView.Skin
-
getColumnBounds
public Bounds getColumnBounds(int columnIndex)
- Specified by:
getColumnBounds
in interfaceTableView.Skin
-
getCellBounds
public Bounds getCellBounds(int rowIndex, int columnIndex)
- Specified by:
getCellBounds
in interfaceTableView.Skin
-
getColumnWidths
public static ArrayList<java.lang.Integer> getColumnWidths(TableView tableView, int width)
-
isFocusable
public final boolean isFocusable()
Description copied from class:ComponentSkin
By default, skins are focusable.- Specified by:
isFocusable
in interfaceSkin
- Overrides:
isFocusable
in classComponentSkin
- Returns:
true
if this skin is focusable;false
, otherwise.
-
isOpaque
public final boolean isOpaque()
Description copied from class:ComponentSkin
By default, skins are assumed to be opaque.- Specified by:
isOpaque
in interfaceSkin
- Overrides:
isOpaque
in classComponentSkin
- Returns:
true
if this skin is opaque;false
if any part of it is transparent or translucent.
-
getFont
public final java.awt.Font getFont()
-
setFont
public final void setFont(java.awt.Font font)
-
setFont
public final void setFont(java.lang.String font)
-
setFont
public final void setFont(Dictionary<java.lang.String,?> font)
-
getColor
public final java.awt.Color getColor()
-
setColor
public final void setColor(java.awt.Color color)
-
setColor
public final void setColor(java.lang.String color)
-
setColor
public final void setColor(int color)
-
getDisabledColor
public final java.awt.Color getDisabledColor()
-
setDisabledColor
public final void setDisabledColor(java.awt.Color disabledColor)
-
setDisabledColor
public final void setDisabledColor(java.lang.String disabledColor)
-
setDisabledColor
public final void setDisabledColor(int disabledColor)
-
getBackgroundColor
public final java.awt.Color getBackgroundColor()
-
setBackgroundColor
public final void setBackgroundColor(java.awt.Color backgroundColor)
-
setBackgroundColor
public final void setBackgroundColor(java.lang.String backgroundColor)
-
setBackgroundColor
public final void setBackgroundColor(int backgroundColor)
-
getSelectionColor
public final java.awt.Color getSelectionColor()
-
setSelectionColor
public final void setSelectionColor(java.awt.Color selectionColor)
-
setSelectionColor
public final void setSelectionColor(java.lang.String selectionColor)
-
setSelectionColor
public final void setSelectionColor(int selectionColor)
-
getSelectionBackgroundColor
public final java.awt.Color getSelectionBackgroundColor()
-
setSelectionBackgroundColor
public final void setSelectionBackgroundColor(java.awt.Color selectionBackgroundColor)
-
setSelectionBackgroundColor
public final void setSelectionBackgroundColor(java.lang.String selectionBackgroundColor)
-
setSelectionBackgroundColor
public final void setSelectionBackgroundColor(int selectionBackgroundColor)
-
getInactiveSelectionColor
public final java.awt.Color getInactiveSelectionColor()
-
setInactiveSelectionColor
public final void setInactiveSelectionColor(java.awt.Color inactiveSelectionColor)
-
setInactiveSelectionColor
public final void setInactiveSelectionColor(java.lang.String inactiveSelectionColor)
-
setInactiveSelectionColor
public final void setInactiveSelectionColor(int inactiveSelectionColor)
-
getInactiveSelectionBackgroundColor
public final java.awt.Color getInactiveSelectionBackgroundColor()
-
setInactiveSelectionBackgroundColor
public final void setInactiveSelectionBackgroundColor(java.awt.Color inactiveSelectionBackgroundColor)
-
setInactiveSelectionBackgroundColor
public final void setInactiveSelectionBackgroundColor(java.lang.String inactiveSelectionBackgroundColor)
-
setInactiveSelectionBackgroundColor
public final void setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundColor)
-
getHighlightBackgroundColor
public final java.awt.Color getHighlightBackgroundColor()
-
setHighlightBackgroundColor
public final void setHighlightBackgroundColor(java.awt.Color highlightBackgroundColor)
-
setHighlightBackgroundColor
public final void setHighlightBackgroundColor(java.lang.String highlightBackgroundColor)
-
setHighlightBackgroundColor
public final void setHighlightBackgroundColor(int highlightBackgroundColor)
-
getAlternateRowBackgroundColor
public final java.awt.Color getAlternateRowBackgroundColor()
-
setAlternateRowBackgroundColor
public final void setAlternateRowBackgroundColor(java.awt.Color alternateRowBackgroundColor)
-
setAlternateRowBackgroundColor
public final void setAlternateRowBackgroundColor(java.lang.String alternateRowBackgroundColor)
-
setAlternateRowBackgroundColor
public final void setAlternateRowBackgroundColor(int alternateRowBackgroundColor)
-
getColumnSelectionColor
public final java.awt.Color getColumnSelectionColor()
-
setColumnSelectionColor
public final void setColumnSelectionColor(java.awt.Color columnSelectionColor)
-
setColumnSelectionColor
public final void setColumnSelectionColor(java.lang.String columnSelectionColor)
-
setColumnSelectionColor
public final void setColumnSelectionColor(int columnSelectionColor)
-
getColumnSelectionHorizontalGridColor
public final java.awt.Color getColumnSelectionHorizontalGridColor()
-
setColumnSelectionHorizontalGridColor
public final void setColumnSelectionHorizontalGridColor(java.awt.Color columnSelectionHorizontalGridColor)
-
setColumnSelectionHorizontalGridColor
public final void setColumnSelectionHorizontalGridColor(java.lang.String columnSelectionHorizontalGridColor)
-
setColumnSelectionHorizontalGridColor
public final void setColumnSelectionHorizontalGridColor(int columnSelectionHorizontalGridColor)
-
getHorizontalGridColor
public final java.awt.Color getHorizontalGridColor()
-
setHorizontalGridColor
public final void setHorizontalGridColor(java.awt.Color horizontalGridColor)
-
setHorizontalGridColor
public final void setHorizontalGridColor(java.lang.String horizontalGridColor)
-
setHorizontalGridColor
public final void setHorizontalGridColor(int horizontalGridColor)
-
getVerticalGridColor
public final java.awt.Color getVerticalGridColor()
-
setVerticalGridColor
public final void setVerticalGridColor(java.awt.Color verticalGridColor)
-
setVerticalGridColor
public final void setVerticalGridColor(java.lang.String verticalGridColor)
-
setVerticalGridColor
public final void setVerticalGridColor(int verticalGridColor)
-
getShowHighlight
public final boolean getShowHighlight()
-
setShowHighlight
public final void setShowHighlight(boolean showHighlight)
-
getShowHorizontalGridLines
public final boolean getShowHorizontalGridLines()
-
setShowHorizontalGridLines
public final void setShowHorizontalGridLines(boolean showHorizontalGridLines)
-
getShowVerticalGridLines
public final boolean getShowVerticalGridLines()
-
setShowVerticalGridLines
public final void setShowVerticalGridLines(boolean showVerticalGridLines)
-
getIncludeTrailingVerticalGridLine
public final boolean getIncludeTrailingVerticalGridLine()
-
setIncludeTrailingVerticalGridLine
public final void setIncludeTrailingVerticalGridLine(boolean includeTrailingVerticalGridLine)
-
getIncludeTrailingHorizontalGridLine
public final boolean getIncludeTrailingHorizontalGridLine()
-
setIncludeTrailingHorizontalGridLine
public final void setIncludeTrailingHorizontalGridLine(boolean includeTrailingHorizontalGridLine)
-
isVariableRowHeight
public final boolean isVariableRowHeight()
-
setVariableRowHeight
public final void setVariableRowHeight(boolean variableRowHeight)
-
isEditOnMouseDown
public final boolean isEditOnMouseDown()
- Returns:
- Is this
TableView
going into edit mode on a mouse down or on a mouse double click?
-
setEditOnMouseDown
public final void setEditOnMouseDown(boolean editOnMouseDown)
Set whether thisTableView
will go into edit mode on a mouse down or on a mouse double click (the default).Setting this to
true
can reduce the number of mouse clicks necessary to rapidly edit a table view.- Parameters:
editOnMouseDown
- The new setting.
-
mouseMove
public boolean mouseMove(Component component, int x, int y)
Description copied from interface:ComponentMouseListener
Called when the mouse is moved over a component.- Specified by:
mouseMove
in interfaceComponentMouseListener
- Overrides:
mouseMove
in classComponentSkin
- Parameters:
component
- Component that is under the mouse.x
- X position of the mouse.y
- Y position of the mouse.- Returns:
true
to consume the event;false
to allow it to propagate (default return).
-
mouseOut
public void mouseOut(Component component)
Description copied from interface:ComponentMouseListener
Called when the mouse exits a component.Default is to do nothing.
- Specified by:
mouseOut
in interfaceComponentMouseListener
- Overrides:
mouseOut
in classComponentSkin
- Parameters:
component
- Component that has now lost the mouse pointer.
-
mouseDown
public boolean mouseDown(Component component, Mouse.Button button, int x, int y)
Description copied from interface:ComponentMouseButtonListener
Called when a mouse button is pressed over a component.- Specified by:
mouseDown
in interfaceComponentMouseButtonListener
- Overrides:
mouseDown
in classComponentSkin
- Parameters:
component
- Component that is under the mouse pointer.button
- Which mouse button was pressed.x
- X position of the mouse.y
- Y position of the mouse.- Returns:
true
to consume the event;false
to allow it to propagate (default).
-
mouseUp
public boolean mouseUp(Component component, Mouse.Button button, int x, int y)
Description copied from interface:ComponentMouseButtonListener
Called when a mouse button is released over a component.- Specified by:
mouseUp
in interfaceComponentMouseButtonListener
- Overrides:
mouseUp
in classComponentSkin
- Parameters:
component
- Component user the mouse pointer.button
- Which mouse button that was released.x
- X position of the mouse.y
- Y position of the mouse.- Returns:
true
to consume the event;false
to allow it to propagate (default).
-
mouseClick
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
Description copied from interface:ComponentMouseButtonListener
Called when a mouse button is clicked over a component.- Specified by:
mouseClick
in interfaceComponentMouseButtonListener
- Overrides:
mouseClick
in classComponentSkin
- Parameters:
component
- Component user the mouse pointer.button
- Which mouse button was clicked.x
- X position of the mouse.y
- Y position of the mouse.count
- Number of clicks (1 = single click, 2 = double click, etc.).- Returns:
true
to consume the event;false
to allow it to propagate (default).
-
mouseWheel
public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)
Description copied from interface:ComponentMouseWheelListener
Called when the mouse wheel is scrolled over a component.- Specified by:
mouseWheel
in interfaceComponentMouseWheelListener
- Overrides:
mouseWheel
in classComponentSkin
- Parameters:
component
- Component under the mouse pointer.scrollType
- What type of scroll was requested on the mouse.scrollAmount
- Amount of scrolling.wheelRotation
- Rotation value.x
- X position of the mouse.y
- Y position of the mouse.- Returns:
true
to consume the event;false
to allow it to propagate.
-
keyPressed
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
Keyboard handling (arrow keys with modifiers and a few others).UP
Selects the previous enabled row when select mode is notTableView.SelectMode.NONE
DOWN
Selects the next enabled row when select mode is notTableView.SelectMode.NONE
SHIFT
+UP
Increases the selection size by including the previous enabled row when select mode isTableView.SelectMode.MULTI
SHIFT
+DOWN
Increases the selection size by including the next enabled row when select mode isTableView.SelectMode.MULTI
Cmd/Ctrl-A
inTableView.SelectMode.MULTI
select mode to select everythingCmd/Ctrl-U
will unselect whatever is selectedSPACE
wil select/unselect the "current" location
- Specified by:
keyPressed
in interfaceComponentKeyListener
- Overrides:
keyPressed
in classComponentSkin
- Parameters:
component
- Component that has the focus.keyCode
- The key code for the key that was pressed.keyLocation
- Location value for the key (left or right for shift keys, etc.).- Returns:
true
to consume the event;false
to allow it to propagate.
-
enabledChanged
public void enabledChanged(Component component)
Description copied from interface:ComponentStateListener
Called when a component's enabled state has changed.Called both when the component is enabled and when it is disabled. The component's
enabled
flag has already been set when this method is called so the new state can be determined by calling theComponent.isEnabled()
method.- Specified by:
enabledChanged
in interfaceComponentStateListener
- Overrides:
enabledChanged
in classComponentSkin
- Parameters:
component
- The component whose enabled state is changing.
-
focusedChanged
public void focusedChanged(Component component, Component obverseComponent)
Description copied from interface:ComponentStateListener
Called when a component's focused state has changed.This will be called both when a component gains focus and when it loses focus. The currently focused component has already been set when this method is called, so that the new state of the component can be determined by calling the
Component.isFocused()
method.- Specified by:
focusedChanged
in interfaceComponentStateListener
- Overrides:
focusedChanged
in classComponentSkin
- Parameters:
component
- The component that is either gaining focus or the one that previously had focus and is now losing it.obverseComponent
- If the component is gaining focus, this is the component that is losing focus. If the component is losing focus this is the component that is gaining the focus instead.
-
tableDataChanged
public void tableDataChanged(TableView tableView, List<?> previousTableData)
Description copied from interface:TableViewListener
Called when a table view's table data has changed.- Specified by:
tableDataChanged
in interfaceTableViewListener
- Parameters:
tableView
- The source of this event.previousTableData
- The previous data list for this table view.
-
columnSourceChanged
public void columnSourceChanged(TableView tableView, TableView previousColumnSource)
Description copied from interface:TableViewListener
Called when a table view's column source has changed.- Specified by:
columnSourceChanged
in interfaceTableViewListener
- Parameters:
tableView
- The source of this event.previousColumnSource
- The previous column source for this table.
-
rowEditorChanged
public void rowEditorChanged(TableView tableView, TableView.RowEditor previousRowEditor)
Description copied from interface:TableViewListener
Called when a table view's row editor has changed.- Specified by:
rowEditorChanged
in interfaceTableViewListener
- Parameters:
tableView
- The source of this event.previousRowEditor
- The row editor that was previously used.
-
selectModeChanged
public void selectModeChanged(TableView tableView, TableView.SelectMode previousSelectMode)
Description copied from interface:TableViewListener
Called when a table view's select mode has changed.- Specified by:
selectModeChanged
in interfaceTableViewListener
- Parameters:
tableView
- The source of the event.previousSelectMode
- What the select mode used to be.
-
disabledRowFilterChanged
public void disabledRowFilterChanged(TableView tableView, Filter<?> previousDisabledRowFilter)
Description copied from interface:TableViewListener
Called when a table view's disabled row filter has changed.- Specified by:
disabledRowFilterChanged
in interfaceTableViewListener
- Parameters:
tableView
- The table view in question.previousDisabledRowFilter
- What the previous filter for disabled rows was.
-
columnInserted
public void columnInserted(TableView tableView, int index)
Description copied from interface:TableViewColumnListener
Called when a column is inserted into a table view's column sequence.- Specified by:
columnInserted
in interfaceTableViewColumnListener
- Parameters:
tableView
- The table view that has changed.index
- Where the new column has been inserted.
-
columnsRemoved
public void columnsRemoved(TableView tableView, int index, Sequence<TableView.Column> columns)
Description copied from interface:TableViewColumnListener
Called when columns are removed from a table view's column sequence.- Specified by:
columnsRemoved
in interfaceTableViewColumnListener
- Parameters:
tableView
- The table view that has changed.index
- The starting location of the removed columns.columns
- The actual sequence of columns that were removed.
-
columnNameChanged
public void columnNameChanged(TableView.Column column, java.lang.String previousName)
Description copied from interface:TableViewColumnListener
Called when a column's name has changed.- Specified by:
columnNameChanged
in interfaceTableViewColumnListener
- Parameters:
column
- The column that changed names.previousName
- What the previous name was.
-
columnHeaderDataChanged
public void columnHeaderDataChanged(TableView.Column column, java.lang.Object previousHeaderData)
Description copied from interface:TableViewColumnListener
Called when a column's header data has changed.- Specified by:
columnHeaderDataChanged
in interfaceTableViewColumnListener
- Parameters:
column
- The column that changed.previousHeaderData
- What the header data used to be.
-
columnHeaderDataRendererChanged
public void columnHeaderDataRendererChanged(TableView.Column column, TableView.HeaderDataRenderer previousHeaderDataRenderer)
Description copied from interface:TableViewColumnListener
Called when a column's header data renderer has changed.- Specified by:
columnHeaderDataRendererChanged
in interfaceTableViewColumnListener
- Parameters:
column
- The column whose header data renderer has changed.previousHeaderDataRenderer
- The previous renderer for header data.
-
columnWidthChanged
public void columnWidthChanged(TableView.Column column, int previousWidth, boolean previousRelative)
Description copied from interface:TableViewColumnListener
Called when a column's width has changed.- Specified by:
columnWidthChanged
in interfaceTableViewColumnListener
- Parameters:
column
- The column that changed.previousWidth
- The previous numeric value of the column width.previousRelative
- Whether the previous width was relative or not.
-
columnWidthLimitsChanged
public void columnWidthLimitsChanged(TableView.Column column, int previousMinimumWidth, int previousMaximumWidth)
Description copied from interface:TableViewColumnListener
Called when a column's width limits have changed.- Specified by:
columnWidthLimitsChanged
in interfaceTableViewColumnListener
- Parameters:
column
- The source of this event.previousMinimumWidth
- The previous minimum column width.previousMaximumWidth
- The previous maximum column width.
-
columnFilterChanged
public void columnFilterChanged(TableView.Column column, java.lang.Object previousFilter)
Description copied from interface:TableViewColumnListener
Called when a column's filter has changed.- Specified by:
columnFilterChanged
in interfaceTableViewColumnListener
- Parameters:
column
- The source of this event.previousFilter
- The previous filter value for this column.
-
columnCellRendererChanged
public void columnCellRendererChanged(TableView.Column column, TableView.CellRenderer previousCellRenderer)
Description copied from interface:TableViewColumnListener
Called when a column's cell renderer has changed.- Specified by:
columnCellRendererChanged
in interfaceTableViewColumnListener
- Parameters:
column
- The source of this event.previousCellRenderer
- The previous cell renderer for this column.
-
rowInserted
public void rowInserted(TableView tableView, int index)
Description copied from interface:TableViewRowListener
Called when a row has been inserted into the table view.- Specified by:
rowInserted
in interfaceTableViewRowListener
- Parameters:
tableView
- The source of the event.index
- The index of the row that was inserted.
-
rowsRemoved
public void rowsRemoved(TableView tableView, int index, int count)
Description copied from interface:TableViewRowListener
Called when rows have been removed from the table view.- Specified by:
rowsRemoved
in interfaceTableViewRowListener
- Parameters:
tableView
- The source of the event.index
- The first index affected by the event.count
- The number of rows that were removed, or-1
if all rows were removed.
-
rowUpdated
public void rowUpdated(TableView tableView, int index)
Description copied from interface:TableViewRowListener
Called when an row in the table view has been updated.- Specified by:
rowUpdated
in interfaceTableViewRowListener
- Parameters:
tableView
- The source of the event.index
- The first index affected by the event.
-
rowsCleared
public void rowsCleared(TableView listView)
Description copied from interface:TableViewRowListener
Called when the rows in a table view have been cleared.- Specified by:
rowsCleared
in interfaceTableViewRowListener
- Parameters:
listView
- The source of the event.
-
rowsSorted
public void rowsSorted(TableView tableView)
Description copied from interface:TableViewRowListener
Called when the rows in a table have been sorted.- Specified by:
rowsSorted
in interfaceTableViewRowListener
- Parameters:
tableView
- The source of the event.
-
selectedRangeAdded
public void selectedRangeAdded(TableView tableView, int rangeStart, int rangeEnd)
Description copied from interface:TableViewSelectionListener
Called when a range has been added to a table view's selection.- Specified by:
selectedRangeAdded
in interfaceTableViewSelectionListener
- Parameters:
tableView
- The source of the event.rangeStart
- The start index of the range that was added, inclusive.rangeEnd
- The end index of the range that was added, inclusive.
-
selectedRangeRemoved
public void selectedRangeRemoved(TableView tableView, int rangeStart, int rangeEnd)
Description copied from interface:TableViewSelectionListener
Called when a range has been removed from a table view's selection.- Specified by:
selectedRangeRemoved
in interfaceTableViewSelectionListener
- Parameters:
tableView
- The source of the event.rangeStart
- The start index of the range that was removed, inclusive.rangeEnd
- The end index of the range that was removed, inclusive.
-
selectedRangesChanged
public void selectedRangesChanged(TableView tableView, Sequence<Span> previousSelectedRanges)
Description copied from interface:TableViewSelectionListener
Called when a table view's selection state has been reset.- Specified by:
selectedRangesChanged
in interfaceTableViewSelectionListener
- Parameters:
tableView
- The source of the event.previousSelectedRanges
- If the selection changed directly, contains the ranges that were previously selected. If the selection changed indirectly as a result of a model change, contains the current selection. Otherwise, containsnull
.
-
selectedRowChanged
public void selectedRowChanged(TableView tableView, java.lang.Object previousSelectedRow)
Description copied from interface:TableViewSelectionListener
Called when a table view's selected item has changed.- Specified by:
selectedRowChanged
in interfaceTableViewSelectionListener
- Parameters:
tableView
- The source of the event.previousSelectedRow
- The row that was previously selected.
-
-