Java DTV API 1.3
18-Nov-2009

com.sun.dtv.lwuit.list
Class DefaultListCellRenderer

java.lang.Object
  extended by com.sun.dtv.lwuit.Component
      extended by com.sun.dtv.lwuit.Label
          extended by com.sun.dtv.lwuit.list.DefaultListCellRenderer
All Implemented Interfaces:
Animation, StyleListener, ListCellRenderer, Animated, MatteEnabled, ViewOnlyComponent

public class DefaultListCellRenderer
extends Label
implements ListCellRenderer

Default implementation of the renderer based on a label see the ListCellRenderer for more information about the use and purpose of this class.


Field Summary
 
Fields inherited from class com.sun.dtv.lwuit.Component
BOTTOM, BRB_CENTER_OFFSET, BRB_CONSTANT_ASCENT, BRB_CONSTANT_DESCENT, BRB_OTHER, CENTER, LEFT, RIGHT, TOP
 
Fields inherited from interface com.sun.dtv.ui.ViewOnlyComponent
HORIZONTAL_ALIGN_CENTER, HORIZONTAL_ALIGN_JUSTIFIED, HORIZONTAL_ALIGN_LEFT, HORIZONTAL_ALIGN_RIGHT, SCALE_ASPECT_PROOF, SCALE_NO, SCALE_NO_ASPECT_PROOF, STATE_DISABLED, STATE_ENABLED, VERTICAL_ALIGN_BOTTOM, VERTICAL_ALIGN_CENTER, VERTICAL_ALIGN_JUSTIFIED, VERTICAL_ALIGN_TOP
 
Fields inherited from interface com.sun.dtv.ui.Animated
ALTERNATING, LOOP, REPEATING
 
Constructor Summary
DefaultListCellRenderer()
          Creates a new instance of DefaultCellRenderer.
DefaultListCellRenderer(boolean showNumbers)
          Creates a new instance of DefaultCellRenderer.
 
Method Summary
 Component getListCellRendererComponent(List list, Object value, int index, boolean isSelected)
          Returns a component instance that is already set to render "value".
 Component getListFocusComponent(List list)
          Returns a component instance that is painted under the currently focused renderer and is animated to provide smooth scrolling.
 int getSelectionTransparency()
          The background transparency factor to apply to the selection focus.
 boolean isShowNumbers()
          Indicate whether numbering should exist for the default cell renderer.
 void repaint()
          Overriden to do nothing and remove a performance issue where renderer changes perform needless repaint calls.
 void setSelectionTransparency(int selectionTransparency)
          The background transparency factor to apply to the selection focus.
 void setShowNumbers(boolean showNumbers)
          Indicate whether numbering should exist for the default cell renderer.
 
Methods inherited from class com.sun.dtv.lwuit.Label
animate, getAlignment, getAnimateContent, getBaselineResizeBehavior, getGap, getGraphicContent, getHorizontalAlignment, getIcon, getInteractionState, getMatte, getScalingMode, getShiftText, getText, getTextContent, getTextLayoutManager, getTextPosition, getVerticalAlignment, isDoubleBuffered, isEndsWith3Points, isOpaque, isTickerEnabled, isTickerRunning, paint, processEvent, setAlignment, setAnimateContent, setEndsWith3Points, setGap, setGraphicContent, setHorizontalAlignment, setIcon, setInteractionState, setMatte, setScalingMode, setShiftText, setText, setTextContent, setTextLayoutManager, setTextPosition, setTickerEnabled, setVerticalAlignment, startTicker, stopTicker
 
Methods inherited from class com.sun.dtv.lwuit.Component
addFocusListener, calcPreferredSize, contains, deinitialize, getAbsoluteX, getAbsoluteY, getAnimationMode, getBaseline, getBottomGap, getBounds, getClientProperty, getComponentForm, getDelay, getHeight, getNextFocusDown, getNextFocusLeft, getNextFocusRight, getNextFocusUp, getParent, getPosition, getPreferredSize, getRepetitionMode, getScrollAnimationSpeed, getScrollX, getScrollY, getSideGap, getStyle, getUIID, getWidth, getX, getY, handlesInput, hasFocus, initialize, isEnabled, isFocusable, isFocusPainted, isInitialized, isRunning, isScrollableX, isScrollableY, isScrollVisible, isSmoothScrolling, isVisible, jumpTo, keyPressed, keyReleased, keyRepeated, longKeyPress, paintBackgrounds, paintComponent, paintComponent, pointerDragged, pointerPressed, pointerReleased, putClientProperty, refreshTheme, removeFocusListener, repaint, requestFocus, scrollRectToVisible, setAnimationMode, setCellRenderer, setDelay, setEnabled, setFocus, setFocusable, setFocusPainted, setHandlesInput, setHeight, setInitialized, setIsScrollVisible, setNextFocusDown, setNextFocusLeft, setNextFocusRight, setNextFocusUp, setPreferredSize, setRepetitionMode, setScrollAnimationSpeed, setScrollX, setScrollY, setShouldCalcPreferredSize, setSize, setSmoothScrolling, setStyle, setUIID, setVisible, setWidth, setX, setY, start, stop, styleChanged, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultListCellRenderer

public DefaultListCellRenderer()
Creates a new instance of DefaultCellRenderer.


DefaultListCellRenderer

public DefaultListCellRenderer(boolean showNumbers)
Creates a new instance of DefaultCellRenderer.

Parameters:
showNumbers - indicates whether numbers are shown
Method Detail

getListCellRendererComponent

public Component getListCellRendererComponent(List list,
                                              Object value,
                                              int index,
                                              boolean isSelected)
Description copied from interface: ListCellRenderer
Returns a component instance that is already set to render "value". While it is not a requirement many renderers often derive from a component (such as a label) and return "this". Notice that a null value for the value argument might be sent when refreshing the theme of the list.

Specified by:
getListCellRendererComponent in interface ListCellRenderer
Parameters:
list - the List object
value - an Object
index - the index
isSelected - indicating whether the Component is selected
Returns:
a Component object

getListFocusComponent

public Component getListFocusComponent(List list)
Description copied from interface: ListCellRenderer
Returns a component instance that is painted under the currently focused renderer and is animated to provide smooth scrolling. When the selection moves, this component is drawn above/bellow the list items - it is recommended to give this component some level of transparency (see above code example). This method is optional an implementation can choose to return null.

Specified by:
getListFocusComponent in interface ListCellRenderer
Parameters:
list - the list
Returns:
a component instance that is painted under the currently focused renderer and is animated to provide smooth scrolling.
See Also:
Component.setSmoothScrolling(boolean)

repaint

public void repaint()
Overriden to do nothing and remove a performance issue where renderer changes perform needless repaint calls.

Overrides:
repaint in class Component

isShowNumbers

public boolean isShowNumbers()
Indicate whether numbering should exist for the default cell renderer.

Returns:
true if numbering should exist for the default cell renderer

setShowNumbers

public void setShowNumbers(boolean showNumbers)
Indicate whether numbering should exist for the default cell renderer.

Parameters:
showNumbers - indicates if numbering should exist for the default cell renderer

getSelectionTransparency

public int getSelectionTransparency()
The background transparency factor to apply to the selection focus.

Returns:
the background transparency factor
See Also:
setSelectionTransparency(int)

setSelectionTransparency

public void setSelectionTransparency(int selectionTransparency)
The background transparency factor to apply to the selection focus.

Parameters:
selectionTransparency - the background transparency factor
See Also:
getSelectionTransparency()

Java DTV API 1.3
18-Nov-2009

Copyright © 2008-2009 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, California 95054, U.S.A. All rights reserved.

U.S. Government Rights - Commercial software. Government users are subject to the Sun Microsystems, Inc. standard license agreement and applicable provisions of the FAR and its supplements. Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries.Products covered by and information contained in this service manual are controlled by U.S. Export Control laws and may be subject to the export or import laws in other countries. Nuclear, missile, chemical biological weapons or nuclear maritime end uses or end users, whether direct or indirect, are strictly prohibited. Export or reexport to countries subject to U.S. embargo or to entities identified on U.S. export exclusion lists, including, but not limited to, the denied persons and specially designated nationals lists is strictly prohibited.

DOCUMENTATION IS PROVIDED AS IS AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.

Use of this document is subject to license terms.