|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.yospace.yae.yogi.YogiComponent
|
+--com.yospace.yae.yogi.AbstractTable
|
+--com.yospace.yae.yogi.YogiList
A list component. Extends AbstractTable from which it
inherits a data model and a selection model. To this the YogiList adds a
RendererFactory renderer which it uses to
custom render all elements in the YogiList that are not YogiComponents.
A variety of accessor methods are also provided to manipulate the data and
selection models.
| Field Summary | |
protected RendererFactory |
rendererFactory
The RendererFactory object used to customise the appearance of YogiList cell. |
| Fields inherited from class com.yospace.yae.yogi.AbstractTable |
fixedCellHeight, initialSelected, model, PROPERTY_CELL_BORDERS, PROPERTY_FIXED_CELL_HEIGHT, PROPERTY_ITEMS, PROPERTY_RENDERER, PROPERTY_SELECTED_INDEX, PROPERTY_SELECTION_MODE, PROPERTY_TOGGLEABLE, selectionModel |
| Constructor Summary | |
YogiList()
Default constructor. |
|
YogiList(DataModel model)
Constructor taking a DataModel object to
comprise the data for the list. |
|
| Method Summary | |
int |
getCellHeight()
A convenience method for getting the cell height of items in the list. |
Rectangle |
getCellRect(int x,
int y)
Returns a Rectangle denoting the bounds of the specifed YogiList cell. |
java.lang.Object |
getItem(int index)
Convenience method for extracting a value from model. |
int |
getItemCount()
Convenience method for obtaining the number of elements in the list. |
RendererFactory |
getRenderer()
Returns the RendererFactory object used to
provide custom rendered cells for the list. |
int |
getSelectedIndex()
Convenience method for obtaining the index of the currently selected element. |
int[] |
getSelectedIndices()
Convenience method for obtaining the indices of the currently selected elements. |
boolean |
isSelected(int index)
Returns whether the element at the specified index has been selected. |
void |
removeAll()
Removes all elements from the list and clears all selections. |
void |
removeItem(int index)
Removes an item from the list. |
void |
removeItem(int[] indices)
Removes an array of indexes from the list. |
protected void |
resize()
Used internally to resize the list. |
boolean |
setFocus(int x,
int y)
Sets the current x,y focus index of a YogiList. |
void |
setItem(java.lang.Object item,
int index)
Sets the object at the specified index to the new value supplied. |
void |
setRenderer(RendererFactory rendererFactory)
Sets the cell renderer to be used for this list. |
void |
setSelected(int index,
boolean newState)
Sets the state of the selected element to newState. |
void |
toggleSelected(int index)
Toggles the state of the specified index. |
void |
update(int start,
int end)
Updates individual cells in a YogiList by setting the clipping area. |
| Methods inherited from class com.yospace.yae.yogi.AbstractTable |
add, addItem, clearSelections, getFixedCellHeight, getFocusBounds, getFocusX, getFocusY, getModel, getSelectionMode, getSelectionModel, hasCellBorders, initializeSelectionModel, isToggleable, setCellBorders, setFixedCellHeight, setModel, setSelectionMode, setSelectionModel, setToggleable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected RendererFactory rendererFactory
| Constructor Detail |
public YogiList()
DefaultDataModel
to store the YogiList's data items.public YogiList(DataModel model)
DataModel object to
comprise the data for the list.model - List data.| Method Detail |
public boolean isSelected(int index)
index - the specified element.public void toggleSelected(int index)
index - the index of the element to toggle.
public void setSelected(int index,
boolean newState)
index - the index of the element to set.newState - the new selection state.public void setRenderer(RendererFactory rendererFactory)
YogiComponent
to be custom-rendered.rendererFactory - the factory to be set for this list.public RendererFactory getRenderer()
RendererFactory object used to
provide custom rendered cells for the list.
public Rectangle getCellRect(int x,
int y)
getCellRect in class AbstractTablex - column index of the cell, must be 0 for YogiList else null is returned.y - row index of the cell.
public void update(int start,
int end)
update in class AbstractTablestart - first element from which to update.end - last element to update.
public void setItem(java.lang.Object item,
int index)
item - new value of the item.index - the position in the list at which to set the new element.public java.lang.Object getItem(int index)
index - the index of the required object.public int getItemCount()
getItemCount in class AbstractTablepublic int getSelectedIndex()
public int[] getSelectedIndices()
public void removeItem(int index)
index - the index of the object to be removed.public void removeItem(int[] indices)
indices - the elements to be removed.public void removeAll()
removeAll in class AbstractTablepublic int getCellHeight()
getCellHeight in class AbstractTable
public boolean setFocus(int x,
int y)
setFocus in class AbstractTablex - horizontal focus index, must be 0.y - vertical focus index.protected void resize()
resize in class AbstractTable
|
Copyright 2002 Yospace Holdings Ltd. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||