Package org.apache.pivot.wtk.skin.terra
Class TerraFormSkin
- java.lang.Object
 - 
- org.apache.pivot.wtk.skin.ComponentSkin
 - 
- org.apache.pivot.wtk.skin.ContainerSkin
 - 
- org.apache.pivot.wtk.skin.terra.TerraFormSkin
 
 
 
 
- 
- All Implemented Interfaces:
 ComponentKeyListener,ComponentListener,ComponentMouseButtonListener,ComponentMouseListener,ComponentMouseWheelListener,ComponentStateListener,ComponentTooltipListener,ConstrainedVisual,ContainerListener,ContainerMouseListener,FormAttributeListener,FormListener,Skin,Visual
public class TerraFormSkin extends ContainerSkin implements FormListener, FormAttributeListener
Terra form skin.TODO Animate preferred size calculations when flags change (make this configurable via a style flag)
 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentKeyListener
ComponentKeyListener.Adapter, ComponentKeyListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentListener
ComponentListener.Adapter, ComponentListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseButtonListener
ComponentMouseButtonListener.Adapter, ComponentMouseButtonListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseListener
ComponentMouseListener.Adapter, ComponentMouseListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentMouseWheelListener
ComponentMouseWheelListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentStateListener
ComponentStateListener.Adapter, ComponentStateListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ComponentTooltipListener
ComponentTooltipListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerListener
ContainerListener.Adapter, ContainerListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ContainerMouseListener
ContainerMouseListener.Adapter, ContainerMouseListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.FormAttributeListener
FormAttributeListener.Adapter, FormAttributeListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.FormListener
FormListener.Adapter, FormListener.Listeners 
 - 
 
- 
Constructor Summary
Constructors Constructor Description TerraFormSkin() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfieldInserted(Form.Section section, int index)Called when a form field has been inserted.voidfieldsRemoved(Form.Section section, int index, Sequence<Component> fields)Called when form fields have been removed.voidflagChanged(Form form, Component field, Form.Flag previousFlag)Called when a field's flag attribute has changed.intgetBaseline(int width, int height)Should be implemented in every subclass.java.lang.StringgetDelimiter()booleangetFill()intgetFlagIconOffset()intgetHorizontalSpacing()java.awt.FontgetLabelFont()booleangetLeftAlignLabels()java.awt.FontgetMessageFont()InsetsgetPadding()intgetPreferredHeight(int width)Returns the visual's preferred height given the provided width constraint.DimensionsgetPreferredSize()Returns the visual's unconstrained preferred size.intgetPreferredWidth(int height)Returns the visual's preferred width given the provided height constraint.java.awt.ColorgetSeparatorColor()java.awt.ColorgetSeparatorHeadingColor()booleangetShowFlagHighlight()booleangetShowFlagIcons()booleangetShowFlagMessagesInline()intgetVerticalSpacing()voidinstall(Component component)Must be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.voidlabelChanged(Form form, Component field, java.lang.String previousLabel)Called when a field's label attribute has changed.voidlayout()If the component on which the skin is installed is a container, lays out the container's children.voidpaint(java.awt.Graphics2D graphics)Paints the visual.voidrequiredChanged(Form form, Component field)Called when a fields's required attribute has changed.voidsectionHeadingChanged(Form.Section section)Called when a form section's heading has changed.voidsectionInserted(Form form, int index)Called when a form section has been inserted.voidsectionsRemoved(Form form, int index, Sequence<Form.Section> removed)Called when form sections have been removed.voidsetDelimiter(java.lang.String delimiter)voidsetFill(boolean fill)voidsetFlagIconOffset(int flagIconOffset)voidsetFlagIconOffset(java.lang.Number flagIconOffset)voidsetHorizontalSpacing(int horizontalSpacing)voidsetHorizontalSpacing(java.lang.Number horizontalSpacing)voidsetLabelFont(java.awt.Font font)voidsetLabelFont(java.lang.String fontString)voidsetLabelFont(Dictionary<java.lang.String,?> fontDict)voidsetLeftAlignLabels(boolean leftAlignLabels)voidsetMessageFont(java.awt.Font font)voidsetMessageFont(java.lang.String fontString)voidsetMessageFont(Dictionary<java.lang.String,?> fontDict)voidsetPadding(int padding)voidsetPadding(java.lang.Number padding)voidsetPadding(java.lang.String padding)voidsetPadding(Dictionary<java.lang.String,?> padding)voidsetPadding(Sequence<?> padding)voidsetPadding(Insets padding)voidsetSeparatorColor(java.awt.Color separatorColor)voidsetSeparatorColor(java.lang.String separatorColor)voidsetSeparatorHeadingColor(java.awt.Color separatorHeadingColor)voidsetSeparatorHeadingColor(java.lang.String separatorHeadingColor)voidsetShowFlagHighlight(boolean showFlagHighlight)voidsetShowFlagIcons(boolean showFlagIcons)voidsetShowFlagMessagesInline(boolean showFlagMessagesInline)voidsetVerticalSpacing(int verticalSpacing)voidsetVerticalSpacing(java.lang.Number verticalSpacing)- 
Methods inherited from class org.apache.pivot.wtk.skin.ContainerSkin
componentInserted, componentMoved, componentsRemoved, focusTraversalPolicyChanged, getBackgroundColor, getBackgroundPaint, isFocusable, isOpaque, mouseDown, mouseMove, mouseUp, mouseWheel, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundPaint, setBackgroundPaint, setBackgroundPaint 
- 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
colorFromObject, colorFromObject, colorFromObject, colorFromObject, currentTheme, cursorChanged, decodeFont, defaultBackgroundColor, defaultForegroundColor, dragSourceChanged, dropTargetChanged, enabledChanged, focusedChanged, fontFromObject, getBaseline, getColor, getComponent, getFocusRectangleStroke, getHeight, getSize, getTextInputMethodListener, getThemeFont, getWidth, heightLimitsChanged, invalidateComponent, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, nameChanged, parentChanged, preferredSizeChanged, repaintComponent, repaintComponent, repaintComponent, repaintComponent, repaintComponent, setDefaultStyles, setSize, sizeChanged, themeHasThickFocusRectangle, themeHasTransitionEnabled, themeIsDark, themeIsFlat, tooltipDelayChanged, tooltipTextChanged, tooltipTriggered, visibleChanged, widthLimitsChanged 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
setSize 
 - 
 
 - 
 
- 
- 
Method Detail
- 
install
public void install(Component component)
Description copied from class:ComponentSkinMust be implemented in every subclass in order to do component-specific operations at instantiation time, but every subclass must call this superclass method to setup the necessary listeners, etc.- Specified by:
 installin interfaceSkin- Overrides:
 installin classContainerSkin- Parameters:
 component- The component to which the skin is being attached.
 
- 
getPreferredWidth
public int getPreferredWidth(int height)
Description copied from interface:ConstrainedVisualReturns the visual's preferred width given the provided height constraint.- Specified by:
 getPreferredWidthin interfaceConstrainedVisual- Overrides:
 getPreferredWidthin classContainerSkin- Parameters:
 height- The height by which to constrain the preferred width, or-1for no constraint.- Returns:
 - The preferred width given the height constraint.
 
 
- 
getPreferredHeight
public int getPreferredHeight(int width)
Description copied from interface:ConstrainedVisualReturns the visual's preferred height given the provided width constraint.- Specified by:
 getPreferredHeightin interfaceConstrainedVisual- Overrides:
 getPreferredHeightin classContainerSkin- Parameters:
 width- The width by which to constrain the preferred height, or-1for no constraint.- Returns:
 - The preferred height given the width constraint.
 
 
- 
getPreferredSize
public Dimensions getPreferredSize()
Description copied from interface:ConstrainedVisualReturns the visual's unconstrained preferred size.- Specified by:
 getPreferredSizein interfaceConstrainedVisual- Overrides:
 getPreferredSizein classComponentSkin- Returns:
 - The preferred size (width and height) of this component.
 
Depending on the component this can be a static value or derived (as for a container) from its subcomponents, etc.
The default implementation simply calls
ConstrainedVisual.getPreferredWidth(int)andConstrainedVisual.getPreferredHeight(int). 
 
- 
getBaseline
public int getBaseline(int width, int height)Description copied from class:ComponentSkinShould be implemented in every subclass.The default implementation here simply returns -1 (no baseline).
- Specified by:
 getBaselinein interfaceConstrainedVisual- Overrides:
 getBaselinein classComponentSkin- Parameters:
 width- Constrained width to compute the baseline for.height- Constrained height to compute the baseline for.- Returns:
 - The baseline relative to the origin of this visual, or 
-1if this visual does not have a baseline. 
 
- 
layout
public void layout()
Description copied from interface:SkinIf the component on which the skin is installed is a container, lays out the container's children. 
- 
paint
public void paint(java.awt.Graphics2D graphics)
Description copied from interface:VisualPaints the visual.- Specified by:
 paintin interfaceVisual- Overrides:
 paintin classContainerSkin- Parameters:
 graphics- The graphics context in which to paint the visual.
 
- 
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(Sequence<?> padding)
 
- 
setPadding
public final void setPadding(int padding)
 
- 
setPadding
public final void setPadding(java.lang.Number padding)
 
- 
setPadding
public final void setPadding(java.lang.String padding)
 
- 
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)
 
- 
getFlagIconOffset
public int getFlagIconOffset()
 
- 
setFlagIconOffset
public void setFlagIconOffset(int flagIconOffset)
 
- 
setFlagIconOffset
public final void setFlagIconOffset(java.lang.Number flagIconOffset)
 
- 
getFill
public boolean getFill()
 
- 
setFill
public void setFill(boolean fill)
 
- 
getShowFlagIcons
public boolean getShowFlagIcons()
 
- 
setShowFlagIcons
public void setShowFlagIcons(boolean showFlagIcons)
 
- 
getShowFlagHighlight
public boolean getShowFlagHighlight()
 
- 
setShowFlagHighlight
public void setShowFlagHighlight(boolean showFlagHighlight)
 
- 
getShowFlagMessagesInline
public boolean getShowFlagMessagesInline()
 
- 
setShowFlagMessagesInline
public void setShowFlagMessagesInline(boolean showFlagMessagesInline)
 
- 
getLeftAlignLabels
public boolean getLeftAlignLabels()
 
- 
setLeftAlignLabels
public void setLeftAlignLabels(boolean leftAlignLabels)
 
- 
getDelimiter
public java.lang.String getDelimiter()
 
- 
setDelimiter
public void setDelimiter(java.lang.String delimiter)
 
- 
getSeparatorColor
public java.awt.Color getSeparatorColor()
 
- 
setSeparatorColor
public void setSeparatorColor(java.awt.Color separatorColor)
 
- 
setSeparatorColor
public final void setSeparatorColor(java.lang.String separatorColor)
 
- 
getSeparatorHeadingColor
public java.awt.Color getSeparatorHeadingColor()
 
- 
setSeparatorHeadingColor
public void setSeparatorHeadingColor(java.awt.Color separatorHeadingColor)
 
- 
setSeparatorHeadingColor
public final void setSeparatorHeadingColor(java.lang.String separatorHeadingColor)
 
- 
getLabelFont
public final java.awt.Font getLabelFont()
 
- 
setLabelFont
public final void setLabelFont(java.awt.Font font)
 
- 
setLabelFont
public final void setLabelFont(java.lang.String fontString)
 
- 
setLabelFont
public final void setLabelFont(Dictionary<java.lang.String,?> fontDict)
 
- 
getMessageFont
public final java.awt.Font getMessageFont()
 
- 
setMessageFont
public final void setMessageFont(java.awt.Font font)
 
- 
setMessageFont
public final void setMessageFont(java.lang.String fontString)
 
- 
setMessageFont
public final void setMessageFont(Dictionary<java.lang.String,?> fontDict)
 
- 
sectionInserted
public void sectionInserted(Form form, int index)
Description copied from interface:FormListenerCalled when a form section has been inserted.- Specified by:
 sectionInsertedin interfaceFormListener- Parameters:
 form- The form that has changed.index- The index where the new section has been inserted.
 
- 
sectionsRemoved
public void sectionsRemoved(Form form, int index, Sequence<Form.Section> removed)
Description copied from interface:FormListenerCalled when form sections have been removed.- Specified by:
 sectionsRemovedin interfaceFormListener- Parameters:
 form- The form that has changed.index- The starting index where sections were removed.removed- The complete sequence of the removed sections.
 
- 
sectionHeadingChanged
public void sectionHeadingChanged(Form.Section section)
Description copied from interface:FormListenerCalled when a form section's heading has changed.- Specified by:
 sectionHeadingChangedin interfaceFormListener- Parameters:
 section- The form section whose heading changed.
 
- 
fieldInserted
public void fieldInserted(Form.Section section, int index)
Description copied from interface:FormListenerCalled when a form field has been inserted.- Specified by:
 fieldInsertedin interfaceFormListener- Parameters:
 section- The enclosing form section that has changed.index- The index where a new field has been inserted.
 
- 
fieldsRemoved
public void fieldsRemoved(Form.Section section, int index, Sequence<Component> fields)
Description copied from interface:FormListenerCalled when form fields have been removed.- Specified by:
 fieldsRemovedin interfaceFormListener- Parameters:
 section- The enclosing form section.index- The starting index where fields were removed.fields- The complete sequence of fields that were removed.
 
- 
labelChanged
public void labelChanged(Form form, Component field, java.lang.String previousLabel)
Description copied from interface:FormAttributeListenerCalled when a field's label attribute has changed.- Specified by:
 labelChangedin interfaceFormAttributeListener- Parameters:
 form- The enclosing form.field- The field whose form label has changed.previousLabel- The previous form label for this field.
 
- 
requiredChanged
public void requiredChanged(Form form, Component field)
Description copied from interface:FormAttributeListenerCalled when a fields's required attribute has changed.- Specified by:
 requiredChangedin interfaceFormAttributeListener- Parameters:
 form- The enclosing form.field- The field that is or is not now required.
 
- 
flagChanged
public void flagChanged(Form form, Component field, Form.Flag previousFlag)
Description copied from interface:FormAttributeListenerCalled when a field's flag attribute has changed.- Specified by:
 flagChangedin interfaceFormAttributeListener- Parameters:
 form- The enclosing form.field- The field whose flag attribute has changed.previousFlag- The previous flag value for this field.
 
 - 
 
 -