pivot.wtk.skin.terra
Class TerraSheetSkin

java.lang.Object
  extended by pivot.wtk.skin.ComponentSkin
      extended by pivot.wtk.skin.ContainerSkin
          extended by pivot.wtk.skin.WindowSkin
              extended by pivot.wtk.skin.terra.TerraSheetSkin
All Implemented Interfaces:
ComponentKeyListener, ComponentLayoutListener, ComponentListener, ComponentMouseButtonListener, ComponentMouseListener, ComponentMouseWheelListener, ComponentStateListener, ConstrainedVisual, ContainerListener, SheetCloseListener, SheetStateListener, Skin, Visual, WindowListener, WindowStateListener
Direct Known Subclasses:
TerraPromptSkin

public class TerraSheetSkin
extends WindowSkin
implements SheetStateListener

Sheet skin class.

TODO Wire up the "resizable" flag. It current exists but does nothing.

Author:
gbrown, tvolkert

Nested Class Summary
 
Nested classes/interfaces inherited from class pivot.wtk.skin.WindowSkin
WindowSkin.WindowFocusTraversalPolicy
 
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
TerraSheetSkin()
           
 
Method Summary
 java.awt.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.
 void install(Component component)
          Associates a skin with a component.
 boolean isResizable()
           
 boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation)
          Called when a key has been pressed.
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void paint(java.awt.Graphics2D graphics)
          Paints the visual.
 Vote previewSheetClose(Sheet sheet, boolean result)
          Called to preview a sheet close event.
 void setBackgroundColor(java.awt.Color backgroundColor)
           
 void setBorderColor(java.awt.Color borderColor)
           
 void setBorderColor(java.lang.String borderColor)
           
 void setPadding(Dictionary<java.lang.String,?> padding)
           
 void setPadding(Insets padding)
           
 void setPadding(int padding)
           
 void setPadding(java.lang.Number padding)
           
 void setResizable(boolean resizable)
           
 void sheetClosed(Sheet sheet)
          Called when a sheet has closed.
 void sheetCloseVetoed(Sheet sheet, Vote reason)
          Called when a sheet close event has been vetoed.
 void uninstall()
          Dissociates a skin from a component.
 void windowOpened(Window window)
          Called when a window has opened.
 
Methods inherited from class pivot.wtk.skin.WindowSkin
activeChanged, contentChanged, iconChanged, keyReleased, maximizedChanged, ownerChanged, previewWindowClose, previewWindowOpen, titleChanged, windowClosed, windowCloseVetoed, windowMoved, windowOpenVetoed
 
Methods inherited from class pivot.wtk.skin.ContainerSkin
componentInserted, componentsRemoved, contextKeyChanged, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, setBackgroundColor, setBackgroundPaint
 
Methods inherited from class pivot.wtk.skin.ComponentSkin
cursorChanged, decodeColor, displayableChanged, enabledChanged, focusedChanged, getComponent, getHeight, getWidth, invalidateComponent, 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

TerraSheetSkin

public TerraSheetSkin()
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 WindowSkin
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 WindowSkin

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

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
Overrides:
layout in class WindowSkin

paint

public void paint(java.awt.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.

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.

setBackgroundColor

public void setBackgroundColor(java.awt.Color backgroundColor)
Overrides:
setBackgroundColor in class ContainerSkin

getBorderColor

public java.awt.Color getBorderColor()

setBorderColor

public void setBorderColor(java.awt.Color borderColor)

setBorderColor

public final void setBorderColor(java.lang.String borderColor)

getPadding

public Insets getPadding()

setPadding

public void setPadding(Insets padding)

setPadding

public final void setPadding(Dictionary<java.lang.String,?> padding)

setPadding

public final void setPadding(int padding)

setPadding

public final void setPadding(java.lang.Number padding)

isResizable

public boolean isResizable()

setResizable

public void setResizable(boolean resizable)

windowOpened

public void windowOpened(Window window)
Description copied from interface: WindowStateListener
Called when a window has opened.

Specified by:
windowOpened in interface WindowStateListener
Overrides:
windowOpened in class WindowSkin

previewSheetClose

public Vote previewSheetClose(Sheet sheet,
                              boolean result)
Description copied from interface: SheetStateListener
Called to preview a sheet close event.

Specified by:
previewSheetClose in interface SheetStateListener

sheetCloseVetoed

public void sheetCloseVetoed(Sheet sheet,
                             Vote reason)
Description copied from interface: SheetStateListener
Called when a sheet close event has been vetoed.

Specified by:
sheetCloseVetoed in interface SheetStateListener

sheetClosed

public void sheetClosed(Sheet sheet)
Description copied from interface: SheetCloseListener
Called when a sheet has closed.

Specified by:
sheetClosed in interface SheetCloseListener