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

java.lang.Object
  extended by org.apache.pivot.wtk.skin.ComponentSkin
      extended by org.apache.pivot.wtk.skin.ContainerSkin
          extended by org.apache.pivot.wtk.skin.TabPaneSkin
              extended by org.apache.pivot.wtk.skin.terra.TerraTabPaneSkin
All Implemented Interfaces:
ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ComponentTooltipListener, ConstrainedVisual, ContainerListener, ContainerMouseListener, Skin, TabPane.Skin, TabPaneAttributeListener, TabPaneListener, TabPaneSelectionListener, Visual

public class TerraTabPaneSkin
extends TabPaneSkin
implements TabPaneListener, TabPaneSelectionListener, TabPaneAttributeListener

Tab pane skin.


Nested Class Summary
 class TerraTabPaneSkin.SelectionChangeTransition
          Selection change transition.
 class TerraTabPaneSkin.TabButton
          Tab button component.
 class TerraTabPaneSkin.TabButtonSkin
          Tab button skin.
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TabPaneListener
TabPaneListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TabPaneSelectionListener
TabPaneSelectionListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.TabPaneAttributeListener
TabPaneAttributeListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerListener
ContainerListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerMouseListener
ContainerMouseListener.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 GRADIENT_BEVEL_THICKNESS
           
 
Fields inherited from class org.apache.pivot.wtk.skin.TabPaneSkin
tabButtonBoxPane
 
Constructor Summary
TerraTabPaneSkin()
           
 
Method Summary
 void closeableChanged(TabPane tabPane)
          Called when a tab pane's closeable property has changed.
 void collapsibleChanged(TabPane tabPane)
          Called when a tab pane's collapsible property has changed.
 void cornerChanged(TabPane tabPane, Component previousCorner)
          Called when a tab pane's corner component has changed.
 Color getActiveTabColor()
           
 int getBaseline(int width, int height)
          Returns the baseline for a given width and height.
 Color getBorderColor()
           
 Color getButtonColor()
           
 Font getButtonFont()
           
 Insets getButtonPadding()
           
 int getButtonSpacing()
           
 Color getInactiveBorderColor()
           
 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.
 int getSelectionChangeDuration()
           
 int getSelectionChangeRate()
           
 Orientation getTabOrientation()
           
 void install(Component component)
          Associates a skin with a component.
 boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
          Key presses have no effect if the event has already been consumed.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void paint(Graphics2D graphics)
          Paints the visual.
 Vote previewRemoveTabs(TabPane tabPane, int index, int count)
          Called to preview a tab removal.
 Vote previewSelectedIndexChange(TabPane tabPane, int selectedIndex)
          Called to preview a selected index change.
 void removeTabsVetoed(TabPane tabPane, Vote vote)
          Called when a tab removal has been vetoed.
 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 setActiveTabColor(Color activeTabColor)
           
 void setActiveTabColor(int activeTabColor)
           
 void setActiveTabColor(String activeTabColor)
           
 void setBorderColor(Color borderColor)
           
 void setBorderColor(int borderColor)
           
 void setBorderColor(String borderColor)
           
 void setButtonColor(Color buttonColor)
           
 void setButtonColor(int buttonColor)
           
 void setButtonColor(String buttonColor)
           
 void setButtonCornerRadius(int buttonCornerRadius)
           
 void setButtonCornerRadius(Number radius)
           
 void setButtonCornerRadius(String radius)
           
 void setButtonFont(Dictionary<String,?> buttonFont)
           
 void setButtonFont(Font buttonFont)
           
 void setButtonFont(String buttonFont)
           
 void setButtonPadding(Dictionary<String,?> padding)
           
 void setButtonPadding(Insets buttonPadding)
           
 void setButtonPadding(int buttonPadding)
           
 void setButtonPadding(Number padding)
           
 void setButtonPadding(String padding)
           
 void setButtonSpacing(int buttonSpacing)
           
 void setInactiveBorderColor(Color inactiveBorderColor)
           
 void setInactiveBorderColor(int inactiveBorderColor)
           
 void setInactiveBorderColor(String inactiveBorderColor)
           
 void setInactiveTabColor(Color inactiveTabColor)
           
 void setInactiveTabColor(int inactiveTabColor)
           
 void setInactiveTabColor(String inactiveTabColor)
           
 void setPadding(Dictionary<String,?> padding)
           
 void setPadding(Insets padding)
           
 void setPadding(int padding)
           
 void setPadding(Number padding)
           
 void setPadding(String padding)
           
 void setSelectionChangeDuration(int selectionChangeDuration)
           
 void setSelectionChangeRate(int selectionChangeRate)
           
 void setTabOrientation(Orientation tabOrientation)
           
 void tabDataChanged(TabPane tabPane, Component component, Object previousTabData)
          Called when a tab's tab data attribute has changed.
 void tabDataRendererChanged(TabPane tabPane, Button.DataRenderer previousTabDataRenderer)
          Called when a tab pane's tab data renderer has changed.
 void tabInserted(TabPane tabPane, int index)
          Called when a tab has been inserted into a tab pane's tab sequence.
 void tabsRemoved(TabPane tabPane, int index, Sequence<Component> removed)
          Called when a tab has been removed from a tab pane's tab sequence.
 void tooltipTextChanged(TabPane tabPane, Component component, String previousTooltipText)
          Called when a tab's tooltipText attribute has changed.
 
Methods inherited from class org.apache.pivot.wtk.skin.TabPaneSkin
isVisible, setVisible
 
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, mouseDown, mouseMove, mouseUp, mouseWheel, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint, setBackgroundPaint
 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
cursorChanged, decodeFont, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, getBaseline, getComponent, getHeight, getWidth, heightLimitsChanged, invalidateComponent, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, 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

GRADIENT_BEVEL_THICKNESS

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

TerraTabPaneSkin

public TerraTabPaneSkin()
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 ContainerSkin
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
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

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
Overrides:
paint in class ContainerSkin
Parameters:
graphics - The graphics context in which to paint the visual.

getActiveTabColor

public Color getActiveTabColor()

setActiveTabColor

public void setActiveTabColor(Color activeTabColor)

setActiveTabColor

public final void setActiveTabColor(String activeTabColor)

setActiveTabColor

public final void setActiveTabColor(int activeTabColor)

getInactiveTabColor

public Color getInactiveTabColor()

setInactiveTabColor

public void setInactiveTabColor(Color inactiveTabColor)

setInactiveTabColor

public final void setInactiveTabColor(String inactiveTabColor)

setInactiveTabColor

public final void setInactiveTabColor(int inactiveTabColor)

getBorderColor

public Color getBorderColor()

setBorderColor

public void setBorderColor(Color borderColor)

setBorderColor

public final void setBorderColor(String borderColor)

setBorderColor

public final void setBorderColor(int borderColor)

getInactiveBorderColor

public Color getInactiveBorderColor()

setInactiveBorderColor

public void setInactiveBorderColor(Color inactiveBorderColor)

setInactiveBorderColor

public final void setInactiveBorderColor(String inactiveBorderColor)

setInactiveBorderColor

public final void setInactiveBorderColor(int inactiveBorderColor)

getPadding

public Insets getPadding()

setPadding

public void setPadding(Insets padding)

setPadding

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

setPadding

public final void setPadding(int padding)

setPadding

public final void setPadding(Number padding)

setPadding

public final void setPadding(String padding)

getButtonFont

public Font getButtonFont()

setButtonFont

public void setButtonFont(Font buttonFont)

setButtonFont

public final void setButtonFont(String buttonFont)

setButtonFont

public final void setButtonFont(Dictionary<String,?> buttonFont)

getButtonColor

public Color getButtonColor()

setButtonColor

public void setButtonColor(Color buttonColor)

setButtonColor

public final void setButtonColor(String buttonColor)

setButtonColor

public final void setButtonColor(int buttonColor)

getButtonPadding

public Insets getButtonPadding()

setButtonPadding

public void setButtonPadding(Insets buttonPadding)

setButtonPadding

public final void setButtonPadding(Dictionary<String,?> padding)

setButtonPadding

public final void setButtonPadding(int buttonPadding)

setButtonPadding

public final void setButtonPadding(Number padding)

setButtonPadding

public final void setButtonPadding(String padding)

getButtonSpacing

public int getButtonSpacing()

setButtonSpacing

public void setButtonSpacing(int buttonSpacing)

setButtonCornerRadius

public final void setButtonCornerRadius(int buttonCornerRadius)

setButtonCornerRadius

public final void setButtonCornerRadius(Number radius)

setButtonCornerRadius

public final void setButtonCornerRadius(String radius)

getTabOrientation

public Orientation getTabOrientation()

setTabOrientation

public void setTabOrientation(Orientation tabOrientation)

getSelectionChangeDuration

public int getSelectionChangeDuration()

setSelectionChangeDuration

public void setSelectionChangeDuration(int selectionChangeDuration)

getSelectionChangeRate

public int getSelectionChangeRate()

setSelectionChangeRate

public void setSelectionChangeRate(int selectionChangeRate)

keyPressed

public boolean keyPressed(Component component,
                          int keyCode,
                          Keyboard.KeyLocation keyLocation)
Key presses have no effect if the event has already been consumed.

CommandModifier + KEYPAD_1 to KEYPAD_9
or CommandModifier + 1 to 9 Select the (enabled) tab at index 0 to 8 respectively

Specified by:
keyPressed in interface ComponentKeyListener
Overrides:
keyPressed in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.
See Also:
Platform.getCommandModifier()

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

previewRemoveTabs

public Vote previewRemoveTabs(TabPane tabPane,
                              int index,
                              int count)
Description copied from interface: TabPaneListener
Called to preview a tab removal.

Specified by:
previewRemoveTabs in interface TabPaneListener

removeTabsVetoed

public void removeTabsVetoed(TabPane tabPane,
                             Vote vote)
Description copied from interface: TabPaneListener
Called when a tab removal has been vetoed.

Specified by:
removeTabsVetoed in interface TabPaneListener

tabsRemoved

public void tabsRemoved(TabPane tabPane,
                        int index,
                        Sequence<Component> removed)
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 has changed.

Specified by:
cornerChanged in interface TabPaneListener

tabDataRendererChanged

public void tabDataRendererChanged(TabPane tabPane,
                                   Button.DataRenderer previousTabDataRenderer)
Description copied from interface: TabPaneListener
Called when a tab pane's tab data renderer has changed.

Specified by:
tabDataRendererChanged in interface TabPaneListener

closeableChanged

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

Specified by:
closeableChanged in interface TabPaneListener

collapsibleChanged

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

Specified by:
collapsibleChanged 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
Parameters:
tabPane - The source of the event.
selectedIndex - The index that will be selected.

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
Parameters:
tabPane - The source of the event.
reason - The reason the event was vetoed.

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
Parameters:
tabPane - The source of the event.
previousSelectedIndex - If the selection changed directly, contains the index that was previously selected. Otherwise, contains the current selection.

tabDataChanged

public void tabDataChanged(TabPane tabPane,
                           Component component,
                           Object previousTabData)
Description copied from interface: TabPaneAttributeListener
Called when a tab's tab data attribute has changed.

Specified by:
tabDataChanged in interface TabPaneAttributeListener

tooltipTextChanged

public void tooltipTextChanged(TabPane tabPane,
                               Component component,
                               String previousTooltipText)
Description copied from interface: TabPaneAttributeListener
Called when a tab's tooltipText attribute has changed.

Specified by:
tooltipTextChanged in interface TabPaneAttributeListener