|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.svg.component.SVGList
public class SVGList
The
SVGList
class displays the items of an arbitrary long list
of data items in a limited number of visual elements. The list triggers
a scrolling effect to move up or down in the list and has a notion of
selected item (i.e., the one which reprents the current user selection).
The SVGList
class facilitates creating a list where the
appearance of the list and the list animations are defined in SVG markup and
the data displayed by the list is controlled by the ListModel
implementation associated to the SVGList
.
The conventions for the SVG this class can hook into are:
- The various elements which compose the list share the same identifier
prefix which is given to the SVGList at construction time (e.g., 'myList').
This prefix is call 'listIdPrefix' in the following.
- The animations which produce the list's scroll up effect are started by
the animation with id SVGList
assumes that the list items are SVG
Nested Class Summary
class
SVGList.DefaultListItemBinder
Default ListItemBinder.
static interface
SVGList.ListItemBinder
Interface that item binders must implement.
static interface
SVGList.ListModel
Interface that list data sources must implement.
Field Summary
protected SVGList.ListItemBinder
commonItemBinder
The list item binder used to display common list elements.
protected int
curIndex
Index of the currently selected list item.
protected java.lang.String
listIdPrefix
The prefix for the identifiers which make the various list elements.
protected java.util.Vector
listItems
This vector holds all the
protected SVGList.ListModel
listModel
The model providing the list data.
protected int
nDisplayedItems
The number of items displayed in the list.
static java.lang.String
SCROLL_DOWN_ANIM_SUFFIX
Id suffix used for the list scrollDown animation effect.
static java.lang.String
SCROLL_UP_ANIM_SUFFIX
Id suffix used for the list scrollUp animation effect.
protected org.w3c.dom.svg.SVGAnimationElement
scrollDownAnim
The animation to play to scroll down the list.
protected org.w3c.dom.svg.SVGAnimationElement
scrollUpAnim
The animation to play to scroll up the list.
protected SVGList.ListItemBinder
selectedItemBinder
The list item binder used to display the selected list element.
protected org.w3c.dom.svg.SVGElement
selectedItemDetails
Constructor Summary
SVGList(SVGList.ListModel listModel,
java.lang.String listIdPrefix)
Creates a new instance of SVGList.
Method Summary
int
getCurIndex()
Returns the current index in the list, in the [0, getSize()[ range.
int
getFocusedIndex()
Returns the index of the index in the list with focus.
float
getPosition()
Returns the current progress in the list, as a ration of the current
index over the number of list items.
void
hookSkin(org.w3c.dom.Document doc)
Hooks the specified sking to the application.
void
next()
void
prev()
void
scrollDown()
void
scrollUp()
void
setCommonItemBinder(SVGList.ListItemBinder commonItemBinder)
Sets a new ListItemBinder
for rendering common list
entries.
void
setCurIndex(int curIndex)
Sets the new current index, i.e., the index of the first displayed
list item.
void
setDataItems()
Transfers list data to the XML UI.
void
setSelectedIndex(int selectedIndex)
Sets the index of the item with selection focus.
void
setSelectedItemBinder(SVGList.ListItemBinder selectedItemBinder)
Sets a new ListItemBinder
for rendering the selected list
entry.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
SCROLL_UP_ANIM_SUFFIX
public static final java.lang.String SCROLL_UP_ANIM_SUFFIX
SCROLL_DOWN_ANIM_SUFFIX
public static final java.lang.String SCROLL_DOWN_ANIM_SUFFIX
scrollUpAnim
protected org.w3c.dom.svg.SVGAnimationElement scrollUpAnim
scrollDownAnim
protected org.w3c.dom.svg.SVGAnimationElement scrollDownAnim
nDisplayedItems
protected int nDisplayedItems
listModel
protected SVGList.ListModel listModel
curIndex
protected int curIndex
listItems
protected java.util.Vector listItems
listIdPrefix
protected java.lang.String listIdPrefix
commonItemBinder
protected SVGList.ListItemBinder commonItemBinder
selectedItemBinder
protected SVGList.ListItemBinder selectedItemBinder
selectedItemDetails
protected org.w3c.dom.svg.SVGElement selectedItemDetails
Constructor Detail
SVGList
public SVGList(SVGList.ListModel listModel,
java.lang.String listIdPrefix)
listModel
- - the ListModel
which will provide the
data for the list.listIdPrefix
- - the prefix used for the various elements which make the
list.
Method Detail
setCommonItemBinder
public void setCommonItemBinder(SVGList.ListItemBinder commonItemBinder)
ListItemBinder
for rendering common list
entries.
commonItemBinder
- - the new ListItemBinder to use when
rendering common list elements.
setSelectedItemBinder
public void setSelectedItemBinder(SVGList.ListItemBinder selectedItemBinder)
ListItemBinder
for rendering the selected list
entry.
selectedItemBinder
- - the new ListItemBinder to use when
rendering the selected list element.
hookSkin
public void hookSkin(org.w3c.dom.Document doc)
doc
- the new Document to hook into the application
getCurIndex
public int getCurIndex()
setCurIndex
public void setCurIndex(int curIndex)
curIndex
- - the index of the new first displayed list item.
getFocusedIndex
public int getFocusedIndex()
setSelectedIndex
public void setSelectedIndex(int selectedIndex)
selectedIndex
- - the index of the new currently focused list item.
getPosition
public float getPosition()
setDataItems
public void setDataItems()
next
public void next()
scrollDown
public void scrollDown()
prev
public void prev()
scrollUp
public void scrollUp()
Overview
Package
Class
Tree
Deprecated
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD