Class com.symantec.itools.swing.models.StringTableModel
All Packages Class Hierarchy This Package Previous Next Index
Class com.symantec.itools.swing.models.StringTableModel
Object
|
+----AbstractTableModel
|
+----com.symantec.itools.swing.models.StringTableModel
- public class StringTableModel
- extends AbstractTableModel
- implements Serializable
-
colCount
- The number of columns currently in the table.
-
dataVector
- A Vector of Vectors containing the table's data
-
editable
- A boolean indicating whether the table in general is editable.
-
editableVector
- A vector of vectors containg booleans indicating editability of
each cell in the table.
-
headerVector
- A vector containing the column headers
-
com.symantec.itools.swing.models.StringTableModel()
-
-
addElement(Object, int)
- Calls the Vector.addElement() on the specified row in dataVector
-
addRow(String)
- Add a row of data.
-
capacity(int)
- Calls the Vector.Capacity() on the specified row in dataVector
-
columnContains(Object, int)
- Determines whether the specified column contains the specified object.
-
copyInto(Object[][])
- Fills anArray with corresponding values in dataVector by calling
getElementAt(int,int)
-
elementAt(int, int)
- Calls the Vector.elementAt() on the specified row in dataVector
-
elements(int)
- Calls the Vector.elements() on the specified row in dataVector
-
ensureCapacity(int, int)
- Calls the Vector.ensureCapacity() on the specified row in dataVector
-
firstElement(int)
- Calls the Vector.firstElement() on the specified row in dataVector
-
getColumnClass(int)
- Returns the class of the type of object held in this column.
-
getColumnCount()
- Returns the number of columns in the table.
-
getColumnHeaders()
- Calls getColumnHeaders(char)
-
getColumnHeaders(char)
- Constructs a comma-delimited string from headerVector
-
getColumnName(int)
- Returns the header for specified column.
-
getElementAt(int, int)
- Gets the value from a particular cell.
-
getItems()
- Calls getItems(char)
-
getItems(char)
- Called by getItems().
-
getNumRows()
- Returns the number of rows in dataVector.
-
getRow(int)
- Calls getRow(int,char)
Get a particular row of data.
-
getRow(int, char)
- Get a particular row of data.
-
getRowCount()
- Returns the number of rows in the table.
-
getValueAt(int, int)
- Returns the value in the specified cell
-
indexOf(Object, int)
- Calls the Vector.indexOf(object) on the specified row in dataVector
-
indexOf(Object, int, int)
- Calls the Vector.indexOf(object,int) on the specified row in dataVector
-
insertElementAt(Object, int, int)
- Calls the Vector.insertElementAt() on the specified row in dataVector
-
insertRowAt(String, int)
- Calls setItemAt(string,int,boolean)
-
isCellEditable(int, int)
- Is the cell editable?
-
isEditable()
- Is the table in general editable?
-
isEmpty(int)
- Calls the Vector.isEmpty() on the specified row in dataVector
-
lastElement(int)
- Calls the Vector.lastElement() on the specified row in dataVector
-
lastIndexOf(Object, int)
- Calls the Vector.lastIndexOf(object) on the specified row in dataVector
-
lastIndexOf(Object, int, int)
- Calls the Vector.lastIndexOf(object,int) on the specified row in dataVector
-
removeAllElements(int)
- Calls the Vector.removeAllElements() on the specified row in dataVector
-
removeElement(Object, int)
- Calls the Vector.removeElement() on the specified row in dataVector
-
removeElementAt(int, int)
- Calls the Vector.removeElementAt() on the specified row in dataVector
-
removeRow(int)
- Removes the specified row from dataVector
-
rowContains(Object, int)
- Calls the Vector.contains() on the specified row in dataVector
-
setCellEditable(int, int, boolean)
- Set the editability of the specified cell.
-
setColumnHeaders(String)
- Calls setcolumnHeaders(String,String)
-
setColumnHeaders(String, String)
- Sets the column headers.
-
setEditable(boolean)
- Sets whether or not the table in general is editable.
-
setElementAt(Object, int, int)
- Calls the Vector.setElementAt() on the specified row in dataVector
-
setItemAt(String, int, boolean)
- Calls setItemAt(String,int,boolean,String)
-
setItemAt(String, int, boolean, String)
- Puts the item value (row of data) into dataVector
Pads any short rows to the widest row with a space.
-
setItems(String[])
- Calls setItems(String[],String).
-
setItems(String[], String)
- Parses the String array, one row at a time, via a stringtokenizer
by calling setItemAt(String,int,boolean,String)
-
setSize(int, int)
- Calls the Vector.setSize() on the specified row in dataVector
-
setValueAt(Object, int, int)
- Set the value for a specified cell
-
size()
- Calls the Vector.Size() on dataVector
-
size(int)
- Calls the Vector.Size() on the specified row in dataVector
-
trimToSize(int)
- Calls the Vector.trimToSize() on the specified row in dataVector
colCount
protected int colCount
- The number of columns currently in the table.
This is equal to the widest row of data.
The column headers are pinned (padded or truncated) to the width of the data
dataVector
protected java.util.Vector dataVector
- A Vector of Vectors containing the table's data
editable
protected boolean editable
- A boolean indicating whether the table in general is editable.
editableVector
protected java.util.Vector editableVector
- A vector of vectors containg booleans indicating editability of
each cell in the table.
headerVector
protected java.util.Vector headerVector
- A vector containing the column headers
StringTableModel
public StringTableModel()
addElement
public void addElement(Object obj,
int row)
- Calls the Vector.addElement() on the specified row in dataVector
- Parameters:
- obj - The value to add
- row - The specified row
addRow
public void addRow(String data)
- Add a row of data. Calls insertRowAt(String,int)
- Parameters:
- data - A comma-delimited string.
capacity
public int capacity(int row)
- Calls the Vector.Capacity() on the specified row in dataVector
- Parameters:
- row - The specified row
- Returns:
- The current capacity of the specified row
columnContains
public boolean columnContains(Object elem,
int col)
- Determines whether the specified column contains the specified object.
- Parameters:
- elem - The specified object
- col - The specified column
- Returns:
- Whether the specified column contains the specified object.
copyInto
public void copyInto(Object[][] anArray)
- Fills anArray with corresponding values in dataVector by calling
getElementAt(int,int)
- Parameters:
- anArray - Object array
elementAt
public java.lang.Object elementAt(int row,
int col)
- Calls the Vector.elementAt() on the specified row in dataVector
- Parameters:
- row - The specified row
- col - The specified column
- Returns:
- The object at the specified row and column.
elements
public java.util.Enumeration elements(int row)
- Calls the Vector.elements() on the specified row in dataVector
- Parameters:
- row - The specified row
- Returns:
- The specified row as an enumeration
ensureCapacity
public void ensureCapacity(int minCapacity,
int row)
- Calls the Vector.ensureCapacity() on the specified row in dataVector
- Parameters:
- minCapacity - The required capacity
- row - The specified row
firstElement
public java.lang.Object firstElement(int row)
- Calls the Vector.firstElement() on the specified row in dataVector
- Parameters:
- row - The specified row
- Returns:
- The first element in the specified row of dataVector
getColumnClass
public java.lang.Class getColumnClass(int columnIndex)
- Returns the class of the type of object held in this column.
In this model, it it always String
- Parameters:
- columnIndex - The specified column
- Returns:
- String.class
- Overrides:
- getColumnClass in class AbstractTableModel
getColumnCount
public int getColumnCount()
- Returns the number of columns in the table.
- Returns:
- The number of columns in the table.
- Overrides:
- getColumnCount in class AbstractTableModel
getColumnHeaders
public java.lang.String getColumnHeaders()
- Calls getColumnHeaders(char)
- Returns:
- A comma-delimited string containing the columnHeaders
getColumnHeaders
public java.lang.String getColumnHeaders(char sepChar)
- Constructs a comma-delimited string from headerVector
- Parameters:
- sepChar - String - The comma delimiter
- Returns:
- A comma-delimited string containing the columnHeaders
getColumnName
public java.lang.String getColumnName(int column)
- Returns the header for specified column.
May be space (padded)
- Parameters:
- column - The specified column
- Returns:
- The header for specified column.
- Overrides:
- getColumnName in class AbstractTableModel
getElementAt
public java.lang.Object getElementAt(int row,
int col)
- Gets the value from a particular cell.
- Parameters:
- row - The specified row
- col - The specified column
- Returns:
- The value from a particular cell.
getItems
public java.lang.String[] getItems()
- Calls getItems(char)
- Returns:
- An array of comma-delimited strings representing the
data in the table.
getItems
public java.lang.String[] getItems(char appendChar)
- Called by getItems(). Constructs the array of
comma-delimited string from the data in dataVector.
- Parameters:
- appendChar - a comma
- Returns:
- An array of comma-delimited strings representing the
data in the table.
getNumRows
public int getNumRows()
- Returns the number of rows in dataVector.
- Returns:
- The number of rows
getRow
public java.lang.String getRow(int row)
- Calls getRow(int,char)
Get a particular row of data.
- Parameters:
- row - The specified row.
- Returns:
- A comma delimited string containg the elements in the specified row.
getRow
public java.lang.String getRow(int row,
char appendChar)
- Get a particular row of data.
- Parameters:
- row - The specified row.
- appendChar - a comma
- Returns:
- A comma delimited string containing the elements in the specified row.
getRowCount
public int getRowCount()
- Returns the number of rows in the table.
- Returns:
- The number of rows in the table.
- Overrides:
- getRowCount in class AbstractTableModel
getValueAt
public java.lang.Object getValueAt(int row,
int column)
- Returns the value in the specified cell
- Parameters:
- row - The specified row.
- column - The specified column
- Returns:
- The value in the specified cell
- Overrides:
- getValueAt in class AbstractTableModel
indexOf
public int indexOf(Object elem,
int row)
- Calls the Vector.indexOf(object) on the specified row in dataVector
- Parameters:
- elem - The specified object
- row - The specified row
- Returns:
- The index of the spcified object in the specified row
indexOf
public int indexOf(Object elem,
int row,
int col)
- Calls the Vector.indexOf(object,int) on the specified row in dataVector
- Parameters:
- elem - The specified object
- row - The specified row
- col - The specified column
- Returns:
- The index of the spcified object in the specified row, but
begins the search at the specified column.
insertElementAt
public void insertElementAt(Object obj,
int row,
int col)
- Calls the Vector.insertElementAt() on the specified row in dataVector
- Parameters:
- obj - The value to set.
- row - the specified row
- col - the specified column
insertRowAt
public void insertRowAt(String data,
int row)
- Calls setItemAt(string,int,boolean)
- Parameters:
- data - A comma-delimited string.
- row - The specified row.
isCellEditable
public boolean isCellEditable(int rowIndex,
int columnIndex)
- Is the cell editable?
- Parameters:
- rowIndex - The specified row
- columnIndex - The specified column
- Returns:
- true if cell is editable
- Overrides:
- isCellEditable in class AbstractTableModel
isEditable
public boolean isEditable()
- Is the table in general editable?
- Returns:
- true if table is editable
isEmpty
public boolean isEmpty(int row)
- Calls the Vector.isEmpty() on the specified row in dataVector
- Parameters:
- row - The specified row
- Returns:
- Whether or not the specified row is empty.
lastElement
public java.lang.Object lastElement(int row)
- Calls the Vector.lastElement() on the specified row in dataVector
- Parameters:
- row - The specified row
- Returns:
- The last element in the specified row of dataVector
lastIndexOf
public int lastIndexOf(Object elem,
int row)
- Calls the Vector.lastIndexOf(object) on the specified row in dataVector
- Parameters:
- elem - The specified object
- row - The specified row
- Returns:
- The last occurrence of elem in the specified row.
lastIndexOf
public int lastIndexOf(Object elem,
int row,
int col)
- Calls the Vector.lastIndexOf(object,int) on the specified row in dataVector
- Parameters:
- elem - The specified object
- row - The specified row
- col - The specified column
- Returns:
- The last occurrence of elem in the specified row, searching backwards
from the specified index
removeAllElements
public void removeAllElements(int row)
- Calls the Vector.removeAllElements() on the specified row in dataVector
- Parameters:
- row - The specified row
removeElement
public boolean removeElement(Object obj,
int row)
- Calls the Vector.removeElement() on the specified row in dataVector
- Parameters:
- obj - The value to remove. Removes only the first occurence.
- row - The specified row
- Returns:
- Whether or not the value was found
removeElementAt
public void removeElementAt(int row,
int col)
- Calls the Vector.removeElementAt() on the specified row in dataVector
- Parameters:
- row - Removes the value at the specified cell row, and
- col - the specified column
removeRow
public void removeRow(int row)
- Removes the specified row from dataVector
- Parameters:
- row - The specified row.
rowContains
public boolean rowContains(Object elem,
int row)
- Calls the Vector.contains() on the specified row in dataVector
- Parameters:
- elem - The specified object
- row - The specified row
- Returns:
- Whether or not the specified row contains the specified object
setCellEditable
public void setCellEditable(int rowIndex,
int columnIndex,
boolean f)
- Set the editability of the specified cell.
- Parameters:
- rowIndex - The specified row.
- columnIndex - The specified column
- f - True or false.
setColumnHeaders
public void setColumnHeaders(String newHeaders)
- Calls setcolumnHeaders(String,String)
- Parameters:
- newHeaders - A comma-delimited string containing the column headers
setColumnHeaders
public void setColumnHeaders(String newHeaders,
String sepChar)
- Sets the column headers.
If newHeaders is shorter than colCount
then the headerVector is padded with spaces.
If newHeaders is longer than colCount, they will be stored but
not displayed by JTable.
- Parameters:
- newHeaders - A comma-delimited string containing the column headers
- sepChar - String - The comma delimiter
setEditable
public void setEditable(boolean isEditable)
- Sets whether or not the table in general is editable.
- Parameters:
- isEditable - boolean
setElementAt
public void setElementAt(Object obj,
int row,
int col)
- Calls the Vector.setElementAt() on the specified row in dataVector
- Parameters:
- obj - object - the value to set
- row - The specified row
- col - The specified column
setItemAt
public void setItemAt(String item,
int row,
boolean notifyOfChange)
- Calls setItemAt(String,int,boolean,String)
- Parameters:
- item - A comma-delimited string representing a row of data
- row - The specified row.
- notifyOfChange - Whether or not to broadcast an event.
setItemAt
public void setItemAt(String item,
int row,
boolean notifyOfChange,
String sepChar)
- Puts the item value (row of data) into dataVector
Pads any short rows to the widest row with a space.
- Parameters:
- item - A comma-delimited string representing a row of data
- row - The specified row.
- notifyOfChange - Whether or not to broadcast an event.
- sepChar - The comma delimiter.
setItems
public void setItems(String[] newItems)
- Calls setItems(String[],String).
- Parameters:
- newItems - An array of comma-delimited strings holding the
data for the table.
setItems
public void setItems(String[] newItems,
String sepChar)
- Parses the String array, one row at a time, via a stringtokenizer
by calling setItemAt(String,int,boolean,String)
- Parameters:
- newItems - The string array of data
- sepChar - The comma delimiter
setSize
public void setSize(int newSize,
int row)
- Calls the Vector.setSize() on the specified row in dataVector
- Parameters:
- newSize - The new size
- row - The specified row
setValueAt
public void setValueAt(Object aValue,
int row,
int column)
- Set the value for a specified cell
- Parameters:
- aValue - The object value to set the specified cell to.
Should be a string for this model.
- row - The specified row.
- column - The specified column
- Overrides:
- setValueAt in class AbstractTableModel
size
public int size()
- Calls the Vector.Size() on dataVector
- Returns:
- The current size (number of rows) of dataVector.
size
public int size(int row)
- Calls the Vector.Size() on the specified row in dataVector
- Parameters:
- row - The specified row
- Returns:
- The current size of the specified row
trimToSize
public void trimToSize(int row)
- Calls the Vector.trimToSize() on the specified row in dataVector
- Parameters:
- row - The specified row
All Packages Class Hierarchy This Package Previous Next Index