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.terra.TerraTabPaneSkin
All Implemented Interfaces:
ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ConstrainedVisual, ContainerListener, ContainerMouseListener, Skin, TabPaneAttributeListener, TabPaneListener, TabPaneSelectionListener, Visual

public class TerraTabPaneSkin
extends ContainerSkin
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
protected  BoxPane buttonBoxPane
           
protected  Panorama buttonPanorama
           
static int CORNER_RADIUS
           
static int GRADIENT_BEVEL_THICKNESS
           
 
Fields inherited from class org.apache.pivot.wtk.skin.ComponentSkin
SHOW_TOOLTIP_TIMEOUT
 
Constructor Summary
TerraTabPaneSkin()
           
 
Method Summary
 void closeableChanged(TabPane tabPane, Component component)
          Called when a tab's closeable attribute 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.
 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 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.
 Orientation getTabOrientation()
           
 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.
 boolean isCollapsible()
           
 boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
          Called when a key has been pressed.
 void labelChanged(TabPane tabPane, Component component, String previousLabel)
          Called when a tab's label attribute has changed.
 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 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 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 setButtonFont(Dictionary<String,?> buttonFont)
           
 void setButtonFont(Font buttonFont)
           
 void setButtonFont(String buttonFont)
           
 void setButtonPadding(Insets buttonPadding)
           
 void setButtonPadding(int buttonPadding)
           
 void setButtonSpacing(int buttonSpacing)
           
 void setCollapsible(boolean collapsible)
           
 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 setTabOrientation(Orientation tabOrientation)
           
 void setTabOrientation(String tabOrientation)
           
 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.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, invalidateComponent, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, 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

buttonPanorama

protected Panorama buttonPanorama

buttonBoxPane

protected BoxPane buttonBoxPane

CORNER_RADIUS

public static final int CORNER_RADIUS
See Also:
Constant Field Values

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)

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(int buttonPadding)

getButtonSpacing

public int getButtonSpacing()

setButtonSpacing

public void setButtonSpacing(int buttonSpacing)

getTabOrientation

public Orientation getTabOrientation()

setTabOrientation

public void setTabOrientation(Orientation tabOrientation)

setTabOrientation

public void setTabOrientation(String tabOrientation)

isCollapsible

public boolean isCollapsible()

setCollapsible

public void setCollapsible(boolean collapsible)

keyPressed

public boolean keyPressed(Component component,
                          int keyCode,
                          Keyboard.KeyLocation keyLocation)
Description copied from interface: ComponentKeyListener
Called when a key has been pressed.

Specified by:
keyPressed in interface ComponentKeyListener
Overrides:
keyPressed in class ComponentSkin
Returns:
true to consume the event; false to allow it to propagate.

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

labelChanged

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

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

closeableChanged

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

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