public class AttributeTable
extends javax.swing.table.AbstractTableModel
Constructor and Description |
---|
AttributeTable(java.lang.String[] p_columns,
java.lang.Object[] p_defaultv,
int p_rows)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clearTable()
Clears the table
|
void |
deleteRow(int p_row)
Deletes a row in the table
|
Attribute |
getAtributo(int p_row)
Returns the attribute of a row
|
java.lang.Class |
getColumnClass(int p_col)
Returns the class of the elements of a column
|
int |
getColumnCount()
Returns the number of columns
|
java.lang.String |
getColumnName(int p_col)
Returns the name of a given column
|
java.util.Vector |
getRow(int p_row)
Returns a row of the table as a vector
|
int |
getRowCount()
Returns the number of rows
|
java.lang.Object |
getValueAt(int p_row,
int p_col)
Returns the value of an element of the table
|
void |
insertRow(java.util.Vector p_newrow,
Attribute a)
Inserts a row in the table
|
void |
populateFromResultSet(java.sql.ResultSet p_rset)
Fills data in the table with a ResultSet
|
void |
setValueAt(java.lang.Object p_obj,
int p_row,
int p_col)
Sets the value of an element of the table
|
void |
updateRow(java.util.Vector p_updatedRow,
int p_row,
Attribute a)
Updates a row in the table using a vector with its new values
|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener
public AttributeTable(java.lang.String[] p_columns, java.lang.Object[] p_defaultv, int p_rows)
Constructor
p_columns
- Columns names vectorp_defaultv
- Desfault object values for each columnp_rows
- Row number (initial)public void populateFromResultSet(java.sql.ResultSet p_rset)
Fills data in the table with a ResultSet
p_rset
- ResultSetpublic int getColumnCount()
Returns the number of columns
public int getRowCount()
Returns the number of rows
public java.lang.String getColumnName(int p_col)
Returns the name of a given column
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
p_col
- Index of the rowpublic java.lang.Object getValueAt(int p_row, int p_col)
Returns the value of an element of the table
p_row
- Index of the row of the elementp_col
- Index of the column of the elementpublic java.lang.Class getColumnClass(int p_col)
Returns the class of the elements of a column
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
p_col
- Index of the columnpublic void setValueAt(java.lang.Object p_obj, int p_row, int p_col)
Sets the value of an element of the table
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
p_obj
- New valuep_row
- Index of the row of the elementp_col
- Index of the column of the elementpublic void insertRow(java.util.Vector p_newrow, Attribute a)
Inserts a row in the table
p_newrow
- Vector containing the values of the new rowa
- Attribute corresponding to the new rowpublic void deleteRow(int p_row)
Deletes a row in the table
p_row
- Index of the row to deletepublic java.util.Vector getRow(int p_row)
Returns a row of the table as a vector
p_row
- Index of the rowpublic void updateRow(java.util.Vector p_updatedRow, int p_row, Attribute a)
Updates a row in the table using a vector with its new values
p_updatedRow
- Vector containing the new values of the rowp_row
- Index of the rowa
- Attribute corresponding to the rowpublic void clearTable()
Clears the table
public Attribute getAtributo(int p_row)
Returns the attribute of a row
p_row
- Index of the row