edu.stanford.smi.protegex.owl.ui.classform.component.property
Class PropertyFormTableModel

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

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

A TableModel displaying one column containing the fillers of someValuesFrom restrictions at a given class/property pair.

Author:
Holger Knublauch
See Also:
Serialized Form

Field Summary
static int COL_FILLER
          The index of the column holding the classes/fillers.
private  RDFSClass definition
          If this is represents a definition (equivalent class), then this field points to it.
private  ClassListener listener
           
private  OWLNamedClass namedClass
          The OWLNamedClass hosting the restrictions
private  RDFProperty property
          The property being (possibly) restricted
private  List restrictions
           
private  List rows
          The list of resources displayed as main contents (fillers of existential restrictions)
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
PropertyFormTableModel(OWLNamedClass namedClass, RDFProperty property)
          Constructs a new PropertyFormTableModel with no definition (only necessary conditions).
PropertyFormTableModel(OWLNamedClass namedClass, RDFProperty property, RDFSClass definition)
          Creates a new PropertyFormTableModel with an (optional) definition.
 
Method Summary
private  void addRows()
           
 void dispose()
           
 Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 Icon getIcon(RDFResource resource)
           
 OWLNamedClass getNamedClass()
           
 RDFProperty getPredicate(int row)
           
 RDFProperty getProperty()
           
 RDFResource getRDFResource(int row)
           
 List getRDFResources()
           
 OWLExistentialRestriction getRestriction(int row)
           
 int getRowCount()
           
 RDFResource getSubject()
           
 int getSymbolColumnIndex()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
private  Iterator listRestrictions()
           
private  void refill()
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnName, getListeners, getTableModelListeners, 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
addTableModelListener, getColumnName, removeTableModelListener, setValueAt
 

Field Detail

COL_FILLER

public static final int COL_FILLER
The index of the column holding the classes/fillers. This is currently the only column but we may decide to add QCRs later, so this constant should be used.

See Also:
Constant Field Values

rows

private List rows
The list of resources displayed as main contents (fillers of existential restrictions)


restrictions

private List restrictions

definition

private RDFSClass definition
If this is represents a definition (equivalent class), then this field points to it.


listener

private ClassListener listener

namedClass

private OWLNamedClass namedClass
The OWLNamedClass hosting the restrictions


property

private RDFProperty property
The property being (possibly) restricted

Constructor Detail

PropertyFormTableModel

public PropertyFormTableModel(OWLNamedClass namedClass,
                              RDFProperty property)
Constructs a new PropertyFormTableModel with no definition (only necessary conditions).

Parameters:
namedClass - the named class hosting the table
property - the property being shown

PropertyFormTableModel

public PropertyFormTableModel(OWLNamedClass namedClass,
                              RDFProperty property,
                              RDFSClass definition)
Creates a new PropertyFormTableModel with an (optional) definition.

Parameters:
namedClass - the named class hosting the table
property - the property being shown
definition - the definition or null
Method Detail

addRows

private void addRows()

dispose

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

getColumnCount

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

getColumnClass

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

getIcon

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

getNamedClass

public OWLNamedClass getNamedClass()

getPredicate

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

getProperty

public RDFProperty getProperty()

getRDFResource

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

getSubject

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

getRDFResources

public List getRDFResources()

getRestriction

public OWLExistentialRestriction getRestriction(int row)

getRowCount

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

getSymbolColumnIndex

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

getValueAt

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

isCellEditable

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

listRestrictions

private Iterator listRestrictions()

refill

private void refill()