edu.stanford.smi.protegex.owl.ui.search.finder
Class DefaultFind

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byedu.stanford.smi.protegex.owl.ui.search.finder.DefaultFind
All Implemented Interfaces:
Find, ListModel, Serializable, TableModel
Direct Known Subclasses:
DefaultClassFind, DefaultIndividualFind, DefaultPropertyFind

public class DefaultFind
extends AbstractTableModel
implements Find

Checks the name, current browser slot and any synonym slots allocated

Author:
Nick Drummond, Medical Informatics Group, University of Manchester 03-Oct-2005
See Also:
Serialized Form

Field Summary
private  List listeners
           
private static int MAX_MATCHES
           
protected  List orderedKeys
           
protected  OWLModel owlModel
           
protected  Map results
           
protected  String string
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
DefaultFind(OWLModel owlModel)
           
 
Method Summary
 void addListDataListener(ListDataListener l)
           
private  void fireDataChanged()
           
 int getColumnCount()
           
 String getColumnName(int column)
           
 String getDescription()
           
 Object getElementAt(int index)
           
 String getLastSearch()
           
 OWLModel getModel()
           
 int getNumSearchProperties()
           
 Map getResults()
          This method can be called to get the current results
 int getRowCount()
           
protected  List getSearchProperties()
          by default automatically search the name and the current browser slot as well as the search synonym slots (if set)
 int getSize()
           
 String getSummaryText()
           
 Object getValueAt(int rowIndex, int columnIndex)
           
protected  boolean isValidFrameToSearch(edu.stanford.smi.protege.model.Frame f)
          Only look at classes, properties and individuals
 void removeListDataListener(ListDataListener l)
           
protected  Map searchOnSlot(edu.stanford.smi.protege.model.Slot searchProp, String searchStr, String lang)
           
 void startSearch(String s)
          This method should start the search.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, 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, getColumnClass, isCellEditable, removeTableModelListener, setValueAt
 

Field Detail

MAX_MATCHES

private static final int MAX_MATCHES
See Also:
Constant Field Values

owlModel

protected OWLModel owlModel

results

protected Map results

orderedKeys

protected List orderedKeys

string

protected String string

listeners

private List listeners
Constructor Detail

DefaultFind

public DefaultFind(OWLModel owlModel)
Method Detail

startSearch

public void startSearch(String s)
Description copied from interface: Find
This method should start the search.

Specified by:
startSearch in interface Find
Parameters:
s - the string to search for

getSearchProperties

protected List getSearchProperties()
by default automatically search the name and the current browser slot as well as the search synonym slots (if set)


getResults

public Map getResults()
Description copied from interface: Find
This method can be called to get the current results

Specified by:
getResults in interface Find
Returns:
a map of Resources as keys with SearchResultItem objects as values

getLastSearch

public String getLastSearch()
Specified by:
getLastSearch in interface Find

getSummaryText

public String getSummaryText()
Specified by:
getSummaryText in interface Find

getDescription

public String getDescription()
Specified by:
getDescription in interface Find

getModel

public OWLModel getModel()
Specified by:
getModel in interface Find

getNumSearchProperties

public int getNumSearchProperties()
Specified by:
getNumSearchProperties in interface Find

searchOnSlot

protected Map searchOnSlot(edu.stanford.smi.protege.model.Slot searchProp,
                           String searchStr,
                           String lang)

isValidFrameToSearch

protected boolean isValidFrameToSearch(edu.stanford.smi.protege.model.Frame f)
Only look at classes, properties and individuals

Parameters:
f - a frame
Returns:
true if the given frame should be included in the results

getSize

public int getSize()
Specified by:
getSize in interface ListModel

getElementAt

public Object getElementAt(int index)
Specified by:
getElementAt in interface ListModel

addListDataListener

public void addListDataListener(ListDataListener l)
Specified by:
addListDataListener in interface ListModel

removeListDataListener

public void removeListDataListener(ListDataListener l)
Specified by:
removeListDataListener in interface ListModel

getRowCount

public int getRowCount()
Specified by:
getRowCount 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

getValueAt

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

fireDataChanged

private void fireDataChanged()