org.apache.pivot.wtk.skin.terra
Class TerraTableViewHeaderSkin

java.lang.Object
  extended by org.apache.pivot.wtk.skin.ComponentSkin
      extended by org.apache.pivot.wtk.skin.terra.TerraTableViewHeaderSkin
All Implemented Interfaces:
ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ComponentTooltipListener, ConstrainedVisual, Skin, TableViewColumnListener, TableViewHeader.Skin, TableViewHeaderListener, TableViewSortListener, Visual

public class TerraTableViewHeaderSkin
extends ComponentSkin
implements TableViewHeader.Skin, TableViewHeaderListener, TableViewColumnListener, TableViewSortListener

Table view header skin.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TableViewHeaderListener
TableViewHeaderListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TableViewColumnListener
TableViewColumnListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TableViewSortListener
TableViewSortListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter
 
Field Summary
static int MINIMUM_COLUMN_WIDTH
           
 
Constructor Summary
TerraTableViewHeaderSkin()
           
 
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 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, String previousName)
          Called when a column's name 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 enabledChanged(Component component)
          Called when a component's enabled state has changed.
 Color getBackgroundColor()
           
 int getBaseline(int width, int height)
          Returns the baseline for a given width and height.
 Color getBorderColor()
           
 Color getColor()
           
 boolean getColumnsResizable()
           
 Color getDisabledBackgroundColor()
           
 Color getDisabledBorderColor()
           
 Color getDisabledColor()
           
 Font getFont()
           
 int getHeaderAt(int x)
           
 Bounds getHeaderBounds(int headerIndex)
           
 boolean getHeadersPressable()
           
 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.
 void install(Component component)
          Associates a skin with a component.
 boolean isFocusable()
          By default, skins are focusable.
 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.
 void paint(Graphics2D graphics)
          Paints the visual.
 void setBackgroundColor(Color backgroundColor)
           
 void setBackgroundColor(int backgroundColor)
           
 void setBackgroundColor(String backgroundColor)
           
 void setBorderColor(Color borderColor)
           
 void setBorderColor(int borderColor)
           
 void setBorderColor(String borderColor)
           
 void setColor(Color color)
           
 void setColor(int color)
           
 void setColor(String color)
           
 void setColumnsResizable(boolean columnsResizable)
           
 void setDisabledBackgroundColor(Color disabledBackgroundColor)
           
 void setDisabledBackgroundColor(int disabledBackgroundColor)
           
 void setDisabledBackgroundColor(String disabledBackgroundColor)
           
 void setDisabledBorderColor(Color disabledBorderColor)
           
 void setDisabledBorderColor(int disabledBorderColor)
           
 void setDisabledBorderColor(String disabledBorderColor)
           
 void setDisabledColor(Color disabledColor)
           
 void setDisabledColor(int disabledColor)
           
 void setDisabledColor(String disabledColor)
           
 void setFont(Dictionary<String,?> font)
           
 void setFont(Font font)
           
 void setFont(String font)
           
 void setHeadersPressable(boolean headersPressable)
           
 void setIncludeTrailingVerticalGridLine(boolean includeTrailingVerticalGridLine)
           
 void sortAdded(TableView tableView, String columnName)
          Called when a sort has been added to a table view.
 void sortChanged(TableView tableView)
          Called when a table view's sort has changed.
 void sortModeChanged(TableViewHeader tableViewHeader, TableViewHeader.SortMode previousSortMode)
          Called when a table view header's sort mode has changed.
 void sortRemoved(TableView tableView, String columnName, SortDirection sortDirection)
          Called when a sort has been removed from a table view.
 void sortUpdated(TableView tableView, String columnName, SortDirection previousSortDirection)
          Called when a sort has been updated in a table view.
 void tableViewChanged(TableViewHeader tableViewHeader, TableView previousTableView)
          Called when a table view header's table view has changed.
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, focusedChanged, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, isOpaque, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseOver, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setSize, sizeChanged, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MINIMUM_COLUMN_WIDTH

public static final int MINIMUM_COLUMN_WIDTH
See Also:
Constant Field Values
Constructor Detail

TerraTableViewHeaderSkin

public TerraTableViewHeaderSkin()
Method Detail

install

public void install(Component component)
Description copied from interface: Skin
Associates a skin with a component.

Specified by:
install in interface Skin
Overrides:
install in class ComponentSkin
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 interface ConstrainedVisual
Parameters:
height - The height by which to constrain the preferred width, or -1 for no constraint.

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 interface ConstrainedVisual
Parameters:
width - The width by which to constrain the preferred height, or -1 for no constraint.

getPreferredSize

public Dimensions getPreferredSize()
Description copied from interface: ConstrainedVisual
Returns the visual's unconstrained preferred size.

Specified by:
getPreferredSize in interface ConstrainedVisual
Overrides:
getPreferredSize in class ComponentSkin

getBaseline

public int getBaseline(int width,
                       int height)
Description copied from interface: ConstrainedVisual
Returns the baseline for a given width and height.

Specified by:
getBaseline in interface ConstrainedVisual
Overrides:
getBaseline in class ComponentSkin
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.

Specified by:
layout in interface Skin

paint

public void paint(Graphics2D graphics)
Description copied from interface: Visual
Paints the visual.

Specified by:
paint in interface Visual
Parameters:
graphics - The graphics context in which to paint the visual.

getHeaderAt

public int getHeaderAt(int x)
Specified by:
getHeaderAt in interface TableViewHeader.Skin

getHeaderBounds

public Bounds getHeaderBounds(int headerIndex)
Specified by:
getHeaderBounds in interface TableViewHeader.Skin

isFocusable

public boolean isFocusable()
Description copied from class: ComponentSkin
By default, skins are focusable.

Specified by:
isFocusable in interface Skin
Overrides:
isFocusable in class ComponentSkin
Returns:
true if this skin is focusable; false, otherwise.

getFont

public Font getFont()

setFont

public void setFont(Font font)

setFont

public final void setFont(String font)

setFont

public final void setFont(Dictionary<String,?> font)

getColor

public Color getColor()

setColor

public void setColor(Color color)

setColor

public final void setColor(String color)

setColor

public final void setColor(int color)

getDisabledColor

public Color getDisabledColor()

setDisabledColor

public void setDisabledColor(Color disabledColor)

setDisabledColor

public final void setDisabledColor(String disabledColor)

setDisabledColor

public final void setDisabledColor(int disabledColor)

getBackgroundColor

public Color getBackgroundColor()

setBackgroundColor

public void setBackgroundColor(Color backgroundColor)

setBackgroundColor

public final void setBackgroundColor(String backgroundColor)

setBackgroundColor

public final void setBackgroundColor(int backgroundColor)

getDisabledBackgroundColor

public Color getDisabledBackgroundColor()

setDisabledBackgroundColor

public void setDisabledBackgroundColor(Color disabledBackgroundColor)

setDisabledBackgroundColor

public final void setDisabledBackgroundColor(String disabledBackgroundColor)

setDisabledBackgroundColor

public final void setDisabledBackgroundColor(int disabledBackgroundColor)

getBorderColor

public Color getBorderColor()

setBorderColor

public void setBorderColor(Color borderColor)

setBorderColor

public final void setBorderColor(String borderColor)

setBorderColor

public final void setBorderColor(int borderColor)

getDisabledBorderColor

public Color getDisabledBorderColor()

setDisabledBorderColor

public void setDisabledBorderColor(Color disabledBorderColor)

setDisabledBorderColor

public final void setDisabledBorderColor(String disabledBorderColor)

setDisabledBorderColor

public final void setDisabledBorderColor(int disabledBorderColor)

getHeadersPressable

public boolean getHeadersPressable()

setHeadersPressable

public void setHeadersPressable(boolean headersPressable)

getColumnsResizable

public boolean getColumnsResizable()

setColumnsResizable

public void setColumnsResizable(boolean columnsResizable)

getIncludeTrailingVerticalGridLine

public boolean getIncludeTrailingVerticalGridLine()

setIncludeTrailingVerticalGridLine

public void setIncludeTrailingVerticalGridLine(boolean includeTrailingVerticalGridLine)

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 the Component.isEnabled() method.

Specified by:
enabledChanged in interface ComponentStateListener
Overrides:
enabledChanged in class ComponentSkin
Parameters:
component - The component whose enabled state is changing.

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 interface ComponentMouseListener
Overrides:
mouseMove in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

mouseOut

public void mouseOut(Component component)
Description copied from interface: ComponentMouseListener
Called when the mouse exits a component.

Specified by:
mouseOut in interface ComponentMouseListener
Overrides:
mouseOut in class ComponentSkin

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 interface ComponentMouseButtonListener
Overrides:
mouseDown in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

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 interface ComponentMouseButtonListener
Overrides:
mouseUp in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

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 interface ComponentMouseButtonListener
Overrides:
mouseClick in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

tableViewChanged

public void tableViewChanged(TableViewHeader tableViewHeader,
                             TableView previousTableView)
Description copied from interface: TableViewHeaderListener
Called when a table view header's table view has changed.

Specified by:
tableViewChanged in interface TableViewHeaderListener

sortModeChanged

public void sortModeChanged(TableViewHeader tableViewHeader,
                            TableViewHeader.SortMode previousSortMode)
Description copied from interface: TableViewHeaderListener
Called when a table view header's sort mode has changed.

Specified by:
sortModeChanged in interface TableViewHeaderListener

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 interface TableViewColumnListener

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 interface TableViewColumnListener

columnNameChanged

public void columnNameChanged(TableView.Column column,
                              String previousName)
Description copied from interface: TableViewColumnListener
Called when a column's name has changed.

Specified by:
columnNameChanged in interface TableViewColumnListener

columnHeaderDataChanged

public void columnHeaderDataChanged(TableView.Column column,
                                    Object previousHeaderData)
Description copied from interface: TableViewColumnListener
Called when a column's header data has changed.

Specified by:
columnHeaderDataChanged in interface TableViewColumnListener

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 interface TableViewColumnListener

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 interface TableViewColumnListener

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 interface TableViewColumnListener

columnFilterChanged

public void columnFilterChanged(TableView.Column column,
                                Object previousFilter)
Description copied from interface: TableViewColumnListener
Called when a column's filter has changed.

Specified by:
columnFilterChanged in interface TableViewColumnListener

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 interface TableViewColumnListener

sortAdded

public void sortAdded(TableView tableView,
                      String columnName)
Description copied from interface: TableViewSortListener
Called when a sort has been added to a table view.

Specified by:
sortAdded in interface TableViewSortListener

sortUpdated

public void sortUpdated(TableView tableView,
                        String columnName,
                        SortDirection previousSortDirection)
Description copied from interface: TableViewSortListener
Called when a sort has been updated in a table view.

Specified by:
sortUpdated in interface TableViewSortListener

sortRemoved

public void sortRemoved(TableView tableView,
                        String columnName,
                        SortDirection sortDirection)
Description copied from interface: TableViewSortListener
Called when a sort has been removed from a table view.

Specified by:
sortRemoved in interface TableViewSortListener

sortChanged

public void sortChanged(TableView tableView)
Description copied from interface: TableViewSortListener
Called when a table view's sort has changed.

Specified by:
sortChanged in interface TableViewSortListener