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)intgetColumnCount()StringgetColumnName(int col)intgetRowCount()StringgetRowName(int row)ObjectgetValueAt(int row, int col)booleanisCellEditable(int row, int col)voidpostEdgeAdded(GraphEvent e)Called after an edge has been added to the graph.voidpostEdgeRemoved(GraphEvent e)Called after an edge has been removed from the graph.voidpostGraphCleared(GraphEvent e)Called after methodclear()has been called on a graph.voidpostNodeAdded(GraphEvent e)Called after an edge has been added to the graph.voidpostNodeRemoved(GraphEvent e)Called after a node has been removed from the graph.voidpreEdgeAdded(GraphEvent e)Called just before an edge is added to the graph.voidpreEdgeRemoved(GraphEvent e)Called just before an edge is removed from the graph.voidpreGraphCleared(GraphEvent e)Called before methodclear()is called on a graph.voidpreNodeAdded(GraphEvent e)Called just before a node is added to the graph.voidpreNodeRemoved(GraphEvent e)Called just before a node is removed from the graph.voidsetValueAt(Object value, int row, int col)voidtransactionFinished(TransactionEvent e, BackgroundTaskStatusProviderSupportingExternalCall status)Called when a transaction has stopped.voidtransactionStarted(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:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classAbstractTableModel
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
getColumnCount
public int getColumnCount()- Specified by:
getColumnCountin interfaceTableModel
-
getRowCount
public int getRowCount()- Specified by:
getRowCountin interfaceTableModel
-
setValueAt
- Specified by:
setValueAtin interfaceTableModel- Overrides:
setValueAtin classAbstractTableModel
-
getValueAt
- Specified by:
getValueAtin interfaceTableModel
-
getColumnName
- Specified by:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
getRowName
-
postEdgeAdded
Description copied from interface:GraphListenerCalled after an edge has been added to the graph.- Specified by:
postEdgeAddedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
postEdgeRemoved
Description copied from interface:GraphListenerCalled after an edge has been removed from the graph.- Specified by:
postEdgeRemovedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
postGraphCleared
Description copied from interface:GraphListenerCalled after methodclear()has been called on a graph. No other events (like remove events) are generated.- Specified by:
postGraphClearedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
postNodeAdded
Description copied from interface:GraphListenerCalled after an edge has been added to the graph.- Specified by:
postNodeAddedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
postNodeRemoved
Description copied from interface:GraphListenerCalled 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:
postNodeRemovedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
preEdgeAdded
Description copied from interface:GraphListenerCalled just before an edge is added to the graph.- Specified by:
preEdgeAddedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
preEdgeRemoved
Description copied from interface:GraphListenerCalled just before an edge is removed from the graph.- Specified by:
preEdgeRemovedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
preGraphCleared
Description copied from interface:GraphListenerCalled before methodclear()is called on a graph. No other events (like remove events) are generated.- Specified by:
preGraphClearedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
preNodeAdded
Description copied from interface:GraphListenerCalled just before a node is added to the graph.- Specified by:
preNodeAddedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
preNodeRemoved
Description copied from interface:GraphListenerCalled just before a node is removed from the graph. This method is called before the incident edges are deleted.- Specified by:
preNodeRemovedin interfaceGraphListener- Parameters:
e- the GraphEvent detailing the changes.
-
transactionFinished
public void transactionFinished(TransactionEvent e, BackgroundTaskStatusProviderSupportingExternalCall status)Description copied from interface:TransactionListenerCalled when a transaction has stopped.
The classTransactionHashMapmerges duplicateAttributeEvents. In case the Attribute path for the sameAttributableis not equal, detailed information about Attribute path is lost. Instead a genericAttributeEventcontaining just theAttributableis 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:
transactionFinishedin interfaceTransactionListener- Parameters:
e- the EdgeEvent detailing the changes.
-
transactionStarted
Description copied from interface:TransactionListenerCalled when a transaction has started.- Specified by:
transactionStartedin interfaceTransactionListener- Parameters:
e- the EdgeEvent detailing the changes.
-