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, 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
           
 
Fields inherited from class org.apache.pivot.wtk.skin.ComponentSkin
SHOW_TOOLTIP_TIMEOUT
 
Constructor Summary
TerraAccordionSkin()
           
 
Method Summary
 int getBaseline(int width, int height)
          Returns the baseline for a given width and height.
 Color getBorderColor()
           
 Color getButtonColor()
           
 Font getButtonFont()
           
 Insets getButtonPadding()
           
 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(Accordion accordion, Component component, Image previousIcon)
          Called when a panel's icon attribute has changed.
 void install(Component component)
          Associates a skin with a component.
 boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
          Called when a key has been pressed.
 void labelChanged(Accordion accordion, Component component, String previousLabel)
          Called when a panel'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.
 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 setButtonColor(Color 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 setPadding(Dictionary<String,?> padding)
           
 void setPadding(Insets padding)
           
 void setPadding(int padding)
           
 void setPadding(Number padding)
           
 void setPadding(String padding)
           
 void setSize(int width, int height)
          Sets the visual's render size.
 
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, sizeChanged, styleUpdated, tooltipTextChanged, visibleChanged
 
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)

getButtonPadding

public Insets getButtonPadding()

setButtonPadding

public void setButtonPadding(Insets buttonPadding)

setButtonPadding

public final void setButtonPadding(int buttonPadding)

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.

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

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

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

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

labelChanged

public void labelChanged(Accordion accordion,
                         Component component,
                         String previousLabel)
Description copied from interface: AccordionAttributeListener
Called when a panel's label attribute has changed.

Specified by:
labelChanged in interface AccordionAttributeListener

iconChanged

public void iconChanged(Accordion accordion,
                        Component component,
                        Image previousIcon)
Description copied from interface: AccordionAttributeListener
Called when a panel's icon attribute has changed.

Specified by:
iconChanged in interface AccordionAttributeListener