pivot.wtk.skin.terra
Class TerraRollupSkin

java.lang.Object
  extended by pivot.wtk.skin.ComponentSkin
      extended by pivot.wtk.skin.ContainerSkin
          extended by pivot.wtk.skin.terra.TerraRollupSkin
All Implemented Interfaces:
ButtonPressListener, ComponentKeyListener, ComponentLayoutListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ConstrainedVisual, ContainerListener, RollupListener, Skin, Visual

public class TerraRollupSkin
extends ContainerSkin
implements RollupListener, ButtonPressListener

Rollup skin.

TODO Optimize this class by performing preferred size calculation in one pass.

Author:
tvolkert

Nested Class Summary
protected  class TerraRollupSkin.BulletImage
           
protected  class TerraRollupSkin.ButtonImage
           
protected  class TerraRollupSkin.CollapseImage
           
protected  class TerraRollupSkin.ExpandImage
           
protected  class TerraRollupSkin.RollupButton
           
protected  class TerraRollupSkin.RollupButtonSkin
           
 
Nested classes/interfaces inherited from class pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Field Summary
 
Fields inherited from class pivot.wtk.skin.ComponentSkin
SHOW_TOOLTIP_TIMEOUT
 
Constructor Summary
TerraRollupSkin()
           
 
Method Summary
 void buttonPressed(Button button)
          Called when a button is pressed.
 void componentInserted(Container container, int index)
          Called when a component has been inserted into a container's component sequence.
 void componentsRemoved(Container container, int index, Sequence<Component> components)
          Called when components have been removed from a container's component sequence.
 void expandedChanged(Rollup rollup)
          Called when a rollup's expanded state changed.
 void expandedChangeVetoed(Rollup rollup, Vote reason)
          Called when a rollup expansion event has been vetoed.
 int getBuffer()
           
 java.awt.Color getButtonColor()
           
 boolean getFirstChildToggles()
           
 boolean getJustify()
           
 int getPreferredHeight(int width)
          Returns the visual's preferred height given the provided width constraint.
 int getPreferredWidth(int height)
          Returns the visual's preferred width given the provided height constraint.
 int getSpacing()
           
 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.
 Vote previewExpandedChange(Rollup rollup)
          Called to preview a rollup expansion event.
 void setBuffer(int buffer)
           
 void setButtonColor(java.awt.Color buttonColor)
           
 void setButtonColor(java.lang.String buttonColor)
           
 void setFirstChildToggles(boolean firstChildToggles)
           
 void setJustify(boolean justify)
           
 void setSpacing(int spacing)
           
 void uninstall()
          Dissociates a skin from a component.
 
Methods inherited from class pivot.wtk.skin.ContainerSkin
contextKeyChanged, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, paint, setBackgroundColor, setBackgroundColor, setBackgroundPaint
 
Methods inherited from class pivot.wtk.skin.ComponentSkin
cursorChanged, decodeColor, displayableChanged, enabledChanged, focusedChanged, getComponent, getHeight, getPreferredSize, getWidth, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, parentChanged, preferredSizeChanged, 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
 

Constructor Detail

TerraRollupSkin

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

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.

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

getButtonColor

public java.awt.Color getButtonColor()

setButtonColor

public void setButtonColor(java.awt.Color buttonColor)

setButtonColor

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

getSpacing

public int getSpacing()

setSpacing

public void setSpacing(int spacing)

getBuffer

public int getBuffer()

setBuffer

public void setBuffer(int buffer)

getJustify

public boolean getJustify()

setJustify

public void setJustify(boolean justify)

getFirstChildToggles

public boolean getFirstChildToggles()

setFirstChildToggles

public void setFirstChildToggles(boolean firstChildToggles)

componentInserted

public void componentInserted(Container container,
                              int index)
Description copied from interface: ContainerListener
Called when a component has been inserted into a container's component sequence.

Specified by:
componentInserted in interface ContainerListener
Overrides:
componentInserted in class ContainerSkin

componentsRemoved

public void componentsRemoved(Container container,
                              int index,
                              Sequence<Component> components)
Description copied from interface: ContainerListener
Called when components have been removed from a container's component sequence.

Specified by:
componentsRemoved in interface ContainerListener
Overrides:
componentsRemoved in class ContainerSkin

previewExpandedChange

public Vote previewExpandedChange(Rollup rollup)
Description copied from interface: RollupListener
Called to preview a rollup expansion event.

Specified by:
previewExpandedChange in interface RollupListener

expandedChangeVetoed

public void expandedChangeVetoed(Rollup rollup,
                                 Vote reason)
Description copied from interface: RollupListener
Called when a rollup expansion event has been vetoed.

Specified by:
expandedChangeVetoed in interface RollupListener

expandedChanged

public void expandedChanged(Rollup rollup)
Description copied from interface: RollupListener
Called when a rollup's expanded state changed.

Specified by:
expandedChanged in interface RollupListener

buttonPressed

public void buttonPressed(Button button)
Description copied from interface: ButtonPressListener
Called when a button is pressed.

Specified by:
buttonPressed in interface ButtonPressListener