Class MatrixModel
java.lang.Object
javax.swing.table.AbstractTableModel
org.graffiti.plugins.views.matrix.MatrixModel
- All Implemented Interfaces:
Serializable
,EventListener
,TableModel
,GraphListener
,TransactionListener
public class MatrixModel extends AbstractTableModel implements GraphListener
Contains the matrix model, which is used by the JTable ui component.
- Version:
- $Revision: 1.8 $
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description MatrixModel(Graph graph)
Constructs a new matrix model. -
Method Summary
Modifier and Type Method Description Class<?>
getColumnClass(int col)
int
getColumnCount()
String
getColumnName(int col)
int
getRowCount()
String
getRowName(int row)
Object
getValueAt(int row, int col)
boolean
isCellEditable(int row, int col)
void
postEdgeAdded(GraphEvent e)
Called after an edge has been added to the graph.void
postEdgeRemoved(GraphEvent e)
Called after an edge has been removed from the graph.void
postGraphCleared(GraphEvent e)
Called after methodclear()
has been called on a graph.void
postNodeAdded(GraphEvent e)
Called after an edge has been added to the graph.void
postNodeRemoved(GraphEvent e)
Called after a node has been removed from the graph.void
preEdgeAdded(GraphEvent e)
Called just before an edge is added to the graph.void
preEdgeRemoved(GraphEvent e)
Called just before an edge is removed from the graph.void
preGraphCleared(GraphEvent e)
Called before methodclear()
is called on a graph.void
preNodeAdded(GraphEvent e)
Called just before a node is added to the graph.void
preNodeRemoved(GraphEvent e)
Called just before a node is removed from the graph.void
setValueAt(Object value, int row, int col)
void
transactionFinished(TransactionEvent e, BackgroundTaskStatusProviderSupportingExternalCall status)
Called when a transaction has stopped.void
transactionStarted(TransactionEvent e)
Called when a transaction has started.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Constructor Details
-
MatrixModel
Constructs a new matrix model.- Parameters:
graph
- DOCUMENT ME!
-
-
Method Details
-
isCellEditable
public boolean isCellEditable(int row, int col)- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCount
in interfaceTableModel
-
getRowCount
public int getRowCount()- Specified by:
getRowCount
in interfaceTableModel
-
setValueAt
- Specified by:
setValueAt
in interfaceTableModel
- Overrides:
setValueAt
in classAbstractTableModel
-
getValueAt
- Specified by:
getValueAt
in interfaceTableModel
-
getColumnName
- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
-
getRowName
-
postEdgeAdded
Description copied from interface:GraphListener
Called after an edge has been added to the graph.- Specified by:
postEdgeAdded
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
postEdgeRemoved
Description copied from interface:GraphListener
Called after an edge has been removed from the graph.- Specified by:
postEdgeRemoved
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
postGraphCleared
Description copied from interface:GraphListener
Called after methodclear()
has been called on a graph. No other events (like remove events) are generated.- Specified by:
postGraphCleared
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
postNodeAdded
Description copied from interface:GraphListener
Called after an edge has been added to the graph.- Specified by:
postNodeAdded
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
postNodeRemoved
Description copied from interface:GraphListener
Called after a node has been removed from the graph. All edges incident to this node have already been removed (preEdgeRemoved and postEdgeRemoved have been called).- Specified by:
postNodeRemoved
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
preEdgeAdded
Description copied from interface:GraphListener
Called just before an edge is added to the graph.- Specified by:
preEdgeAdded
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
preEdgeRemoved
Description copied from interface:GraphListener
Called just before an edge is removed from the graph.- Specified by:
preEdgeRemoved
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
preGraphCleared
Description copied from interface:GraphListener
Called before methodclear()
is called on a graph. No other events (like remove events) are generated.- Specified by:
preGraphCleared
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
preNodeAdded
Description copied from interface:GraphListener
Called just before a node is added to the graph.- Specified by:
preNodeAdded
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
preNodeRemoved
Description copied from interface:GraphListener
Called just before a node is removed from the graph. This method is called before the incident edges are deleted.- Specified by:
preNodeRemoved
in interfaceGraphListener
- Parameters:
e
- the GraphEvent detailing the changes.
-
transactionFinished
public void transactionFinished(TransactionEvent e, BackgroundTaskStatusProviderSupportingExternalCall status)Description copied from interface:TransactionListener
Called when a transaction has stopped.
The classTransactionHashMap
merges duplicateAttributeEvent
s. In case the Attribute path for the sameAttributable
is not equal, detailed information about Attribute path is lost. Instead a genericAttributeEvent
containing just theAttributable
is in the list of changed Objects (seeTransactionEvent
).
In case no detailed information about an Attribute change is available, your code should completely re-process the affectedAttributable
.- Specified by:
transactionFinished
in interfaceTransactionListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-
transactionStarted
Description copied from interface:TransactionListener
Called when a transaction has started.- Specified by:
transactionStarted
in interfaceTransactionListener
- Parameters:
e
- the EdgeEvent detailing the changes.
-