pivot.wtk.skin.terra
Class TerraFormSkin

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

public class TerraFormSkin
extends ContainerSkin
implements FormListener, FormAttributeListener

Form skin.

Author:
gbrown

Nested Class Summary
 
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
TerraFormSkin()
           
 
Method Summary
 void fieldInserted(Form.Section section, int index)
          Called when a form field has been inserted.
 void fieldsRemoved(Form.Section section, int index, Sequence<Component> fields)
          Called when forms fields items have been removed.
 void flagChanged(Form form, Component field, Form.Flag previousFlag)
          Called when a field's flag attribute has changed.
 HorizontalAlignment getFieldAlignment()
           
 int getFlagImageOffset()
           
 int getHorizontalSpacing()
           
 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.
 boolean getRightAlignLabels()
           
 int getVerticalSpacing()
           
 void install(Component component)
          Associates a skin with a component.
 boolean isShowFirstSectionHeading()
           
 void layout()
          If the component on which the skin is installed is a container, lays out the container's children.
 void nameChanged(Form form, Component field, java.lang.String previousName)
          Called when a fields's name attribute has changed.
 void sectionHeadingChanged(Form.Section section)
          Called when a form section's heading has changed.
 void sectionInserted(Form form, int index)
          Called when a form section has been inserted.
 void sectionsRemoved(Form form, int index, Sequence<Form.Section> removed)
          Called when form sections have been removed.
 void setFieldAlignment(HorizontalAlignment fieldAlignment)
           
 void setFieldAlignment(java.lang.String fieldAlignment)
           
 void setFlagImageOffset(int flagImageOffset)
           
 void setFlagImageOffset(java.lang.Number flagImageOffset)
           
 void setHorizontalSpacing(int horizontalSpacing)
           
 void setHorizontalSpacing(java.lang.Number horizontalSpacing)
           
 void setRightAlignLabels(boolean rightAlignLabels)
           
 void setShowFirstSectionHeading(boolean showFirstSectionHeading)
           
 void setVerticalSpacing(int verticalSpacing)
           
 void setVerticalSpacing(java.lang.Number verticalSpacing)
           
 void uninstall()
          Dissociates a skin from a component.
 
Methods inherited from class pivot.wtk.skin.ContainerSkin
componentInserted, componentsRemoved, contextKeyChanged, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, paint, setBackgroundColor, setBackgroundColor, setBackgroundPaint
 
Methods inherited from class pivot.wtk.skin.ComponentSkin
cursorChanged, decodeColor, displayableChanged, enabledChanged, focusedChanged, getComponent, getHeight, 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

TerraFormSkin

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

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

getRightAlignLabels

public boolean getRightAlignLabels()

setRightAlignLabels

public void setRightAlignLabels(boolean rightAlignLabels)

getFieldAlignment

public HorizontalAlignment getFieldAlignment()

setFieldAlignment

public void setFieldAlignment(HorizontalAlignment fieldAlignment)

setFieldAlignment

public final void setFieldAlignment(java.lang.String fieldAlignment)

getHorizontalSpacing

public int getHorizontalSpacing()

setHorizontalSpacing

public void setHorizontalSpacing(int horizontalSpacing)

setHorizontalSpacing

public final void setHorizontalSpacing(java.lang.Number horizontalSpacing)

getVerticalSpacing

public int getVerticalSpacing()

setVerticalSpacing

public void setVerticalSpacing(int verticalSpacing)

setVerticalSpacing

public final void setVerticalSpacing(java.lang.Number verticalSpacing)

getFlagImageOffset

public int getFlagImageOffset()

setFlagImageOffset

public void setFlagImageOffset(int flagImageOffset)

setFlagImageOffset

public final void setFlagImageOffset(java.lang.Number flagImageOffset)

isShowFirstSectionHeading

public boolean isShowFirstSectionHeading()

setShowFirstSectionHeading

public void setShowFirstSectionHeading(boolean showFirstSectionHeading)

sectionInserted

public void sectionInserted(Form form,
                            int index)
Description copied from interface: FormListener
Called when a form section has been inserted.

Specified by:
sectionInserted in interface FormListener

sectionsRemoved

public void sectionsRemoved(Form form,
                            int index,
                            Sequence<Form.Section> removed)
Description copied from interface: FormListener
Called when form sections have been removed.

Specified by:
sectionsRemoved in interface FormListener

sectionHeadingChanged

public void sectionHeadingChanged(Form.Section section)
Description copied from interface: FormListener
Called when a form section's heading has changed.

Specified by:
sectionHeadingChanged in interface FormListener

fieldInserted

public void fieldInserted(Form.Section section,
                          int index)
Description copied from interface: FormListener
Called when a form field has been inserted.

Specified by:
fieldInserted in interface FormListener

fieldsRemoved

public void fieldsRemoved(Form.Section section,
                          int index,
                          Sequence<Component> fields)
Description copied from interface: FormListener
Called when forms fields items have been removed.

Specified by:
fieldsRemoved in interface FormListener

nameChanged

public void nameChanged(Form form,
                        Component field,
                        java.lang.String previousName)
Description copied from interface: FormAttributeListener
Called when a fields's name attribute has changed.

Specified by:
nameChanged in interface FormAttributeListener

flagChanged

public void flagChanged(Form form,
                        Component field,
                        Form.Flag previousFlag)
Description copied from interface: FormAttributeListener
Called when a field's flag attribute has changed.

Specified by:
flagChanged in interface FormAttributeListener