org.apache.pivot.wtk.content
Class SpinnerItemRenderer

java.lang.Object
  extended by org.apache.pivot.wtk.Component
      extended by org.apache.pivot.wtk.Label
          extended by org.apache.pivot.wtk.content.SpinnerItemRenderer
All Implemented Interfaces:
ConstrainedVisual, Renderer, Spinner.ItemRenderer, Visual
Direct Known Subclasses:
TerraCalendarSkin.MonthSpinnerItemRenderer

public class SpinnerItemRenderer
extends Label
implements Spinner.ItemRenderer

Default spinner item renderer, which renders all items as strings by calling toString() on them.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Label
Label.TextBindMapping
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
 
Constructor Summary
SpinnerItemRenderer()
           
 
Method Summary
 void render(Object item, Spinner spinner)
          Prepares the renderer for layout or paint.
protected  void renderStyles(Spinner spinner)
           
 void setSize(int width, int height)
          NOTE This method should only be called during layout.
 String toString(Object item)
          Converts a spinner item to a string representation.
 
Methods inherited from class org.apache.pivot.wtk.Label
clear, getLabelBindingListeners, getLabelListeners, getMaximumLength, getText, getTextBindMapping, getTextBindType, getTextKey, load, setMaximumLength, setText, setTextBindMapping, setTextBindType, setTextKey, setTextOrEmpty, store, toString
 
Methods inherited from class org.apache.pivot.wtk.Component
clearFocus, contains, getAncestor, getAncestor, getAttribute, getAutomationID, getBaseline, getBaseline, getBounds, getComponentClassListeners, getComponentDataListeners, getComponentDecoratorListeners, getComponentKeyListeners, getComponentListeners, getComponentMouseButtonListeners, getComponentMouseListeners, getComponentMouseWheelListeners, getComponentStateListeners, getComponentStyleListeners, getComponentTooltipListeners, getCursor, getDecoratedBounds, getDecorators, getDisplay, getDragSource, getDropTarget, getFocusedComponent, getGraphics, getHeight, getHeightLimits, getLocation, getMaximumHeight, getMaximumWidth, getMenuHandler, getMinimumHeight, getMinimumWidth, getMouseLocation, getName, getNamedStyles, getParent, getPreferredHeight, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreferredWidth, getSize, getSkin, getStyles, getTooltipDelay, getTooltipText, getTooltipWrapText, getTypedStyles, getUserData, getVisibleArea, getVisibleArea, getVisibleArea, getWidth, getWidthLimits, getWindow, getX, getY, indexBoundsCheck, installSkin, invalidate, isBlocked, isEnabled, isFocusable, isFocused, isMouseOver, isOpaque, isPreferredHeightSet, isPreferredSizeSet, isPreferredWidthSet, isShowing, isValid, isVisible, keyPressed, keyReleased, keyTyped, layout, mapPointFromAncestor, mapPointFromAncestor, mapPointToAncestor, mapPointToAncestor, mouseClick, mouseDown, mouseMove, mouseOut, mouseOver, mouseUp, mouseWheel, paint, reenterMouse, repaint, repaint, repaint, repaint, repaint, repaint, requestFocus, scrollAreaToVisible, scrollAreaToVisible, setAttribute, setAutomationID, setCursor, setDragSource, setDropTarget, setEnabled, setFocused, setHeight, setHeightLimits, setHeightLimits, setLocation, setLocation, setMaximumHeight, setMaximumWidth, setMenuHandler, setMinimumHeight, setMinimumWidth, setName, setParent, setPreferredHeight, setPreferredSize, setPreferredSize, setPreferredWidth, setSize, setSkin, setStyleName, setStyleNames, setStyleNames, setStyles, setStyles, setTooltipDelay, setTooltipText, setTooltipWrapText, setVisible, setWidth, setWidthLimits, setWidthLimits, setX, setY, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.pivot.wtk.Renderer
getStyles
 
Methods inherited from interface org.apache.pivot.wtk.ConstrainedVisual
getBaseline, getPreferredHeight, getPreferredSize, getPreferredWidth
 
Methods inherited from interface org.apache.pivot.wtk.Visual
getBaseline, getHeight, getWidth, paint
 

Constructor Detail

SpinnerItemRenderer

public SpinnerItemRenderer()
Method Detail

setSize

public void setSize(int width,
                    int height)
Description copied from class: Component
NOTE This method should only be called during layout. Callers should use Component.setPreferredSize(int, int).

Specified by:
setSize in interface ConstrainedVisual
Overrides:
setSize in class Component

render

public void render(Object item,
                   Spinner spinner)
Description copied from interface: Spinner.ItemRenderer
Prepares the renderer for layout or paint.

Specified by:
render in interface Spinner.ItemRenderer
Parameters:
item - The item to render, or null if called to calculate preferred height for skins that assume a fixed renderer height.
spinner - The host component.

renderStyles

protected void renderStyles(Spinner spinner)

toString

public String toString(Object item)
Description copied from interface: Spinner.ItemRenderer
Converts a spinner item to a string representation.

Specified by:
toString in interface Spinner.ItemRenderer
Returns:
The item's string representation, or null if the item does not have a string representation.

Note that this method may be called often during keyboard navigation, so implementations should avoid unnecessary string allocations.