Package mgui.interfaces.tables
Class InterfaceTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
mgui.interfaces.tables.InterfaceTableModel
- All Implemented Interfaces:
java.io.Serializable
,javax.swing.table.TableModel
,AttributeObject
,InterfaceObject
,NamedObject
,TreeObject
,CleanableObject
- Direct Known Subclasses:
DataTableModel
,VariableTableModel
public abstract class InterfaceTableModel extends javax.swing.table.AbstractTableModel implements InterfaceObject, AttributeObject
Abstract Table Model interface class. Can be subclassed to provide an implementation that assigns
values from the underlying data model to an instance of
InterfaceDataTable
- Author:
- Andrew Reid
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
Constructors Constructor Description InterfaceTableModel()
-
Method Summary
Modifier and Type Method Description protected void
_init()
void
clean()
Instructs this object to search its members for any object which has been destroyed, and release the pointer to it.void
destroy()
Destroy this object (prepare it to be removed from memory)Attribute<?>
getAttribute(java.lang.String attrName)
Returns a specific attribute for this object.AttributeList
getAttributes()
Returns the list of current attributes for this object.java.lang.Object
getAttributeValue(java.lang.String name)
Gets the value of attributename
, ornull
if it does not exist.java.lang.String
getName()
Gets the name for this object.abstract java.lang.Object
getSource()
Returns the source of data for this table.java.lang.String
getTreeLabel()
Returns the label text to appear in a tree node.boolean
isDestroyed()
Test whether this object has been destroyedInterfaceTreeNode
issueTreeNode()
Issues a newInterfaceTreeNode
for this object.void
setAttribute(java.lang.String attrName, java.lang.Object newValue)
Sets a value for a specific attribute.void
setAttributes(AttributeList thisList)
Sets the list of attributes for this object.void
setName(java.lang.String name)
Sets the name for this object.void
setTreeNode(InterfaceTreeNode node)
Sets the children for this node'sInterfaceTreeNode
.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.swing.table.TableModel
getColumnCount, getRowCount, getValueAt
-
Constructor Details
-
InterfaceTableModel
public InterfaceTableModel()
-
-
Method Details
-
_init
protected void _init() -
getSource
public abstract java.lang.Object getSource()Returns the source of data for this table.- Returns:
-
destroy
public void destroy()Description copied from interface:InterfaceObject
Destroy this object (prepare it to be removed from memory)- Specified by:
destroy
in interfaceInterfaceObject
-
getName
public java.lang.String getName()Description copied from interface:NamedObject
Gets the name for this object.- Specified by:
getName
in interfaceNamedObject
- Returns:
-
clean
public void clean()Description copied from interface:CleanableObject
Instructs this object to search its members for any object which has been destroyed, and release the pointer to it.- Specified by:
clean
in interfaceCleanableObject
-
isDestroyed
public boolean isDestroyed()Description copied from interface:InterfaceObject
Test whether this object has been destroyed- Specified by:
isDestroyed
in interfaceInterfaceObject
- Returns:
-
setName
public void setName(java.lang.String name)Description copied from interface:NamedObject
Sets the name for this object.- Specified by:
setName
in interfaceNamedObject
-
getTreeLabel
public java.lang.String getTreeLabel()Description copied from interface:TreeObject
Returns the label text to appear in a tree node.- Specified by:
getTreeLabel
in interfaceTreeObject
- Returns:
-
issueTreeNode
Description copied from interface:TreeObject
Issues a newInterfaceTreeNode
for this object. The object is responsible for maintaining, updating, and destroying the tree nodes it issues, or notifying containers -- i.e., parent trees -- of changes which require the tree nodes to be modified or destroyed.- Specified by:
issueTreeNode
in interfaceTreeObject
- Returns:
-
setTreeNode
Description copied from interface:TreeObject
Sets the children for this node'sInterfaceTreeNode
.- Specified by:
setTreeNode
in interfaceTreeObject
-
getAttribute
Description copied from interface:AttributeObject
Returns a specific attribute for this object.- Specified by:
getAttribute
in interfaceAttributeObject
- Returns:
-
getAttributeValue
public java.lang.Object getAttributeValue(java.lang.String name)Description copied from interface:AttributeObject
Gets the value of attributename
, ornull
if it does not exist.- Specified by:
getAttributeValue
in interfaceAttributeObject
- Parameters:
name
- Name of the attribute- Returns:
- the value of attribute
name
, ornull
if it does not exist
-
getAttributes
Description copied from interface:AttributeObject
Returns the list of current attributes for this object.- Specified by:
getAttributes
in interfaceAttributeObject
- Returns:
-
setAttribute
public void setAttribute(java.lang.String attrName, java.lang.Object newValue)Description copied from interface:AttributeObject
Sets a value for a specific attribute.- Specified by:
setAttribute
in interfaceAttributeObject
-
setAttributes
Description copied from interface:AttributeObject
Sets the list of attributes for this object.- Specified by:
setAttributes
in interfaceAttributeObject
-