edu.stanford.smi.protegex.owl.ui.components.literaltable
Class LiteralTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byedu.stanford.smi.protegex.owl.ui.components.literaltable.LiteralTableModel
All Implemented Interfaces:
Serializable, TableModel

public class LiteralTableModel
extends AbstractTableModel

A TableModel managing a list of RDFSLiterals which are predicate values of a given subject/predicate pair. This is used by the corresponding widget. The TableModel has one row for each literal, and one column for the value (which is entered as string), and one for the type of each value. The latter can optionally be switched off, if the predicate has a fixed range.

Author:
Holger Knublauch
See Also:
Serialized Form

Field Summary
static int COL_COUNT
           
static int COL_LANG
           
static int COL_TYPE
           
static int COL_VALUE
           
private  OWLModel owlModel
           
private  RDFProperty predicate
           
private  Boolean stringProperty
           
private  RDFResource subject
           
private  List values
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
LiteralTableModel(RDFProperty predicate)
           
 
Method Summary
 Class getColumnClass(int columnIndex)
           
 int getColumnCount()
           
 String getColumnName(int column)
           
protected  PropertyValueEditor getEditor(Object value)
           
private  Collection getNewValues(int rowOfChangedValue)
           
 Object getObject(int row)
           
 RDFProperty getPredicate()
           
private  RDFSLiteral getRDFSLiteral(int rowIndex)
           
 int getRow(Object value)
           
 int getRowCount()
           
 RDFResource getSubject()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isDeleteEnabled(int[] selectedRows)
           
 boolean isStringProperty()
           
private  boolean isStringPropertyHelper()
           
private  void setLangAt(String value, int rowIndex)
           
 void setSubject(RDFResource subject)
           
private  void setTypeAt(Object aValue, int rowIndex)
           
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 void setValues(Collection newValues)
           
 void updateValues()
           
 
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
 

Field Detail

COL_VALUE

public static final int COL_VALUE
See Also:
Constant Field Values

COL_LANG

public static final int COL_LANG
See Also:
Constant Field Values

COL_TYPE

public static final int COL_TYPE
See Also:
Constant Field Values

COL_COUNT

public static final int COL_COUNT
See Also:
Constant Field Values

owlModel

private OWLModel owlModel

predicate

private RDFProperty predicate

stringProperty

private Boolean stringProperty

subject

private RDFResource subject

values

private List values
Constructor Detail

LiteralTableModel

public LiteralTableModel(RDFProperty predicate)
Method Detail

getColumnCount

public int getColumnCount()

getColumnClass

public Class getColumnClass(int columnIndex)

getColumnName

public String getColumnName(int column)

getEditor

protected PropertyValueEditor getEditor(Object value)

getNewValues

private Collection getNewValues(int rowOfChangedValue)

getObject

public Object getObject(int row)

getPredicate

public RDFProperty getPredicate()

getRDFSLiteral

private RDFSLiteral getRDFSLiteral(int rowIndex)

getRow

public int getRow(Object value)

getRowCount

public int getRowCount()

getSubject

public RDFResource getSubject()

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)

isDeleteEnabled

public boolean isDeleteEnabled(int[] selectedRows)

isStringProperty

public boolean isStringProperty()

isStringPropertyHelper

private boolean isStringPropertyHelper()

setSubject

public void setSubject(RDFResource subject)

setTypeAt

private void setTypeAt(Object aValue,
                       int rowIndex)

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)

setLangAt

private void setLangAt(String value,
                       int rowIndex)

setValues

public void setValues(Collection newValues)

updateValues

public void updateValues()