pivot.wtk.skin.terra
Class TerraTabPaneSkin

java.lang.Object
  extended by pivot.wtk.skin.ComponentSkin
      extended by pivot.wtk.skin.ContainerSkin
          extended by pivot.wtk.skin.terra.TerraTabPaneSkin
All Implemented Interfaces:
Button.GroupListener, ComponentKeyListener, ComponentLayoutListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ConstrainedVisual, ContainerListener, Skin, TabPaneAttributeListener, TabPaneListener, TabPaneSelectionListener, Visual

public class TerraTabPaneSkin
extends ContainerSkin
implements TabPaneListener, TabPaneSelectionListener, TabPaneAttributeListener, Button.GroupListener

Tab pane skin.

TODO Make tab buttons focusable?

TODO Disable the tab button when the component is disabled? We'd need style properties to present a disabled tab button state. We'd also need to manage button enabled state independently of tab pane enabled state.

TODO Add showCloseButton style.

Author:
gbrown

Nested Class Summary
 class TerraTabPaneSkin.ExpandTransition
           
protected  class TerraTabPaneSkin.TabButton
           
protected  class TerraTabPaneSkin.TabButtonSkin
           
 
Nested classes/interfaces inherited from class pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Field Summary
protected  FlowPane buttonFlowPane
           
protected  Panorama buttonPanorama
           
static int GRADIENT_BEVEL_THICKNESS
           
 
Fields inherited from class pivot.wtk.skin.ComponentSkin
SHOW_TOOLTIP_TIMEOUT
 
Constructor Summary
TerraTabPaneSkin()
           
 
Method Summary
 void collapsibleChanged(TabPane tabPane)
          Called when a tab pane's collapsible flag has changed.
 void cornerChanged(TabPane tabPane, Component previousCorner)
          Called when a tab pane's corner component (the component in the free space next to the tabs) has changed.
 java.awt.Color getActiveTabColor()
           
 java.awt.Color getBorderColor()
           
 java.awt.Color getButtonColor()
           
 java.awt.Font getButtonFont()
           
 Insets getButtonPadding()
           
 int getButtonSpacing()
           
 java.awt.Color getInactiveTabColor()
           
 Insets getPadding()
           
 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 iconChanged(TabPane tabPane, Component component, Image previousIcon)
          Called when a tab's icon attribute has changed.
 void install(Component component)
          Associates a skin with a component.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void nameChanged(TabPane tabPane, Component component, java.lang.String previousName)
          Called when a tab's name attribute has changed.
 void paint(java.awt.Graphics2D graphics)
          Paints the visual.
 Vote previewSelectedIndexChange(TabPane tabPane, int selectedIndex)
          Called to preview a selected index change.
 void selectedIndexChanged(TabPane tabPane, int previousSelectedIndex)
          Called when a tab pane's selected index has changed.
 void selectedIndexChangeVetoed(TabPane tabPane, Vote reason)
          Called when a selected index change has been vetoed.
 void selectionChanged(Button.Group group, Button previousSelection)
          Called when a button group's selection has changed.
 void setActiveTabColor(java.awt.Color activeTabColor)
           
 void setActiveTabColor(java.lang.String activeTabColor)
           
 void setBorderColor(java.awt.Color borderColor)
           
 void setBorderColor(java.lang.String borderColor)
           
 void setButtonColor(java.awt.Color buttonColor)
           
 void setButtonColor(java.lang.String buttonColor)
           
 void setButtonFont(java.awt.Font buttonFont)
           
 void setButtonFont(java.lang.String buttonFont)
           
 void setButtonPadding(Insets buttonPadding)
           
 void setButtonPadding(int buttonPadding)
           
 void setButtonSpacing(int buttonSpacing)
           
 void setInactiveTabColor(java.awt.Color inactiveTabColor)
           
 void setInactiveTabColor(java.lang.String inactiveTabColor)
           
 void setPadding(Dictionary<java.lang.String,?> padding)
           
 void setPadding(Insets padding)
           
 void setPadding(int padding)
           
 void setPadding(java.lang.Number padding)
           
 void setSize(int width, int height)
          Sets the visual's render size.
 void tabInserted(TabPane tabPane, int index)
          Called when a tab has been inserted into a tab pane's tab sequence.
 void tabOrientationChanged(TabPane tabPane)
          Called when a tab pane's orientation has changed.
 void tabsRemoved(TabPane tabPane, int index, Sequence<Component> tabs)
          Called when a tab has been removed from a tab pane's tab sequence.
 void uninstall()
          Dissociates a skin from a component.
protected  void updateButtonData(Component tab)
           
 
Methods inherited from class pivot.wtk.skin.ContainerSkin
componentInserted, componentsRemoved, contextKeyChanged, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, setBackgroundColor, setBackgroundColor, setBackgroundPaint
 
Methods inherited from class pivot.wtk.skin.ComponentSkin
cursorChanged, decodeColor, displayableChanged, enabledChanged, focusedChanged, getComponent, getHeight, getWidth, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, sizeChanged, styleUpdated, tooltipTextChanged, visibleChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buttonPanorama

protected Panorama buttonPanorama

buttonFlowPane

protected FlowPane buttonFlowPane

GRADIENT_BEVEL_THICKNESS

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

TerraTabPaneSkin

public TerraTabPaneSkin()
Method Detail

setSize

public void setSize(int width,
                    int height)
Description copied from interface: ConstrainedVisual
Sets the visual's render size.

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

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 ContainerSkin
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 ContainerSkin

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
Overrides:
getPreferredWidth in class ContainerSkin
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
Overrides:
getPreferredHeight in class ContainerSkin
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(java.awt.Graphics2D graphics)
Description copied from interface: Visual
Paints the visual.

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

getActiveTabColor

public java.awt.Color getActiveTabColor()

setActiveTabColor

public void setActiveTabColor(java.awt.Color activeTabColor)

setActiveTabColor

public final void setActiveTabColor(java.lang.String activeTabColor)

getInactiveTabColor

public java.awt.Color getInactiveTabColor()

setInactiveTabColor

public void setInactiveTabColor(java.awt.Color inactiveTabColor)

setInactiveTabColor

public final void setInactiveTabColor(java.lang.String inactiveTabColor)

getBorderColor

public java.awt.Color getBorderColor()

setBorderColor

public void setBorderColor(java.awt.Color borderColor)

setBorderColor

public final void setBorderColor(java.lang.String borderColor)

getPadding

public Insets getPadding()

setPadding

public void setPadding(Insets padding)

setPadding

public final void setPadding(Dictionary<java.lang.String,?> padding)

setPadding

public final void setPadding(int padding)

setPadding

public final void setPadding(java.lang.Number padding)

getButtonFont

public java.awt.Font getButtonFont()

setButtonFont

public void setButtonFont(java.awt.Font buttonFont)

setButtonFont

public final void setButtonFont(java.lang.String buttonFont)

getButtonColor

public java.awt.Color getButtonColor()

setButtonColor

public void setButtonColor(java.awt.Color buttonColor)

setButtonColor

public final void setButtonColor(java.lang.String buttonColor)

getButtonPadding

public Insets getButtonPadding()

setButtonPadding

public void setButtonPadding(Insets buttonPadding)

setButtonPadding

public final void setButtonPadding(int buttonPadding)

getButtonSpacing

public int getButtonSpacing()

setButtonSpacing

public void setButtonSpacing(int buttonSpacing)

updateButtonData

protected void updateButtonData(Component tab)

tabOrientationChanged

public void tabOrientationChanged(TabPane tabPane)
Description copied from interface: TabPaneListener
Called when a tab pane's orientation has changed.

Specified by:
tabOrientationChanged in interface TabPaneListener

collapsibleChanged

public void collapsibleChanged(TabPane tabPane)
Description copied from interface: TabPaneListener
Called when a tab pane's collapsible flag has changed.

Specified by:
collapsibleChanged in interface TabPaneListener

tabInserted

public void tabInserted(TabPane tabPane,
                        int index)
Description copied from interface: TabPaneListener
Called when a tab has been inserted into a tab pane's tab sequence.

Specified by:
tabInserted in interface TabPaneListener

tabsRemoved

public void tabsRemoved(TabPane tabPane,
                        int index,
                        Sequence<Component> tabs)
Description copied from interface: TabPaneListener
Called when a tab has been removed from a tab pane's tab sequence.

Specified by:
tabsRemoved in interface TabPaneListener

cornerChanged

public void cornerChanged(TabPane tabPane,
                          Component previousCorner)
Description copied from interface: TabPaneListener
Called when a tab pane's corner component (the component in the free space next to the tabs) has changed.

Specified by:
cornerChanged in interface TabPaneListener

previewSelectedIndexChange

public Vote previewSelectedIndexChange(TabPane tabPane,
                                       int selectedIndex)
Description copied from interface: TabPaneSelectionListener
Called to preview a selected index change.

Specified by:
previewSelectedIndexChange in interface TabPaneSelectionListener

selectedIndexChangeVetoed

public void selectedIndexChangeVetoed(TabPane tabPane,
                                      Vote reason)
Description copied from interface: TabPaneSelectionListener
Called when a selected index change has been vetoed.

Specified by:
selectedIndexChangeVetoed in interface TabPaneSelectionListener

selectedIndexChanged

public void selectedIndexChanged(TabPane tabPane,
                                 int previousSelectedIndex)
Description copied from interface: TabPaneSelectionListener
Called when a tab pane's selected index has changed.

Specified by:
selectedIndexChanged in interface TabPaneSelectionListener

nameChanged

public void nameChanged(TabPane tabPane,
                        Component component,
                        java.lang.String previousName)
Description copied from interface: TabPaneAttributeListener
Called when a tab's name attribute has changed.

Specified by:
nameChanged in interface TabPaneAttributeListener

iconChanged

public void iconChanged(TabPane tabPane,
                        Component component,
                        Image previousIcon)
Description copied from interface: TabPaneAttributeListener
Called when a tab's icon attribute has changed.

Specified by:
iconChanged in interface TabPaneAttributeListener

selectionChanged

public void selectionChanged(Button.Group group,
                             Button previousSelection)
Description copied from interface: Button.GroupListener
Called when a button group's selection has changed.

Specified by:
selectionChanged in interface Button.GroupListener