pivot.wtk.skin.terra
Class TerraExpanderSkin

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

public class TerraExpanderSkin
extends ContainerSkin
implements ButtonPressListener, ExpanderListener

Expander skin.

Author:
gbrown

Nested Class Summary
protected  class TerraExpanderSkin.ButtonImage
           
protected  class TerraExpanderSkin.CollapseImage
           
protected  class TerraExpanderSkin.ExpandImage
           
 class TerraExpanderSkin.ExpandTransition
           
 class TerraExpanderSkin.ShadeButton
          Expander shade button component.
 class TerraExpanderSkin.ShadeButtonSkin
          Expander shade button component skin.
 
Nested classes/interfaces inherited from class pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
 
Nested classes/interfaces inherited from interface pivot.wtk.ExpanderListener
ExpanderListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentListener
ComponentListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter
 
Nested classes/interfaces inherited from interface pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter
 
Field Summary
 
Fields inherited from class pivot.wtk.skin.ComponentSkin
SHOW_TOOLTIP_TIMEOUT
 
Constructor Summary
TerraExpanderSkin()
           
 
Method Summary
 void buttonPressed(Button button)
          Listener for expander button events.
 void contentChanged(Expander expander, Component previousContent)
          Called when an expander's content component has changed.
 void expandedChanged(Expander expander)
          Called when an expander's expanded state has changed.
 void expandedChangeVetoed(Expander expander, Vote reason)
          Called when an expanded change event has been vetoed.
 Color getBorderColor()
           
 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.
 Color getShadeButtonBackgroundColor()
           
 Color getShadeButtonColor()
           
 Color getTitleBarBackgroundColor()
           
 Color getTitleBarBorderColor()
           
 Color getTitleBarColor()
           
 Font getTitleBarFont()
           
 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.
 void paint(Graphics2D graphics)
          Paints the visual.
 Vote previewExpandedChange(Expander expander)
          Called to preview an expanded change event.
 void setBorderColor(Color borderColor)
           
 void setBorderColor(String borderColor)
           
 void setPadding(Dictionary<String,?> padding)
           
 void setPadding(Insets padding)
           
 void setPadding(int padding)
           
 void setPadding(Number padding)
           
 void setShadeButtonBackgroundColor(Color shadeButtonBackgroundColor)
           
 void setShadeButtonBackgroundColor(String shadeButtonBackgroundColor)
           
 void setShadeButtonColor(Color shadeButtonColor)
           
 void setShadeButtonColor(String shadeButtonColor)
           
 void setSize(int width, int height)
          Sets the visual's render size.
 void setTitleBarBackgroundColor(Color titleBarBackgroundColor)
           
 void setTitleBarBackgroundColor(String titleBarBackgroundColor)
           
 void setTitleBarBorderColor(Color titleBarBorderColor)
           
 void setTitleBarBorderColor(String titleBarBorderColor)
           
 void setTitleBarColor(Color titleBarColor)
           
 void setTitleBarColor(String titleBarColor)
           
 void setTitleBarFont(Font titleBarFont)
           
 void setTitleBarFont(String titleBarFont)
           
 void titleChanged(Expander expander, String previousTitle)
          Called when an expander's title has changed.
 void uninstall()
          Dissociates a skin from a component.
 
Methods inherited from class pivot.wtk.skin.ContainerSkin
componentInserted, componentsRemoved, contextKeyChanged, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint
 
Methods inherited from class pivot.wtk.skin.ComponentSkin
cursorChanged, displayableChanged, enabledChanged, focusedChanged, getComponent, getHeight, getWidth, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, parentChanged, preferredSizeChanged, 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
 

Constructor Detail

TerraExpanderSkin

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

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.

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

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.

getTitleBarFont

public Font getTitleBarFont()

setTitleBarFont

public void setTitleBarFont(Font titleBarFont)

setTitleBarFont

public final void setTitleBarFont(String titleBarFont)

getTitleBarColor

public Color getTitleBarColor()

setTitleBarColor

public void setTitleBarColor(Color titleBarColor)

setTitleBarColor

public final void setTitleBarColor(String titleBarColor)

getTitleBarBackgroundColor

public Color getTitleBarBackgroundColor()

setTitleBarBackgroundColor

public void setTitleBarBackgroundColor(Color titleBarBackgroundColor)

setTitleBarBackgroundColor

public final void setTitleBarBackgroundColor(String titleBarBackgroundColor)

getTitleBarBorderColor

public Color getTitleBarBorderColor()

setTitleBarBorderColor

public void setTitleBarBorderColor(Color titleBarBorderColor)

setTitleBarBorderColor

public final void setTitleBarBorderColor(String titleBarBorderColor)

getShadeButtonColor

public Color getShadeButtonColor()

setShadeButtonColor

public void setShadeButtonColor(Color shadeButtonColor)

setShadeButtonColor

public final void setShadeButtonColor(String shadeButtonColor)

getShadeButtonBackgroundColor

public Color getShadeButtonBackgroundColor()

setShadeButtonBackgroundColor

public void setShadeButtonBackgroundColor(Color shadeButtonBackgroundColor)

setShadeButtonBackgroundColor

public final void setShadeButtonBackgroundColor(String shadeButtonBackgroundColor)

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)

buttonPressed

public void buttonPressed(Button button)
Listener for expander button events.

Specified by:
buttonPressed in interface ButtonPressListener
Parameters:
button - The source of the button event.

titleChanged

public void titleChanged(Expander expander,
                         String previousTitle)
Description copied from interface: ExpanderListener
Called when an expander's title has changed.

Specified by:
titleChanged in interface ExpanderListener

previewExpandedChange

public Vote previewExpandedChange(Expander expander)
Description copied from interface: ExpanderListener
Called to preview an expanded change event.

Specified by:
previewExpandedChange in interface ExpanderListener

expandedChangeVetoed

public void expandedChangeVetoed(Expander expander,
                                 Vote reason)
Description copied from interface: ExpanderListener
Called when an expanded change event has been vetoed.

Specified by:
expandedChangeVetoed in interface ExpanderListener

expandedChanged

public void expandedChanged(Expander expander)
Description copied from interface: ExpanderListener
Called when an expander's expanded state has changed.

Specified by:
expandedChanged in interface ExpanderListener

contentChanged

public void contentChanged(Expander expander,
                           Component previousContent)
Description copied from interface: ExpanderListener
Called when an expander's content component has changed.

Specified by:
contentChanged in interface ExpanderListener