|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpivot.wtk.skin.ComponentSkin
pivot.wtk.skin.terra.TerraTableViewSkin
public class TerraTableViewSkin
Table view skin.
NOTE This skin assumes a fixed renderer height.
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 pivot.wtk.TableViewListener |
---|
TableViewListener.Adapter |
Nested classes/interfaces inherited from interface pivot.wtk.TableViewRowListener |
---|
TableViewRowListener.Adapter |
Nested classes/interfaces inherited from interface pivot.wtk.TableViewSelectionListener |
---|
TableViewSelectionListener.Adapter |
Nested classes/interfaces inherited from interface pivot.wtk.ComponentListener |
---|
ComponentListener.Adapter |
Nested classes/interfaces inherited from interface pivot.wtk.ComponentStateListener |
---|
ComponentStateListener.Adapter |
Nested classes/interfaces inherited from interface pivot.wtk.ComponentMouseListener |
---|
ComponentMouseListener.Adapter |
Nested classes/interfaces inherited from interface pivot.wtk.ComponentMouseButtonListener |
---|
ComponentMouseButtonListener.Adapter |
Nested classes/interfaces inherited from interface pivot.wtk.ComponentKeyListener |
---|
ComponentKeyListener.Adapter |
Field Summary |
---|
Fields inherited from class pivot.wtk.skin.ComponentSkin |
---|
SHOW_TOOLTIP_TIMEOUT |
Constructor Summary | |
---|---|
TerraTableViewSkin()
|
Method Summary | |
---|---|
void |
columnCellRendererChanged(TableView.Column column,
TableView.CellRenderer previousCellRenderer)
Called when a column's cell renderer has changed. |
void |
columnFilterChanged(TableView.Column column,
Object previousFilter)
Called when a column's filter has changed. |
void |
columnHeaderDataChanged(TableView.Column column,
Object previousHeaderData)
Called when a column's header data 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,
String previousName)
Called when a column's name has changed. |
void |
columnSortDirectionChanged(TableView.Column column,
SortDirection previousSortDirection)
Called when a column's sort direction 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 |
enabledChanged(Component component)
Called when a component's enabled state has changed. |
void |
focusedChanged(Component component,
boolean temporary)
Called when a component's focused state has changed. |
Color |
getAlternateRowColor()
|
Color |
getBackgroundColor()
|
Bounds |
getCellBounds(int rowIndex,
int columnIndex)
|
Color |
getColor()
|
int |
getColumnAt(int x)
|
Bounds |
getColumnBounds(int columnIndex)
|
Sequence<Integer> |
getColumnWidths()
Returns the column widths for this table. |
static Sequence<Integer> |
getColumnWidths(TableView.ColumnSequence columns,
int width)
Returns the column widths, determined by applying relative size values to the available width. |
Color |
getDisabledColor()
|
Font |
getFont()
|
Color |
getGridColor()
|
Color |
getHighlightBackgroundColor()
|
Color |
getInactiveSelectionBackgroundColor()
|
Color |
getInactiveSelectionColor()
|
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. |
int |
getRowAt(int y)
|
Bounds |
getRowBounds(int rowIndex)
|
int |
getRowHeight()
Returns the table row height, which is determined as the maximum preferred height of all cell renderers. |
Color |
getSelectionBackgroundColor()
|
Color |
getSelectionColor()
|
boolean |
getShowHighlight()
|
boolean |
getShowHorizontalGridLines()
|
boolean |
getShowVerticalGridLines()
|
void |
install(Component component)
Associates a skin with a component. |
boolean |
isFocusable()
By default, components are focusable. |
boolean |
keyPressed(Component component,
int keyCode,
Keyboard.KeyLocation keyLocation)
Called when a key has been pressed. |
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 |
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(Graphics2D graphics)
Paints the visual. |
void |
rowDisabledChanged(TableView tableView,
int index)
Called when a row's disabled state has changed. |
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 |
selectModeChanged(TableView tableView,
TableView.SelectMode previousSelectMode)
Called when a table view's select mode has changed. |
void |
setAlternateRowColor(Color alternateRowColor)
|
void |
setAlternateRowColor(int alternateRowColor)
|
void |
setAlternateRowColor(String alternateRowColor)
|
void |
setBackgroundColor(Color backgroundColor)
|
void |
setBackgroundColor(int backgroundColor)
|
void |
setBackgroundColor(String backgroundColor)
|
void |
setColor(Color color)
|
void |
setColor(int color)
|
void |
setColor(String color)
|
void |
setDisabledColor(Color disabledColor)
|
void |
setDisabledColor(int disabledColor)
|
void |
setDisabledColor(String disabledColor)
|
void |
setFont(Font font)
|
void |
setFont(String font)
|
void |
setGridColor(Color gridColor)
|
void |
setGridColor(int gridColor)
|
void |
setGridColor(String gridColor)
|
void |
setHighlightBackgroundColor(Color highlightBackgroundColor)
|
void |
setHighlightBackgroundColor(int highlightBackgroundColor)
|
void |
setHighlightBackgroundColor(String highlightBackgroundColor)
|
void |
setInactiveSelectionBackgroundColor(Color inactiveSelectionBackgroundColor)
|
void |
setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundColor)
|
void |
setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor)
|
void |
setInactiveSelectionColor(Color inactiveSelectionColor)
|
void |
setInactiveSelectionColor(int inactiveSelectionColor)
|
void |
setInactiveSelectionColor(String inactiveSelectionColor)
|
void |
setIncludeTrailingVerticalGridLine(boolean includeTrailingVerticalGridLine)
|
void |
setSelectionBackgroundColor(Color selectionBackgroundColor)
|
void |
setSelectionBackgroundColor(int selectionBackgroundColor)
|
void |
setSelectionBackgroundColor(String selectionBackgroundColor)
|
void |
setSelectionColor(Color selectionColor)
|
void |
setSelectionColor(int selectionColor)
|
void |
setSelectionColor(String selectionColor)
|
void |
setShowHighlight(boolean showHighlight)
|
void |
setShowHorizontalGridLines(boolean showHorizontalGridLines)
|
void |
setShowVerticalGridLines(boolean showVerticalGridLines)
|
void |
tableDataChanged(TableView tableView,
List<?> previousTableData)
Called when a table view's table data has changed. |
void |
uninstall()
Dissociates a skin from a component. |
Methods inherited from class pivot.wtk.skin.ComponentSkin |
---|
cursorChanged, displayableChanged, getComponent, getHeight, getWidth, invalidateComponent, isOpaque, keyReleased, keyTyped, locationChanged, mouseOver, mouseUp, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, styleUpdated, tooltipTextChanged, visibleChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TerraTableViewSkin()
Method Detail |
---|
public void install(Component component)
Skin
install
in interface Skin
install
in class ComponentSkin
component
- The component to which the skin is being attached.public void uninstall()
Skin
uninstall
in interface Skin
uninstall
in class ComponentSkin
public int getPreferredWidth(int height)
ConstrainedVisual
getPreferredWidth
in interface ConstrainedVisual
height
- The height by which to constrain the preferred width, or -1
for no constraint.public int getPreferredHeight(int width)
ConstrainedVisual
getPreferredHeight
in interface ConstrainedVisual
width
- The width by which to constrain the preferred height, or -1
for no constraint.public Dimensions getPreferredSize()
ConstrainedVisual
getPreferredSize
in interface ConstrainedVisual
getPreferredSize
in class ComponentSkin
public void layout()
Skin
layout
in interface Skin
public void paint(Graphics2D graphics)
Visual
paint
in interface Visual
graphics
- The graphics context in which to paint the visual.public int getRowHeight()
public Sequence<Integer> getColumnWidths()
public static Sequence<Integer> getColumnWidths(TableView.ColumnSequence columns, int width)
columns
- The columns whose widths are to be determined.width
- The total available width for the columns.
public int getRowAt(int y)
getRowAt
in interface TableView.Skin
public int getColumnAt(int x)
getColumnAt
in interface TableView.Skin
public Bounds getRowBounds(int rowIndex)
getRowBounds
in interface TableView.Skin
public Bounds getColumnBounds(int columnIndex)
getColumnBounds
in interface TableView.Skin
public Bounds getCellBounds(int rowIndex, int columnIndex)
getCellBounds
in interface TableView.Skin
public boolean isFocusable()
ComponentSkin
isFocusable
in interface Skin
isFocusable
in class ComponentSkin
public Font getFont()
public void setFont(Font font)
public final void setFont(String font)
public Color getColor()
public void setColor(Color color)
public final void setColor(String color)
public final void setColor(int color)
public Color getDisabledColor()
public void setDisabledColor(Color disabledColor)
public final void setDisabledColor(String disabledColor)
public final void setDisabledColor(int disabledColor)
public Color getBackgroundColor()
public void setBackgroundColor(Color backgroundColor)
public final void setBackgroundColor(String backgroundColor)
public final void setBackgroundColor(int backgroundColor)
public Color getSelectionColor()
public void setSelectionColor(Color selectionColor)
public final void setSelectionColor(String selectionColor)
public final void setSelectionColor(int selectionColor)
public Color getSelectionBackgroundColor()
public void setSelectionBackgroundColor(Color selectionBackgroundColor)
public final void setSelectionBackgroundColor(String selectionBackgroundColor)
public final void setSelectionBackgroundColor(int selectionBackgroundColor)
public Color getInactiveSelectionColor()
public void setInactiveSelectionColor(Color inactiveSelectionColor)
public final void setInactiveSelectionColor(String inactiveSelectionColor)
public final void setInactiveSelectionColor(int inactiveSelectionColor)
public Color getInactiveSelectionBackgroundColor()
public void setInactiveSelectionBackgroundColor(Color inactiveSelectionBackgroundColor)
public final void setInactiveSelectionBackgroundColor(String inactiveSelectionBackgroundColor)
public final void setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundColor)
public Color getHighlightBackgroundColor()
public void setHighlightBackgroundColor(Color highlightBackgroundColor)
public final void setHighlightBackgroundColor(String highlightBackgroundColor)
public final void setHighlightBackgroundColor(int highlightBackgroundColor)
public Color getAlternateRowColor()
public void setAlternateRowColor(Color alternateRowColor)
public final void setAlternateRowColor(String alternateRowColor)
public final void setAlternateRowColor(int alternateRowColor)
public Color getGridColor()
public void setGridColor(Color gridColor)
public final void setGridColor(String gridColor)
public final void setGridColor(int gridColor)
public boolean getShowHorizontalGridLines()
public void setShowHorizontalGridLines(boolean showHorizontalGridLines)
public boolean getShowVerticalGridLines()
public void setShowVerticalGridLines(boolean showVerticalGridLines)
public boolean getShowHighlight()
public void setShowHighlight(boolean showHighlight)
public boolean getIncludeTrailingVerticalGridLine()
public void setIncludeTrailingVerticalGridLine(boolean includeTrailingVerticalGridLine)
public boolean mouseMove(Component component, int x, int y)
ComponentMouseListener
mouseMove
in interface ComponentMouseListener
mouseMove
in class ComponentSkin
public void mouseOut(Component component)
ComponentMouseListener
mouseOut
in interface ComponentMouseListener
mouseOut
in class ComponentSkin
public boolean mouseDown(Component component, Mouse.Button button, int x, int y)
ComponentMouseButtonListener
mouseDown
in interface ComponentMouseButtonListener
mouseDown
in class ComponentSkin
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
ComponentMouseButtonListener
mouseClick
in interface ComponentMouseButtonListener
mouseClick
in class ComponentSkin
public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount, int wheelRotation, int x, int y)
ComponentMouseWheelListener
mouseWheel
in interface ComponentMouseWheelListener
mouseWheel
in class ComponentSkin
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
ComponentKeyListener
keyPressed
in interface ComponentKeyListener
keyPressed
in class ComponentSkin
public void enabledChanged(Component component)
ComponentStateListener
enabledChanged
in interface ComponentStateListener
enabledChanged
in class ComponentSkin
public void focusedChanged(Component component, boolean temporary)
ComponentStateListener
focusedChanged
in interface ComponentStateListener
focusedChanged
in class ComponentSkin
public void tableDataChanged(TableView tableView, List<?> previousTableData)
TableViewListener
tableDataChanged
in interface TableViewListener
public void rowEditorChanged(TableView tableView, TableView.RowEditor previousRowEditor)
TableViewListener
rowEditorChanged
in interface TableViewListener
public void selectModeChanged(TableView tableView, TableView.SelectMode previousSelectMode)
TableViewListener
selectModeChanged
in interface TableViewListener
public void columnInserted(TableView tableView, int index)
TableViewColumnListener
columnInserted
in interface TableViewColumnListener
public void columnsRemoved(TableView tableView, int index, Sequence<TableView.Column> columns)
TableViewColumnListener
columnsRemoved
in interface TableViewColumnListener
public void columnNameChanged(TableView.Column column, String previousName)
TableViewColumnListener
columnNameChanged
in interface TableViewColumnListener
public void columnHeaderDataChanged(TableView.Column column, Object previousHeaderData)
TableViewColumnListener
columnHeaderDataChanged
in interface TableViewColumnListener
public void columnWidthChanged(TableView.Column column, int previousWidth, boolean previousRelative)
TableViewColumnListener
columnWidthChanged
in interface TableViewColumnListener
public void columnSortDirectionChanged(TableView.Column column, SortDirection previousSortDirection)
TableViewColumnListener
columnSortDirectionChanged
in interface TableViewColumnListener
public void columnFilterChanged(TableView.Column column, Object previousFilter)
TableViewColumnListener
columnFilterChanged
in interface TableViewColumnListener
public void columnCellRendererChanged(TableView.Column column, TableView.CellRenderer previousCellRenderer)
TableViewColumnListener
columnCellRendererChanged
in interface TableViewColumnListener
public void rowInserted(TableView tableView, int index)
TableViewRowListener
rowInserted
in interface TableViewRowListener
tableView
- The source of the event.index
- The index of the row that was inserted.public void rowsRemoved(TableView tableView, int index, int count)
TableViewRowListener
rowsRemoved
in interface TableViewRowListener
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.public void rowUpdated(TableView tableView, int index)
TableViewRowListener
rowUpdated
in interface TableViewRowListener
tableView
- The source of the event.index
- The first index affected by the event.public void rowsCleared(TableView listView)
TableViewRowListener
rowsCleared
in interface TableViewRowListener
public void rowsSorted(TableView tableView)
TableViewRowListener
rowsSorted
in interface TableViewRowListener
tableView
- The source of the event.public void rowDisabledChanged(TableView tableView, int index)
TableViewRowStateListener
rowDisabledChanged
in interface TableViewRowStateListener
public void selectedRangeAdded(TableView tableView, int rangeStart, int rangeEnd)
TableViewSelectionListener
selectedRangeAdded
in interface TableViewSelectionListener
public void selectedRangeRemoved(TableView tableView, int rangeStart, int rangeEnd)
TableViewSelectionListener
selectedRangeRemoved
in interface TableViewSelectionListener
public void selectedRangesChanged(TableView tableView, Sequence<Span> previousSelectedRanges)
TableViewSelectionListener
selectedRangesChanged
in interface TableViewSelectionListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |