Package org.apache.pivot.wtk.skin.terra
Class TerraTabPaneSkin.TabButtonSkin
- java.lang.Object
-
- org.apache.pivot.wtk.skin.ComponentSkin
-
- org.apache.pivot.wtk.skin.ButtonSkin
-
- org.apache.pivot.wtk.skin.terra.TerraTabPaneSkin.TabButtonSkin
-
- All Implemented Interfaces:
ButtonListener,ButtonPressListener,ButtonStateListener,ComponentKeyListener,ComponentListener,ComponentMouseButtonListener,ComponentMouseListener,ComponentMouseWheelListener,ComponentStateListener,ComponentTooltipListener,ConstrainedVisual,Skin,Visual
- Enclosing class:
- TerraTabPaneSkin
public class TerraTabPaneSkin.TabButtonSkin extends ButtonSkin
Tab button skin.Note that this class does not respect preferred size constraints, because it will never be called to use them.
-
-
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.ButtonSkin
highlighted
-
-
Constructor Summary
Constructors Constructor Description TabButtonSkin()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBaseline(int width, int height)Should be implemented in every subclass.BoundsgetCloseTriggerBounds()java.awt.ColorgetColor()java.awt.ColorgetDisabledColor()java.awt.FontgetFont()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.booleanmouseClick(Component component, Mouse.Button button, int x, int y, int count)Called when a mouse button is clicked over a component.voidpaint(java.awt.Graphics2D graphics)Paints the visual.voidstateChanged(Button button, Button.State previousState)Called when a button's state has changed.-
Methods inherited from class org.apache.pivot.wtk.skin.ButtonSkin
actionChanged, buttonDataChanged, buttonGroupChanged, buttonPressed, dataRendererChanged, enabledChanged, focusedChanged, install, layout, mouseOut, mouseOver, 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, isOpaque, keyPressed, keyReleased, keyTyped, locationChanged, menuHandlerChanged, mouseDown, mouseMove, 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
-
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.
-
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 classComponentSkin- 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).
-
getFont
public java.awt.Font getFont()
-
getColor
public java.awt.Color getColor()
-
getDisabledColor
public java.awt.Color getDisabledColor()
-
stateChanged
public void stateChanged(Button button, Button.State previousState)
Description copied from interface:ButtonStateListenerCalled when a button's state has changed.- Specified by:
stateChangedin interfaceButtonStateListener- Overrides:
stateChangedin classButtonSkin- Parameters:
button- The button whose state changed.previousState- The previous state of the button.
-
getCloseTriggerBounds
public Bounds getCloseTriggerBounds()
-
-