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, ConstrainedVisual, Skin, TableViewColumnListener, TableViewHeader.Skin, TableViewHeaderListener, Visual

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

Table view header skin.


Nested Class Summary
 
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
           
 
Fields inherited from class org.apache.pivot.wtk.skin.ComponentSkin
SHOW_TOOLTIP_TIMEOUT
 
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 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 dataRendererChanged(TableViewHeader tableViewHeader, TableViewHeader.DataRenderer previousDataRenderer)
          Called when a table view header's data renderer has changed.
 void enabledChanged(Component component)
          Called when a component's enabled state has changed.
 Color getBackgroundColor()
           
 Color getBorderColor()
           
 Color getColor()
           
 boolean getColumnsResizable()
           
 Color getDisabledBackgroundColor()
           
 Color getDisabledBorderColor()
           
 Color getDisabledColor()
           
 Font getFont()
           
 int getHeaderAt(int x)
           
 Bounds getHeaderBounds(int index)
           
 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, components 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(Font font)
           
 void setFont(String font)
           
 void setHeadersPressable(boolean headersPressable)
           
 void setIncludeTrailingVerticalGridLine(boolean includeTrailingVerticalGridLine)
           
 void tableViewChanged(TableViewHeader tableViewHeader, TableView previousTableView)
          Called when a table view header's table view has changed.
 void uninstall()
          Dissociates a skin from a component.
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, dragSourceChanged, dropTargetChanged, focusedChanged, getComponent, getHeight, getWidth, invalidateComponent, isOpaque, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseOver, mouseWheel, parentChanged, preferredHeightLimitsChanged, preferredSizeChanged, preferredWidthLimitsChanged, repaintComponent, 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
 

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.

uninstall

public void uninstall()
Description copied from interface: Skin
Dissociates a skin from a component.

Specified by:
uninstall in interface Skin
Overrides:
uninstall in class ComponentSkin

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

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 index)
Specified by:
getHeaderBounds in interface TableViewHeader.Skin

isFocusable

public boolean isFocusable()
Description copied from class: ComponentSkin
By default, components 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)

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.

Specified by:
enabledChanged in interface ComponentStateListener
Overrides:
enabledChanged in class ComponentSkin

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

dataRendererChanged

public void dataRendererChanged(TableViewHeader tableViewHeader,
                                TableViewHeader.DataRenderer previousDataRenderer)
Description copied from interface: TableViewHeaderListener
Called when a table view header's data renderer has changed.

Specified by:
dataRendererChanged 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

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

columnSortDirectionChanged

public void columnSortDirectionChanged(TableView.Column column,
                                       SortDirection previousSortDirection)
Description copied from interface: TableViewColumnListener
Called when a column's sort direction has changed.

Specified by:
columnSortDirectionChanged 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