org.apache.pivot.wtk.content
Class ListButtonColorItemRenderer

java.lang.Object
  extended by org.apache.pivot.wtk.Component
      extended by org.apache.pivot.wtk.ImageView
          extended by org.apache.pivot.wtk.content.ListButtonColorItemRenderer
All Implemented Interfaces:
Button.DataRenderer, ConstrainedVisual, Renderer, Visual

public class ListButtonColorItemRenderer
extends ImageView
implements Button.DataRenderer

List button renderer for displaying color swatches.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.ImageView
ImageView.ImageBindMapping
 
Nested classes/interfaces inherited from class org.apache.pivot.wtk.Component
Component.DecoratorSequence, Component.StyleDictionary, Component.UserDataDictionary
 
Constructor Summary
ListButtonColorItemRenderer()
           
 
Method Summary
 void render(Object data, Button button, boolean highlighted)
          Prepares the renderer for layout or paint.
 void setSize(int width, int height)
          NOTE This method should only be called during layout.
 String toString(Object data)
          Converts button data to a string representation.
 
Methods inherited from class org.apache.pivot.wtk.ImageView
clear, clearImage, getImage, getImageBindMapping, getImageBindType, getImageKey, getImageViewBindingListeners, getImageViewListeners, isAsynchronous, load, setAsynchronous, setImage, setImage, setImage, setImageBindMapping, setImageBindType, setImageKey, store
 
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, toString, 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

ListButtonColorItemRenderer

public ListButtonColorItemRenderer()
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 data,
                   Button button,
                   boolean highlighted)
Description copied from interface: Button.DataRenderer
Prepares the renderer for layout or paint.

Specified by:
render in interface Button.DataRenderer
Parameters:
data - The data to render, or null if called to calculate preferred height for skins that assume a fixed renderer height.
button - The host component.
highlighted - If true, the item is highlighted.

toString

public String toString(Object data)
Description copied from interface: Button.DataRenderer
Converts button data to a string representation.

Specified by:
toString in interface Button.DataRenderer
Returns:
The data's string representation, or null if the data does not have a string representation.

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