Package org.apache.pivot.wtk.skin.terra
Class TerraExpanderSkin
- java.lang.Object
-
- org.apache.pivot.wtk.skin.ComponentSkin
-
- org.apache.pivot.wtk.skin.ContainerSkin
-
- org.apache.pivot.wtk.skin.ExpanderSkin
-
- org.apache.pivot.wtk.skin.terra.TerraExpanderSkin
-
- All Implemented Interfaces:
ButtonPressListener,ComponentKeyListener,ComponentListener,ComponentMouseButtonListener,ComponentMouseListener,ComponentMouseWheelListener,ComponentStateListener,ComponentTooltipListener,ConstrainedVisual,ContainerListener,ContainerMouseListener,ExpanderListener,Skin,Visual
public class TerraExpanderSkin extends ExpanderSkin implements ButtonPressListener
Terra expander skin.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classTerraExpanderSkin.ButtonImageprotected classTerraExpanderSkin.CollapseImageprotected classTerraExpanderSkin.ExpandImageclassTerraExpanderSkin.ExpandTransitionExpand/collapse transition.classTerraExpanderSkin.ShadeButtonExpander shade button component.classTerraExpanderSkin.ShadeButtonSkinExpander shade button component skin.-
Nested classes/interfaces inherited from class org.apache.pivot.wtk.skin.ContainerSkin
ContainerSkin.IndexFocusTraversalPolicy
-
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ButtonPressListener
ButtonPressListener.Listeners
-
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.ExpanderListener
ExpanderListener.Adapter, ExpanderListener.Listeners
-
-
Constructor Summary
Constructors Constructor Description TerraExpanderSkin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuttonPressed(Button button)Listener for expander button events.voidcollapsibleChanged(Expander expander)Called when an expander's collapsible flag has changed.voidcontentChanged(Expander expander, Component previousContent)Called when an expander's content component has changed.voidenabledChanged(Component component)Called when a component's enabled state has changed.voidexpandedChanged(Expander expander)Called when an expander's expanded state has changed.voidexpandedChangeVetoed(Expander expander, Vote reason)Called when an expanded change event has been vetoed.intgetBaseline(int width, int height)Should be implemented in every subclass.java.awt.ColorgetBorderColor()java.awt.ColorgetDisabledShadeButtonColor()intgetExpandDuration()intgetExpandRate()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.ColorgetShadeButtonColor()java.awt.ColorgetTitleBarBackgroundColor()java.awt.ColorgetTitleBarBorderColor()java.awt.ColorgetTitleBarColor()java.awt.FontgetTitleBarFont()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.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.VotepreviewExpandedChange(Expander expander)Called to preview an expanded change event.voidsetBorderColor(int borderColor)voidsetBorderColor(java.awt.Color borderColor)voidsetBorderColor(java.lang.String borderColor)voidsetDisabledShadeButtonColor(int disabledShadeButtonColor)voidsetDisabledShadeButtonColor(java.awt.Color disabledShadeButtonColor)voidsetDisabledShadeButtonColor(java.lang.String disabledShadeButtonColor)voidsetExpandDuration(int expandDuration)voidsetExpandRate(int expandRate)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)voidsetShadeButtonColor(int shadeButtonColor)voidsetShadeButtonColor(java.awt.Color shadeButtonColor)voidsetShadeButtonColor(java.lang.String shadeButtonColor)voidsetTitleBarBackgroundColor(int titleBarBackgroundColor)voidsetTitleBarBackgroundColor(java.awt.Color titleBarBackgroundColor)voidsetTitleBarBackgroundColor(java.lang.String titleBarBackgroundColor)voidsetTitleBarBorderColor(int titleBarBorderColor)voidsetTitleBarBorderColor(java.awt.Color titleBarBorderColor)voidsetTitleBarBorderColor(java.lang.String titleBarBorderColor)voidsetTitleBarColor(int titleBarColor)voidsetTitleBarColor(java.awt.Color titleBarColor)voidsetTitleBarColor(java.lang.String titleBarColor)voidsetTitleBarFont(java.awt.Font titleBarFont)voidsetTitleBarFont(java.lang.String titleBarFont)voidsetTitleBarFont(Dictionary<java.lang.String,?> titleBarFont)voidtitleChanged(Expander expander, java.lang.String previousTitle)Called when an expander's title has changed.-
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, 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 classExpanderSkin- 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.
-
getTitleBarFont
public java.awt.Font getTitleBarFont()
-
setTitleBarFont
public void setTitleBarFont(java.awt.Font titleBarFont)
-
setTitleBarFont
public final void setTitleBarFont(java.lang.String titleBarFont)
-
setTitleBarFont
public final void setTitleBarFont(Dictionary<java.lang.String,?> titleBarFont)
-
getTitleBarColor
public java.awt.Color getTitleBarColor()
-
setTitleBarColor
public void setTitleBarColor(java.awt.Color titleBarColor)
-
setTitleBarColor
public final void setTitleBarColor(java.lang.String titleBarColor)
-
setTitleBarColor
public final void setTitleBarColor(int titleBarColor)
-
getTitleBarBackgroundColor
public java.awt.Color getTitleBarBackgroundColor()
-
setTitleBarBackgroundColor
public void setTitleBarBackgroundColor(java.awt.Color titleBarBackgroundColor)
-
setTitleBarBackgroundColor
public final void setTitleBarBackgroundColor(java.lang.String titleBarBackgroundColor)
-
setTitleBarBackgroundColor
public final void setTitleBarBackgroundColor(int titleBarBackgroundColor)
-
getTitleBarBorderColor
public java.awt.Color getTitleBarBorderColor()
-
setTitleBarBorderColor
public void setTitleBarBorderColor(java.awt.Color titleBarBorderColor)
-
setTitleBarBorderColor
public final void setTitleBarBorderColor(java.lang.String titleBarBorderColor)
-
setTitleBarBorderColor
public final void setTitleBarBorderColor(int titleBarBorderColor)
-
getShadeButtonColor
public java.awt.Color getShadeButtonColor()
-
setShadeButtonColor
public void setShadeButtonColor(java.awt.Color shadeButtonColor)
-
setShadeButtonColor
public final void setShadeButtonColor(java.lang.String shadeButtonColor)
-
setShadeButtonColor
public final void setShadeButtonColor(int shadeButtonColor)
-
getDisabledShadeButtonColor
public java.awt.Color getDisabledShadeButtonColor()
-
setDisabledShadeButtonColor
public void setDisabledShadeButtonColor(java.awt.Color disabledShadeButtonColor)
-
setDisabledShadeButtonColor
public final void setDisabledShadeButtonColor(java.lang.String disabledShadeButtonColor)
-
setDisabledShadeButtonColor
public final void setDisabledShadeButtonColor(int disabledShadeButtonColor)
-
getBorderColor
public java.awt.Color getBorderColor()
-
setBorderColor
public void setBorderColor(java.awt.Color borderColor)
-
setBorderColor
public final void setBorderColor(java.lang.String borderColor)
-
setBorderColor
public final void setBorderColor(int 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(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)
-
getExpandDuration
public int getExpandDuration()
-
setExpandDuration
public void setExpandDuration(int expandDuration)
-
getExpandRate
public int getExpandRate()
-
setExpandRate
public void setExpandRate(int expandRate)
-
buttonPressed
public void buttonPressed(Button button)
Listener for expander button events.- Specified by:
buttonPressedin interfaceButtonPressListener- Parameters:
button- The source of the button event.
-
enabledChanged
public void enabledChanged(Component component)
Called when a component's enabled state has changed.Called both when the component is enabled and when it is disabled. The component's
enabledflag has already been set when this method is called so the new state can be determined by calling theComponent.isEnabled()method.- Specified by:
enabledChangedin interfaceComponentStateListener- Overrides:
enabledChangedin classComponentSkin- Parameters:
component- The component whose enabled state is changing.
-
titleChanged
public void titleChanged(Expander expander, java.lang.String previousTitle)
Called when an expander's title has changed.- Specified by:
titleChangedin interfaceExpanderListener- Overrides:
titleChangedin classExpanderSkin- Parameters:
expander- The expander that has changed.previousTitle- The previous title for the expander.
-
collapsibleChanged
public void collapsibleChanged(Expander expander)
Called when an expander's collapsible flag has changed.- Specified by:
collapsibleChangedin interfaceExpanderListener- Overrides:
collapsibleChangedin classExpanderSkin- Parameters:
expander- The expander that has changed.
-
previewExpandedChange
public Vote previewExpandedChange(Expander expander)
Called to preview an expanded change event.- Specified by:
previewExpandedChangein interfaceExpanderListener- Overrides:
previewExpandedChangein classExpanderSkin- Parameters:
expander- The expander that is about to expand or collapse.- Returns:
- The consensus vote as to whether to allow the change.
-
expandedChangeVetoed
public void expandedChangeVetoed(Expander expander, Vote reason)
Called when an expanded change event has been vetoed.- Specified by:
expandedChangeVetoedin interfaceExpanderListener- Overrides:
expandedChangeVetoedin classExpanderSkin- Parameters:
expander- The expander that is not going to change.reason- The consensus vote that disallowed the change.
-
expandedChanged
public void expandedChanged(Expander expander)
Called when an expander's expanded state has changed.- Specified by:
expandedChangedin interfaceExpanderListener- Overrides:
expandedChangedin classExpanderSkin- Parameters:
expander- The expander that has now expanded or collapsed.
-
contentChanged
public void contentChanged(Expander expander, Component previousContent)
Called when an expander's content component has changed.- Specified by:
contentChangedin interfaceExpanderListener- Overrides:
contentChangedin classExpanderSkin- Parameters:
expander- The expander that has changed content.previousContent- The previous content of the expander.
-
-