edu.stanford.smi.protegex.owl.swrl.ui.table
Class SWRLTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byedu.stanford.smi.protegex.owl.swrl.ui.table.SWRLTableModel
All Implemented Interfaces:
edu.stanford.smi.protege.util.Disposable, Serializable, SymbolTableModel, TableModel

public class SWRLTableModel
extends AbstractTableModel
implements edu.stanford.smi.protege.util.Disposable, SymbolTableModel

Author:
Holger Knublauch
See Also:
Serialized Form

Field Summary
private  ClassListener clsListener
           
static int COL_COUNT
           
static int COL_EXPRESSION
           
static int COL_NAME
           
private  List imps
           
private  OWLModel owlModel
           
private  RDFResource rdfResource
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
SWRLTableModel(OWLModel owlModel)
           
SWRLTableModel(RDFResource resource)
           
 
Method Summary
private  void addReferencingImps(RDFResource rdfResource)
           
 void dispose()
           
 Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int column)
           
 Icon getIcon(RDFResource resource)
           
 SWRLImp getImp(int row)
           
 RDFProperty getPredicate(int row)
           
 RDFResource getRDFResource(int row)
           
 int getRowCount()
           
private  int getRowFor(SWRLImp imp)
           
 RDFResource getSubject()
           
 int getSymbolColumnIndex()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 int indexOf(SWRLImp imp)
           
private  void initClsListener()
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
private  boolean isSuitable(SWRLImp imp)
           
private  void perhapsAdd(SWRLImp imp)
           
private  void perhapsRemove(SWRLImp imp)
           
 void setRowOf(SWRLImp imp, int index)
           
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
private  void sortImps()
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
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
addTableModelListener, removeTableModelListener
 

Field Detail

COL_NAME

public static final int COL_NAME
See Also:
Constant Field Values

COL_EXPRESSION

public static final int COL_EXPRESSION
See Also:
Constant Field Values

COL_COUNT

public static final int COL_COUNT
See Also:
Constant Field Values

clsListener

private ClassListener clsListener

imps

private List imps

rdfResource

private RDFResource rdfResource

owlModel

private OWLModel owlModel
Constructor Detail

SWRLTableModel

public SWRLTableModel(OWLModel owlModel)

SWRLTableModel

public SWRLTableModel(RDFResource resource)
Method Detail

addReferencingImps

private void addReferencingImps(RDFResource rdfResource)

dispose

public void dispose()
Specified by:
dispose in interface edu.stanford.smi.protege.util.Disposable

getColumnClass

public Class getColumnClass(int columnIndex)
Specified by:
getColumnClass in interface TableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel

getIcon

public Icon getIcon(RDFResource resource)
Specified by:
getIcon in interface SymbolTableModel

getImp

public SWRLImp getImp(int row)

getPredicate

public RDFProperty getPredicate(int row)
Specified by:
getPredicate in interface SymbolTableModel

getRDFResource

public RDFResource getRDFResource(int row)
Specified by:
getRDFResource in interface SymbolTableModel

getSubject

public RDFResource getSubject()
Specified by:
getSubject in interface SymbolTableModel

getRowFor

private int getRowFor(SWRLImp imp)

getSymbolColumnIndex

public int getSymbolColumnIndex()
Specified by:
getSymbolColumnIndex in interface SymbolTableModel

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel

indexOf

public int indexOf(SWRLImp imp)

initClsListener

private void initClsListener()

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel

isSuitable

private boolean isSuitable(SWRLImp imp)

perhapsAdd

private void perhapsAdd(SWRLImp imp)

perhapsRemove

private void perhapsRemove(SWRLImp imp)

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel

setRowOf

public void setRowOf(SWRLImp imp,
                     int index)

sortImps

private void sortImps()