|
|||||||||
| 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.YogiTable
A Table component. Extends AbstractTable and
provides a two-dimensional view of the data model contained in the superclass.
| Field Summary | |
static int |
PROPERTY_CELL_SELECTABLE
cell selectable property |
static int |
PROPERTY_COLUMN_COUNT
column count property |
static int |
PROPERTY_COLUMN_WIDTH
column width property |
protected RendererFactory[] |
rendererFactory
The RendererFactory objects used to customise the appearance of a YogiTable column |
| 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 | |
YogiTable()
Default constructor which creates a DefaultDataModel
to store the YogiTable's data items and has a default of 1 column. |
|
YogiTable(DataModel model,
int columnCount)
Constructor taking a DefaultDataModel object
to comprise the data for the table, and the total number of columns. |
|
| Method Summary | |
int |
getCellHeight()
Convenience method for getting the cell height of a table cell. |
Rectangle |
getCellRect(int x,
int y)
Returns a Rectangle denoting the bounds of
the specifed YogiTable cell. |
int |
getColumnCount()
This method gets the number of columns in the table. |
int |
getColumnWidth(int index)
Returns the width in pixels of a given column. |
java.lang.String |
getColumnWidths()
Utility method which concatenates the currently set column widths into a readable, ';'-separated string. |
java.lang.Object |
getItem(int xIndex,
int yIndex)
Convenience method for extracting a value from the model. |
RendererFactory |
getRenderer(int column)
Returns the RendererFactory object used
to provide custom rendered cells for the specified column of the table. |
java.lang.String |
getRenderers()
Returns a semi-colon delimited String containing the classnames of the renderers set for this YogiTable. |
int |
getRowCount()
This method gets the number of rows in the table. |
int |
getSelectedColumn()
Returns an int which is the index of the first selected column. |
int[] |
getSelectedColumns()
Returns an array of ints containing the indices of each selected column. |
int |
getSelectedRow()
Returns an int which is the index of the first selected row. |
int[] |
getSelectedRows()
Returns an array of ints containing the indices of each selected row. |
boolean |
isCellSelectable()
Returns the state of the cellSelectable flag. |
boolean |
isSelected(int xIndex,
int yIndex)
Returns the selection state of a given cell. |
void |
removeItem(int xIndex,
int yIndex)
Removes an item from the table. |
void |
removeRowInterval(int start,
int end)
Removes the specified range of rows from the Table. |
protected void |
resize()
Resizes the table. |
void |
setCellSelectable(boolean cellSelectable)
Sets the cellSelectable flag. |
void |
setColumnCount(int columnCount)
Sets the total number of columns in the table and resizes the table. |
void |
setColumnWidth(int column,
int width)
Sets the width of a given column to a specified number of pixels. |
void |
setColumnWidths(int width)
Sets the width of all columns to the specified number of pixels. |
void |
setColumnWidths(java.lang.String widths)
Used internally to parse a semi-colon delimited String of column widths and set the width of successive columns to the specified number of pixels. |
boolean |
setFocus(int x,
int y)
Sets the current x,y focus index of a YogiTable. |
void |
setItem(java.lang.Object item,
int xIndex,
int yIndex)
Sets the item at the specified index, replacing the existing contents. |
void |
setRenderer(RendererFactory rendererFactory,
int column)
Sets the cell renderer to be used for a specified column in the YogiTable. |
void |
setRenderers(java.lang.String renderers)
Used internally to set the column cell renderers to a semi-colon delimited String of fully-qualified classnames. |
void |
setRowSelectionInterval(int start,
int end,
boolean newState)
Sets the specified range of rows from the table to the specified state. |
void |
setSelected(int xIndex,
int yIndex,
boolean newState)
Sets the state of the selected index to newState. |
void |
toggleSelected(int xIndex,
int yIndex)
Toggles the state of the selected index if toggling is allowed, else set the state to true. |
void |
update(int elementOne,
int elementTwo)
Updates the table between two specified elements. |
| Methods inherited from class com.yospace.yae.yogi.AbstractTable |
add, addItem, clearSelections, getFixedCellHeight, getFocusBounds, getFocusX, getFocusY, getItemCount, getModel, getSelectionMode, getSelectionModel, hasCellBorders, initializeSelectionModel, isToggleable, removeAll, 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 |
public static final int PROPERTY_COLUMN_COUNT
public static final int PROPERTY_COLUMN_WIDTH
public static final int PROPERTY_CELL_SELECTABLE
protected RendererFactory[] rendererFactory
| Constructor Detail |
public YogiTable()
DefaultDataModel
to store the YogiTable's data items and has a default of 1 column.
public YogiTable(DataModel model,
int columnCount)
DefaultDataModel object
to comprise the data for the table, and the total number of columns.model - the list data.columnCount - the number of columns in the table.| Method Detail |
public void setColumnWidths(int width)
width - the width in pixels to set all columns widths to
public void setColumnWidth(int column,
int width)
column - the specified column.width - the width for that column.public void setColumnCount(int columnCount)
columnCount - the total number of columns in the table.
public void setRenderer(RendererFactory rendererFactory,
int column)
rendererFactory - the factory to use for the column.column - the specified column.public RendererFactory getRenderer(int column)
RendererFactory object used
to provide custom rendered cells for the specified column of the table.column - the specified column.public void setCellSelectable(boolean cellSelectable)
cellSelectable - true if the table can have a single cell selected,
false if only rows may be selected.public boolean isCellSelectable()
public int getColumnCount()
public int getRowCount()
public int getColumnWidth(int index)
setColumnWidth(int, int) then this value will
be returned, else the default is the average width of columns in the table.index - the column.
public void removeRowInterval(int start,
int end)
start) up to and including the last row (end).start - the row from which to begin the removal.end - the row at which to stop the removal.
public void setRowSelectionInterval(int start,
int end,
boolean newState)
start) up to and including the last row (end).start - the row from which to begin reseting the state.end - the row at which to stop reseting the state.newState - the state to which to set the selected flag of each table cell.public int[] getSelectedRows()
public int[] getSelectedColumns()
public int getSelectedRow()
public int getSelectedColumn()
public boolean isSelected(int xIndex,
int yIndex)
xIndex - the column index of the cell.yIndex - the row index of the cell.
public void toggleSelected(int xIndex,
int yIndex)
true.xIndex - the column index of the cell.yIndex - the row index of the cell.
public void setSelected(int xIndex,
int yIndex,
boolean newState)
xIndex - the column index of the cell.yIndex - the row index of the cell.newState - the new selection state.
public Rectangle getCellRect(int x,
int y)
Rectangle denoting the bounds of
the specifed YogiTable cell.getCellRect in class AbstractTablex - column index of the cell.y - row index of the cell.
public boolean setFocus(int x,
int y)
setFocus in class AbstractTablex - horizontal focus index, must be 0.y - vertical focus index.public final java.lang.String getColumnWidths()
public void update(int elementOne,
int elementTwo)
repaint() on the
entire table.update in class AbstractTableelementOne - the first element from which to update.elementTwo - the last element to update.
public void setItem(java.lang.Object item,
int xIndex,
int yIndex)
item - the Object to replace the specified cell in the table.xIndex - the column index.yIndex - the row index.
public java.lang.Object getItem(int xIndex,
int yIndex)
xIndex - the column index.yIndex - the row index.
public void removeItem(int xIndex,
int yIndex)
xIndex - the column index.yIndex - the row index.public int getCellHeight()
getCellHeight in class AbstractTableprotected void resize()
resize in class AbstractTablepublic final java.lang.String getRenderers()
public final void setRenderers(java.lang.String renderers)
renderers - the rendererspublic final void setColumnWidths(java.lang.String widths)
widths - the semi-colon delimited width in pixels of a succession of
columns.
|
Copyright 2002 Yospace Holdings Ltd. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||