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

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.TerraAccordionSkin
All Implemented Interfaces:
AccordionAttributeListener, AccordionListener, AccordionSelectionListener, ComponentKeyListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ComponentTooltipListener, ConstrainedVisual, ContainerListener, ContainerMouseListener, Skin, Visual

public class TerraAccordionSkin
extends ContainerSkin
implements AccordionListener, AccordionSelectionListener, AccordionAttributeListener

Accordion skin.


Nested Class Summary
protected  class TerraAccordionSkin.PanelHeader
           
protected  class TerraAccordionSkin.PanelHeaderSkin
           
 class TerraAccordionSkin.SelectionChangeTransition
           
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.AccordionListener
AccordionListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.AccordionSelectionListener
AccordionSelectionListener.Adapter
 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.AccordionAttributeListener
AccordionAttributeListener.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
           
 
Constructor Summary
TerraAccordionSkin()
           
 
Method Summary
 int getBaseline(int width, int height)
          Returns the baseline for a given width and height.
 Color getBorderColor()
           
 Color getButtonBackgroundColor()
           
 Color getButtonColor()
           
 Font getButtonFont()
           
 Insets getButtonPadding()
           
 Color getDisabledButtonColor()
           
 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()
           
 void headerDataChanged(Accordion accordion, Component component, Object previousHeaderData)
          Called when a panel's header data attribute has changed.
 void headerDataRendererChanged(Accordion accordion, Button.DataRenderer previousHeaderDataRenderer)
          Called when an accordion's header data renderer has changed.
 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.
 void panelInserted(Accordion accordion, int index)
          Called when a panel has been inserted into a accordion's panel sequence.
 void panelsRemoved(Accordion accordion, int index, Sequence<Component> removed)
          Called when a panel has been removed from an accordion's panel sequence.
 Vote previewSelectedIndexChange(Accordion accordion, int selectedIndex)
          Called to preview a selected index change.
 void selectedIndexChanged(Accordion accordion, int previousSelectedIndex)
          Called when an accordion's selected index has changed.
 void selectedIndexChangeVetoed(Accordion accordion, Vote reason)
          Called when a selected index change has been vetoed.
 void setBorderColor(Color borderColor)
           
 void setBorderColor(String borderColor)
           
 void setButtonBackgroundColor(Color buttonBackgroundColor)
           
 void setButtonBackgroundColor(int buttonBackgroundColor)
           
 void setButtonBackgroundColor(String buttonBackgroundColor)
           
 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(Dictionary<String,?> buttonPadding)
           
 void setButtonPadding(Insets buttonPadding)
           
 void setButtonPadding(int buttonPadding)
           
 void setButtonPadding(Number padding)
           
 void setButtonPadding(String padding)
           
 void setDisabledButtonColor(Color disabledButtonColor)
           
 void setDisabledButtonColor(int disabledButtonColor)
           
 void setDisabledButtonColor(String disabledButtonColor)
           
 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 setSize(int width, int height)
          Sets the visual's render size.
 void tooltipTextChanged(Accordion accordion, Component component, String previousTooltipText)
          Called when a panel's tooltip text 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, heightLimitsChanged, invalidateComponent, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, 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

TerraAccordionSkin

public TerraAccordionSkin()
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.

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.

getBorderColor

public Color getBorderColor()

setBorderColor

public void setBorderColor(Color borderColor)

setBorderColor

public final void setBorderColor(String 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)

getDisabledButtonColor

public Color getDisabledButtonColor()

setDisabledButtonColor

public void setDisabledButtonColor(Color disabledButtonColor)

setDisabledButtonColor

public final void setDisabledButtonColor(String disabledButtonColor)

setDisabledButtonColor

public final void setDisabledButtonColor(int disabledButtonColor)

getButtonBackgroundColor

public Color getButtonBackgroundColor()

setButtonBackgroundColor

public void setButtonBackgroundColor(Color buttonBackgroundColor)

setButtonBackgroundColor

public final void setButtonBackgroundColor(String buttonBackgroundColor)

setButtonBackgroundColor

public final void setButtonBackgroundColor(int buttonBackgroundColor)

getButtonPadding

public Insets getButtonPadding()

setButtonPadding

public void setButtonPadding(Insets buttonPadding)

setButtonPadding

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

setButtonPadding

public final void setButtonPadding(int buttonPadding)

setButtonPadding

public final void setButtonPadding(Number padding)

setButtonPadding

public final void setButtonPadding(String padding)

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) pane at index 0 to 8 respectively

ALT + UP Select the next enabled panel.
ALT + DOWN Select the previous enabled panel.

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

panelInserted

public void panelInserted(Accordion accordion,
                          int index)
Description copied from interface: AccordionListener
Called when a panel has been inserted into a accordion's panel sequence.

Specified by:
panelInserted in interface AccordionListener

panelsRemoved

public void panelsRemoved(Accordion accordion,
                          int index,
                          Sequence<Component> removed)
Description copied from interface: AccordionListener
Called when a panel has been removed from an accordion's panel sequence.

Specified by:
panelsRemoved in interface AccordionListener

headerDataRendererChanged

public void headerDataRendererChanged(Accordion accordion,
                                      Button.DataRenderer previousHeaderDataRenderer)
Description copied from interface: AccordionListener
Called when an accordion's header data renderer has changed.

Specified by:
headerDataRendererChanged in interface AccordionListener

previewSelectedIndexChange

public Vote previewSelectedIndexChange(Accordion accordion,
                                       int selectedIndex)
Description copied from interface: AccordionSelectionListener
Called to preview a selected index change.

Specified by:
previewSelectedIndexChange in interface AccordionSelectionListener
Parameters:
accordion - The source of the event.
selectedIndex - The index that will be selected.

selectedIndexChangeVetoed

public void selectedIndexChangeVetoed(Accordion accordion,
                                      Vote reason)
Description copied from interface: AccordionSelectionListener
Called when a selected index change has been vetoed.

Specified by:
selectedIndexChangeVetoed in interface AccordionSelectionListener
Parameters:
accordion - The source of the event.
reason - The reason the event was vetoed.

selectedIndexChanged

public void selectedIndexChanged(Accordion accordion,
                                 int previousSelectedIndex)
Description copied from interface: AccordionSelectionListener
Called when an accordion's selected index has changed.

Specified by:
selectedIndexChanged in interface AccordionSelectionListener
Parameters:
accordion - The source of the event.
previousSelectedIndex - If the selection changed directly, contains the index that was previously selected. Otherwise, contains the current selection.

headerDataChanged

public void headerDataChanged(Accordion accordion,
                              Component component,
                              Object previousHeaderData)
Description copied from interface: AccordionAttributeListener
Called when a panel's header data attribute has changed.

Specified by:
headerDataChanged in interface AccordionAttributeListener

tooltipTextChanged

public void tooltipTextChanged(Accordion accordion,
                               Component component,
                               String previousTooltipText)
Description copied from interface: AccordionAttributeListener
Called when a panel's tooltip text has changed.

Specified by:
tooltipTextChanged in interface AccordionAttributeListener