Package org.apache.pivot.wtk.skin.terra
Class TerraPushButtonSkin
- java.lang.Object
 - 
- org.apache.pivot.wtk.skin.ComponentSkin
 - 
- org.apache.pivot.wtk.skin.ButtonSkin
 - 
- org.apache.pivot.wtk.skin.PushButtonSkin
 - 
- org.apache.pivot.wtk.skin.terra.TerraPushButtonSkin
 
 
 
 
 
- 
- All Implemented Interfaces:
 ButtonListener,ButtonPressListener,ButtonStateListener,ComponentKeyListener,ComponentListener,ComponentMouseButtonListener,ComponentMouseListener,ComponentMouseWheelListener,ComponentStateListener,ComponentTooltipListener,ConstrainedVisual,Skin,Visual
- Direct Known Subclasses:
 TerraFrameSkin.FrameButtonSkin
public class TerraPushButtonSkin extends PushButtonSkin
Terra push button skin. 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ButtonListener
ButtonListener.Adapter, ButtonListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ButtonPressListener
ButtonPressListener.Listeners 
- 
Nested classes/interfaces inherited from interface org.apache.pivot.wtk.ButtonStateListener
ButtonStateListener.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 
 - 
 
- 
Field Summary
- 
Fields inherited from class org.apache.pivot.wtk.skin.PushButtonSkin
pressed 
- 
Fields inherited from class org.apache.pivot.wtk.skin.ButtonSkin
highlighted 
 - 
 
- 
Constructor Summary
Constructors Constructor Description TerraPushButtonSkin() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.ColorgetBackgroundColor()intgetBaseline(int width, int height)Should be implemented in every subclass.java.awt.ColorgetBorderColor()java.awt.ColorgetColor()java.awt.ColorgetDisabledBackgroundColor()java.awt.ColorgetDisabledBorderColor()java.awt.ColorgetDisabledColor()java.awt.FontgetFont()floatgetMaximumAspectRatio()floatgetMinimumAspectRatio()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.booleanisFocusable()By default, skins are focusable.booleanisOpaque()By default, skins are assumed to be opaque.booleanisToolbar()booleanmouseClick(Component component, Mouse.Button button, int x, int y, int count)Called when a mouse button is clicked over a component.voidmouseOut(Component component)Called when the mouse exits a component.voidpaint(java.awt.Graphics2D graphics)Paints the visual.voidsetBackgroundColor(int backgroundColor)voidsetBackgroundColor(java.awt.Color backgroundColor)voidsetBackgroundColor(java.lang.String backgroundColor)voidsetBorderColor(int borderColor)voidsetBorderColor(java.awt.Color borderColor)voidsetBorderColor(java.lang.String borderColor)voidsetColor(int color)voidsetColor(java.awt.Color color)voidsetColor(java.lang.String color)voidsetDisabledBackgroundColor(int disabledBackgroundColor)voidsetDisabledBackgroundColor(java.awt.Color disabledBackgroundColor)voidsetDisabledBackgroundColor(java.lang.String disabledBackgroundColor)voidsetDisabledBorderColor(int disabledBorderColor)voidsetDisabledBorderColor(java.awt.Color disabledBorderColor)voidsetDisabledBorderColor(java.lang.String disabledBorderColor)voidsetDisabledColor(int disabledColor)voidsetDisabledColor(java.awt.Color disabledColor)voidsetDisabledColor(java.lang.String disabledColor)voidsetFont(java.awt.Font font)voidsetFont(java.lang.String font)voidsetFont(Dictionary<java.lang.String,?> font)voidsetMaximumAspectRatio(float maximumAspectRatio)voidsetMaximumAspectRatio(java.lang.Number maximumAspectRatio)voidsetMinimumAspectRatio(float minimumAspectRatio)voidsetMinimumAspectRatio(java.lang.Number minimumAspectRatio)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)voidsetToolbar(boolean toolbar)- 
Methods inherited from class org.apache.pivot.wtk.skin.PushButtonSkin
enabledChanged, focusedChanged, keyPressed, keyReleased, mouseDown, mouseUp 
- 
Methods inherited from class org.apache.pivot.wtk.skin.ButtonSkin
actionChanged, buttonDataChanged, buttonGroupChanged, buttonPressed, dataRendererChanged, install, layout, mouseOver, stateChanged, toggleButtonChanged, triStateChanged 
- 
Methods inherited from class org.apache.pivot.wtk.skin.ComponentSkin
colorFromObject, colorFromObject, colorFromObject, colorFromObject, currentTheme, cursorChanged, decodeFont, defaultBackgroundColor, defaultForegroundColor, dragSourceChanged, dropTargetChanged, fontFromObject, getBaseline, getColor, getComponent, getFocusRectangleStroke, getHeight, getSize, getTextInputMethodListener, getThemeFont, getWidth, heightLimitsChanged, invalidateComponent, keyTyped, locationChanged, menuHandlerChanged, mouseMove, 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
- 
getPreferredWidth
public int getPreferredWidth(int height)
Description copied from interface:ConstrainedVisualReturns the visual's preferred width given the provided height constraint.- 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.- 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. 
 
- 
paint
public void paint(java.awt.Graphics2D graphics)
Description copied from interface:VisualPaints the visual.- Parameters:
 graphics- The graphics context in which to paint the visual.
 
- 
isFocusable
public boolean isFocusable()
Description copied from class:ComponentSkinBy default, skins are focusable.- Specified by:
 isFocusablein interfaceSkin- Overrides:
 isFocusablein classComponentSkin- Returns:
 trueif this skin is focusable;false, otherwise.
 
- 
isOpaque
public boolean isOpaque()
Description copied from class:ComponentSkinBy default, skins are assumed to be opaque.- Specified by:
 isOpaquein interfaceSkin- Overrides:
 isOpaquein classComponentSkin- Returns:
 trueif this skin is opaque;falseif any part of it is transparent or translucent.
 
- 
getFont
public java.awt.Font getFont()
 
- 
setFont
public void setFont(java.awt.Font font)
 
- 
setFont
public final void setFont(java.lang.String font)
 
- 
setFont
public final void setFont(Dictionary<java.lang.String,?> font)
 
- 
getColor
public java.awt.Color getColor()
 
- 
setColor
public void setColor(java.awt.Color color)
 
- 
setColor
public final void setColor(java.lang.String color)
 
- 
setColor
public final void setColor(int color)
 
- 
getDisabledColor
public java.awt.Color getDisabledColor()
 
- 
setDisabledColor
public void setDisabledColor(java.awt.Color disabledColor)
 
- 
setDisabledColor
public final void setDisabledColor(java.lang.String disabledColor)
 
- 
setDisabledColor
public final void setDisabledColor(int disabledColor)
 
- 
getBackgroundColor
public java.awt.Color getBackgroundColor()
 
- 
setBackgroundColor
public void setBackgroundColor(java.awt.Color backgroundColor)
 
- 
setBackgroundColor
public final void setBackgroundColor(java.lang.String backgroundColor)
 
- 
setBackgroundColor
public final void setBackgroundColor(int backgroundColor)
 
- 
getDisabledBackgroundColor
public java.awt.Color getDisabledBackgroundColor()
 
- 
setDisabledBackgroundColor
public void setDisabledBackgroundColor(java.awt.Color disabledBackgroundColor)
 
- 
setDisabledBackgroundColor
public final void setDisabledBackgroundColor(java.lang.String disabledBackgroundColor)
 
- 
setDisabledBackgroundColor
public final void setDisabledBackgroundColor(int disabledBackgroundColor)
 
- 
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)
 
- 
getDisabledBorderColor
public java.awt.Color getDisabledBorderColor()
 
- 
setDisabledBorderColor
public void setDisabledBorderColor(java.awt.Color disabledBorderColor)
 
- 
setDisabledBorderColor
public final void setDisabledBorderColor(java.lang.String disabledBorderColor)
 
- 
setDisabledBorderColor
public final void setDisabledBorderColor(int disabledBorderColor)
 
- 
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)
 
- 
getMinimumAspectRatio
public float getMinimumAspectRatio()
 
- 
setMinimumAspectRatio
public void setMinimumAspectRatio(float minimumAspectRatio)
 
- 
setMinimumAspectRatio
public final void setMinimumAspectRatio(java.lang.Number minimumAspectRatio)
 
- 
getMaximumAspectRatio
public float getMaximumAspectRatio()
 
- 
setMaximumAspectRatio
public void setMaximumAspectRatio(float maximumAspectRatio)
 
- 
setMaximumAspectRatio
public final void setMaximumAspectRatio(java.lang.Number maximumAspectRatio)
 
- 
isToolbar
public boolean isToolbar()
 
- 
setToolbar
public void setToolbar(boolean toolbar)
 
- 
mouseOut
public void mouseOut(Component component)
Description copied from interface:ComponentMouseListenerCalled when the mouse exits a component.Default is to do nothing.
- Specified by:
 mouseOutin interfaceComponentMouseListener- Overrides:
 mouseOutin classPushButtonSkin- Parameters:
 component- Component that has now lost the mouse pointer.
 
- 
mouseClick
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count)
Description copied from interface:ComponentMouseButtonListenerCalled when a mouse button is clicked over a component.- Specified by:
 mouseClickin interfaceComponentMouseButtonListener- Overrides:
 mouseClickin classPushButtonSkin- Parameters:
 component- Component user the mouse pointer.button- Which mouse button was clicked.x- X position of the mouse.y- Y position of the mouse.count- Number of clicks (1 = single click, 2 = double click, etc.).- Returns:
 trueto consume the event;falseto allow it to propagate (default).
 
 - 
 
 -