|
|||||||||
| 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
Abstract Table is the base class for YogiList and YogiTable components. It provides a data model to manage list items, and a selection model to control selection state.
| Field Summary | |
protected int |
fixedCellHeight
The height of a cell in an AbstractTable subclass. |
protected int |
initialSelected
keeps track of the initial selected index. |
protected DataModel |
model
The data model for an AbstractTable subclass. |
static int |
PROPERTY_CELL_BORDERS
Property constant for the cell borders. |
static int |
PROPERTY_FIXED_CELL_HEIGHT
Property constant for the fixed cell height. |
static int |
PROPERTY_ITEMS
Property constant for the data items. |
static int |
PROPERTY_RENDERER
Property constant for the renderer. |
static int |
PROPERTY_SELECTED_INDEX
Property constant for the selected index. |
static int |
PROPERTY_SELECTION_MODE
Property constant for the selection model. |
static int |
PROPERTY_TOGGLEABLE
Property constant for the toggleable flag. |
protected SelectionModel |
selectionModel
The selection model used to respond to selection events. |
| Constructor Summary | |
AbstractTable(DataModel model)
Constructor taking a DataModel object to
comprise the data for the list. |
|
| Method Summary | |
void |
add(YogiComponent component)
Overridden YogiComponent.add(YogiComponent)
method, delegating all component additions to the data model. |
void |
addItem(java.lang.Object item)
Adds an item to the data model. |
void |
clearSelections()
Clears all selections from the selection model. |
abstract int |
getCellHeight()
Convenience method for retrieving the height of an Abstract table cell. |
abstract Rectangle |
getCellRect(int x,
int y)
Calculates the bounds of the item at the specified position in the AbstractTable. |
int |
getFixedCellHeight()
Returns the fixed height of an AbstractTable cell. |
Rectangle |
getFocusBounds()
Calculates the region of the table that most needs to be made visible. |
int |
getFocusX()
This method retrieves the column index of the current focus, starting from zero. |
int |
getFocusY()
This method retrieves the row index of the current focus, starting from zero. |
int |
getItemCount()
Convenience method for obtaining the number of elements in the list. |
DataModel |
getModel()
Returns the DataModel used to store data. |
int |
getSelectionMode()
Returns the mode to which the selection model has been set. |
SelectionModel |
getSelectionModel()
Returns the SelectionModel used to store selection state. |
boolean |
hasCellBorders()
Returns the state of the table's cell border flag. |
protected void |
initializeSelectionModel()
Creates the selection model for use with the YogiList. |
boolean |
isToggleable()
Returns whether or not clicking on the AbstractTable will toggle the selected state of a cell, or merely set the selected state to true. |
void |
removeAll()
Removes all items from the list and clears all selections. |
protected abstract void |
resize()
Implement in subclasses to resize the AbstractTable to the dimensions neccessary to fit its current contents. |
void |
setCellBorders(boolean cellBorders)
Sets the AbstractTable's cell border flag on or off. |
void |
setFixedCellHeight(int fixedCellHeight)
Fixes the height of the cells. |
protected boolean |
setFocus(int column,
int row)
Sets the current x,y focus index of an AbstractTable. |
void |
setModel(DataModel newModel)
Sets this list's model to be as specified. |
void |
setSelectionMode(int selectionMode)
Sets the selection mode to be used for this list. |
void |
setSelectionModel(SelectionModel selectionModel)
Sets the SelectionModel to be used for
this list. |
void |
setToggleable(boolean toggleable)
Sets the AbstractTable's toggleable flag on or off. |
abstract void |
update(int start,
int end)
Implement in subclasses to repaint the AbstractTable within the specified range. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PROPERTY_FIXED_CELL_HEIGHT
public static final int PROPERTY_SELECTED_INDEX
public static final int PROPERTY_SELECTION_MODE
public static final int PROPERTY_CELL_BORDERS
public static final int PROPERTY_RENDERER
public static final int PROPERTY_ITEMS
public static final int PROPERTY_TOGGLEABLE
protected DataModel model
protected SelectionModel selectionModel
protected int fixedCellHeight
protected int initialSelected
| Constructor Detail |
public AbstractTable(DataModel model)
DataModel object to
comprise the data for the list.model - the list data to create the AbstractTable with.| Method Detail |
protected void initializeSelectionModel()
public void setFixedCellHeight(int fixedCellHeight)
fixedCellHeight - the height of each cell in a YogiList.public abstract int getCellHeight()
public void setCellBorders(boolean cellBorders)
cellBorders - state of the table's cell borderspublic void setToggleable(boolean toggleable)
toggleable - new toggleable settingpublic boolean isToggleable()
public boolean hasCellBorders()
public int getFixedCellHeight()
public void add(YogiComponent component)
YogiComponent.add(YogiComponent)
method, delegating all component additions to the data model.add in class YogiComponentcomponent - the component to add to the data model.public void addItem(java.lang.Object item)
item - the object to be added to the list.public void setSelectionModel(SelectionModel selectionModel)
SelectionModel to be used for
this list.selectionModel - the modelpublic void setSelectionMode(int selectionMode)
selectionMode - the modepublic int getSelectionMode()
public DataModel getModel()
DataModel used to store data.public SelectionModel getSelectionModel()
SelectionModel used to store selection state.public final void setModel(DataModel newModel)
newModel - a DataModel containing the
data items to be used by the AbstractTable.public int getFocusX()
public int getFocusY()
protected boolean setFocus(int column,
int row)
column - Horizontal focus index.row - Vertical focus index.public int getItemCount()
public void removeAll()
removeAll in class YogiComponentpublic void clearSelections()
protected abstract void resize()
public abstract void update(int start,
int end)
start - The cell from which to start repainting.end - The cell up to which to repaint.
public abstract Rectangle getCellRect(int x,
int y)
x - Horizontal indexy - Vertical indexpublic Rectangle getFocusBounds()
cell-rectangle that is currently
focussed, if any; if there is none, it returns the bounds of the table
itself.getFocusBounds in class YogiComponentcom.yospace.yae.yogi.YogiComponent
|
Copyright 2002 Yospace Holdings Ltd. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||