edu.stanford.smi.protegex.owl.ui.clsdesc
Class DisjointClassesTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byedu.stanford.smi.protegex.owl.ui.clsdesc.DisjointClassesTableModel
All Implemented Interfaces:
ClassDescriptionTableModel, OWLTableModel, Serializable, SymbolTableModel, TableModel

public class DisjointClassesTableModel
extends AbstractTableModel
implements ClassDescriptionTableModel

An AbstractTableModel that represents each disjoint class with one row. Its contents is automatically synchronized with the given Cls.

Author:
Holger Knublauch
See Also:
Serialized Form

Field Summary
private  OWLNamedClass cls
          The currently edited class
private  List rows
          The List of RDFSClass instances in the table, sorted by rows
private  PropertyValueListener valueListener
          The FrameListener that detects changes in the disjoint classes own slot of the Cls
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
DisjointClassesTableModel()
           
 
Method Summary
private  void addDisjointClass(RDFSClass rdfsClass)
           
 int addEmptyRow(int rowIndex)
           
 boolean addRow(RDFSClass rdfsClass, int rowIndex)
           
private  void addRows()
          Adds the rows to represent all disjoint classes on the given class.
(package private)  void clearRows()
          Removes all rows from the table.
 void deleteRow(int index)
           
 void displaySemanticError(String message)
          Displays an illegal assignment error dialog, e.g. through a JOptionPane.
 void dispose()
          Clears any dangling listeners.
 RDFSClass getClass(int rowIndex)
           
 int getClassRow(RDFSClass cls)
           
(package private)  edu.stanford.smi.protege.model.Cls getCls()
           
 Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int column)
           
 OWLNamedClass getEditedCls()
           
 Icon getIcon(RDFResource resource)
           
 RDFProperty getPredicate(int row)
           
 RDFResource getRDFResource(int row)
           
(package private)  int getRow(edu.stanford.smi.protege.model.Cls superCls)
           
 int getRowCount()
           
 RDFResource getSubject()
           
 int getSymbolColumnIndex()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
private  void insertRow(RDFSClass rdfsClass)
           
 boolean isAddEnabledAt(int rowIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isDeleteEnabledFor(RDFSClass cls)
           
 boolean isEditable()
           
 boolean isRemoveEnabledFor(edu.stanford.smi.protege.model.Cls otherClass)
           
 void removeEmptyRow()
           
private  void removeListeners()
           
 void setCls(OWLNamedClass newCls)
           
 void setValueAt(Object value, int rowIndex, int columnIndex)
           
private  void setValueAt(RDFSClass newClass, RDFSClass oldClass)
           
 
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

cls

private OWLNamedClass cls
The currently edited class


rows

private List rows
The List of RDFSClass instances in the table, sorted by rows


valueListener

private PropertyValueListener valueListener
The FrameListener that detects changes in the disjoint classes own slot of the Cls

Constructor Detail

DisjointClassesTableModel

public DisjointClassesTableModel()
Method Detail

addEmptyRow

public int addEmptyRow(int rowIndex)
Specified by:
addEmptyRow in interface OWLTableModel

addRow

public boolean addRow(RDFSClass rdfsClass,
                      int rowIndex)
Specified by:
addRow in interface OWLTableModel

addDisjointClass

private void addDisjointClass(RDFSClass rdfsClass)

addRows

private void addRows()
Adds the rows to represent all disjoint classes on the given class. This method completely fills the whole table and assumes that the rows list is empty.


clearRows

void clearRows()
Removes all rows from the table.


deleteRow

public void deleteRow(int index)
Specified by:
deleteRow in interface OWLTableModel

displaySemanticError

public void displaySemanticError(String message)
Description copied from interface: OWLTableModel
Displays an illegal assignment error dialog, e.g. through a JOptionPane. This can be used if someone tries to assign an illegal superclass to the model.

Specified by:
displaySemanticError in interface OWLTableModel
Parameters:
message - the message text

dispose

public void dispose()
Clears any dangling listeners.

Specified by:
dispose in interface OWLTableModel

getCls

edu.stanford.smi.protege.model.Cls getCls()

getColumnCount

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

getColumnName

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

getColumnClass

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

getClass

public RDFSClass getClass(int rowIndex)
Specified by:
getClass in interface OWLTableModel

getClassRow

public int getClassRow(RDFSClass cls)
Specified by:
getClassRow in interface OWLTableModel

getEditedCls

public OWLNamedClass getEditedCls()
Specified by:
getEditedCls in interface OWLTableModel

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

getSymbolColumnIndex

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

getIcon

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

getRow

int getRow(edu.stanford.smi.protege.model.Cls superCls)

getRowCount

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

getValueAt

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

insertRow

private void insertRow(RDFSClass rdfsClass)

isAddEnabledAt

public boolean isAddEnabledAt(int rowIndex)
Specified by:
isAddEnabledAt in interface OWLTableModel

isCellEditable

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

isDeleteEnabledFor

public boolean isDeleteEnabledFor(RDFSClass cls)
Specified by:
isDeleteEnabledFor in interface OWLTableModel

isEditable

public boolean isEditable()
Specified by:
isEditable in interface OWLTableModel

isRemoveEnabledFor

public boolean isRemoveEnabledFor(edu.stanford.smi.protege.model.Cls otherClass)
Specified by:
isRemoveEnabledFor in interface ClassDescriptionTableModel

removeEmptyRow

public void removeEmptyRow()
Specified by:
removeEmptyRow in interface OWLTableModel

removeListeners

private void removeListeners()

setCls

public void setCls(OWLNamedClass newCls)
Specified by:
setCls in interface OWLTableModel

setValueAt

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

setValueAt

private void setValueAt(RDFSClass newClass,
                        RDFSClass oldClass)