|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
edu.stanford.smi.protegex.owl.ui.conditions.ConditionsTableModel
The TableModel used by the AssertedConditionsWidget.
Field Summary | |
private ClassListener |
classListener
|
private edu.stanford.smi.protege.event.FrameListener |
frameListener
|
private OWLNamedClass |
hostClass
The edited class |
private List |
items
One Item object for each row |
private Collection |
listenedToClses
|
private OWLModel |
owlModel
|
edu.stanford.smi.protege.model.Cls |
previouslyEditedCls
Needed to select the most recently edited row after closing the expression editor |
private edu.stanford.smi.protege.model.Slot |
superclassesSlot
|
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Fields inherited from interface edu.stanford.smi.protegex.owl.ui.conditions.ConditionsTableConstants |
COL_COUNT, COL_EXPRESSION, TYPE_DEFINITION_BASE, TYPE_INHERITED, TYPE_SUPERCLASS |
Constructor Summary | |
ConditionsTableModel(OWLModel owlModel)
Constructs a new ConditionsTableModel with default superslot. |
|
ConditionsTableModel(OWLNamedClass hostCls,
edu.stanford.smi.protege.model.Slot superclassesSlot)
Constructs a new ConditionsTableModel for a given Cls. |
|
ConditionsTableModel(edu.stanford.smi.protege.model.Slot superclassesSlot)
Constructs a new ConditionsTableModel with customized superslot. |
Method Summary | |
int |
addEmptyDefinitionBlock()
|
int |
addEmptyRow(int selectedRow)
|
private void |
addInheritedSeparator()
|
private void |
addItem(int index,
ConditionsTableItem item)
|
private void |
addItemUnlessOverloaded(RDFSClass aClass,
OWLNamedClass originCls)
Adds a given Item, unless it represents a restriction that has been overloaded in the existing entries. |
boolean |
addRow(RDFSClass aClass,
int selectedRow)
Adds a given Cls to the class conditions specified by a given row. |
boolean |
addRowAllowMove(RDFSClass aClass,
int selectedRow)
|
private boolean |
deleteDefinitionRow(int index)
|
void |
deleteRow(int index)
|
void |
deleteRow(int index,
boolean forceDelete)
|
void |
displaySemanticError(String message)
Displays an illegal assignment error dialog, e.g. through a JOptionPane. |
void |
dispose()
|
void |
dumpItems()
|
private void |
fillDefinitionItems(Collection coveredClses)
|
private void |
fillDirectSuperclassItems(Collection coveredClses)
|
private void |
fillInheritedAnonymousClses(OWLNamedClass originCls,
Collection coveredClses)
|
private void |
fillInheritedItems(Collection coveredClses)
|
private void |
fillInheritedItems(OWLNamedClass originCls,
Collection coveredClses)
|
private void |
fillItems()
|
int |
getBlockSize(int blockStartRow)
|
String |
getBlockText(int type)
Gets a string of the form |
RDFSClass |
getClass(int row)
Gets the RDFSClass displayed at a given row. |
int |
getClassRow(RDFSClass cls)
|
Class |
getColumnClass(int columnIndex)
|
int |
getColumnCount()
|
OWLIntersectionClass |
getDefinition(int rowIndex)
If a given row displays an operand from an equivalent class intersection, then this method returns the OWLIntersectionClass hosting it. |
OWLNamedClass |
getEditedCls()
|
Icon |
getIcon(int rowIndex,
int rowHeight)
|
Icon |
getIcon(RDFResource resource)
|
private ConditionsTableItem |
getItem(int rowIndex)
|
private Collection |
getNamedDefinitionClses(boolean allowDirectSuperclasses)
|
OWLNamedClass |
getOriginClass(int rowIndex)
Gets the class where the entry from a given row has been inherited from. |
RDFProperty |
getPredicate(int row)
|
RDFResource |
getRDFResource(int row)
|
int |
getRowCount()
|
RDFResource |
getSubject()
|
int |
getSymbolColumnIndex()
|
int |
getType(int rowIndex)
Gets the type of the entry at a certain row. |
Object |
getValueAt(int rowIndex,
int columnIndex)
|
private void |
handleDuplicateEntry(RDFSClass newClass)
|
boolean |
isAddEnabledAt(int rowIndex)
Checks whether the "add named class" function is enabled for a given row. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
|
boolean |
isCreateEnabledAt(int row)
Checks whether an anonymous class could be added/created at a given row. |
boolean |
isDefinition(int rowIndex)
|
boolean |
isDeleteEnabledFor(RDFSClass cls)
|
boolean |
isEditable()
|
boolean |
isRemoveEnabledFor(int rowIndex)
|
boolean |
isSeparator(int rowIndex)
|
private void |
refill()
|
void |
refresh()
|
void |
removeEmptyRow()
|
private void |
removeListeners()
|
private void |
replaceItemType(int oldType,
int newType)
|
void |
setCls(OWLNamedClass cls)
|
void |
setValueAt(int rowIndex,
OWLModel owlModel,
String parsableText)
|
void |
setValueAt(Object value,
int rowIndex,
int columnIndex)
|
private void |
sortItems()
Sorts the items according to their compareTo method. |
private void |
sortSufficientBlocks(List separators)
Assumes that the items list contains nothing but at least two non- empty definition blocks. |
private void |
swapBlocks(ConditionsTableItem separatorA,
ConditionsTableItem separatorB)
|
private void |
updateLocalIndices()
|
private void |
updateLocalIndices(int startRow)
|
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnName, 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, getColumnName, removeTableModelListener |
Field Detail |
private ClassListener classListener
private edu.stanford.smi.protege.event.FrameListener frameListener
private OWLNamedClass hostClass
private List items
private Collection listenedToClses
private OWLModel owlModel
public edu.stanford.smi.protege.model.Cls previouslyEditedCls
private edu.stanford.smi.protege.model.Slot superclassesSlot
Constructor Detail |
public ConditionsTableModel(OWLModel owlModel)
owlModel
- the OWLModelpublic ConditionsTableModel(edu.stanford.smi.protege.model.Slot superclassesSlot)
superclassesSlot
- the Slot (either inferred or asserted superclasses)public ConditionsTableModel(OWLNamedClass hostCls, edu.stanford.smi.protege.model.Slot superclassesSlot)
hostCls
- the initially displayed classsuperclassesSlot
- the Slot (either inferred or asserted superclasses)Method Detail |
public int addEmptyDefinitionBlock()
public int addEmptyRow(int selectedRow)
addEmptyRow
in interface OWLTableModel
private void addItem(int index, ConditionsTableItem item)
private void addItemUnlessOverloaded(RDFSClass aClass, OWLNamedClass originCls)
aClass
- the aClassass to add as an itemoriginCls
- the class where aClassass has been definedprivate void addInheritedSeparator()
public boolean addRow(RDFSClass aClass, int selectedRow)
addRow
in interface OWLTableModel
aClass
- the aClassass to addselectedRow
- the row to add to
public boolean addRowAllowMove(RDFSClass aClass, int selectedRow)
private boolean deleteDefinitionRow(int index)
public void deleteRow(int index)
deleteRow
in interface OWLTableModel
public void deleteRow(int index, boolean forceDelete)
public void displaySemanticError(String message)
OWLTableModel
displaySemanticError
in interface OWLTableModel
message
- the message textpublic void dispose()
dispose
in interface OWLTableModel
public void dumpItems()
private void fillItems()
private void fillDefinitionItems(Collection coveredClses)
private void fillDirectSuperclassItems(Collection coveredClses)
private void fillInheritedItems(Collection coveredClses)
private void fillInheritedItems(OWLNamedClass originCls, Collection coveredClses)
private void fillInheritedAnonymousClses(OWLNamedClass originCls, Collection coveredClses)
public int getBlockSize(int blockStartRow)
public String getBlockText(int type)
type
- the type
public int getClassRow(RDFSClass cls)
getClassRow
in interface OWLTableModel
public RDFSClass getClass(int row)
getClass
in interface OWLTableModel
row
- the row to get the Class from
public int getColumnCount()
getColumnCount
in interface TableModel
public Class getColumnClass(int columnIndex)
getColumnClass
in interface TableModel
public OWLIntersectionClass getDefinition(int rowIndex)
rowIndex
- the index of the row to get the OWLIntersectionClass from
public OWLNamedClass getEditedCls()
getEditedCls
in interface OWLTableModel
public Icon getIcon(RDFResource resource)
getIcon
in interface SymbolTableModel
public Icon getIcon(int rowIndex, int rowHeight)
private ConditionsTableItem getItem(int rowIndex)
private Collection getNamedDefinitionClses(boolean allowDirectSuperclasses)
public OWLNamedClass getOriginClass(int rowIndex)
rowIndex
- the index of the row to query
public RDFProperty getPredicate(int row)
getPredicate
in interface SymbolTableModel
public RDFResource getRDFResource(int row)
getRDFResource
in interface SymbolTableModel
public RDFResource getSubject()
getSubject
in interface SymbolTableModel
public int getSymbolColumnIndex()
getSymbolColumnIndex
in interface SymbolTableModel
public int getRowCount()
getRowCount
in interface TableModel
public int getType(int rowIndex)
rowIndex
- the index of the row to get the type of
public Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface TableModel
private void handleDuplicateEntry(RDFSClass newClass)
public boolean isAddEnabledAt(int rowIndex)
isAddEnabledAt
in interface OWLTableModel
rowIndex
- the index of the row where a named class shall be added
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface TableModel
public boolean isCreateEnabledAt(int row)
row
- the index of the row to add a new anonymous class
public boolean isDeleteEnabledFor(RDFSClass cls)
isDeleteEnabledFor
in interface OWLTableModel
public boolean isDefinition(int rowIndex)
public boolean isEditable()
isEditable
in interface OWLTableModel
public boolean isRemoveEnabledFor(int rowIndex)
public boolean isSeparator(int rowIndex)
private void refill()
public void refresh()
public void removeEmptyRow()
removeEmptyRow
in interface OWLTableModel
private void removeListeners()
private void replaceItemType(int oldType, int newType)
public void setCls(OWLNamedClass cls)
setCls
in interface OWLTableModel
public void setValueAt(Object value, int rowIndex, int columnIndex)
setValueAt
in interface TableModel
public void setValueAt(int rowIndex, OWLModel owlModel, String parsableText) throws Exception
Exception
private void sortItems()
compareTo
method.
ConditionsTableItem.compareTo(java.lang.Object)
private void sortSufficientBlocks(List separators)
private void swapBlocks(ConditionsTableItem separatorA, ConditionsTableItem separatorB)
private void updateLocalIndices()
private void updateLocalIndices(int startRow)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |