edu.iastate.jtm.assistant
Class CitationPool

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by edu.iastate.jtm.assistant.CitationPool
All Implemented Interfaces:
Markable, Monitorable, Queue, java.io.Serializable, javax.swing.table.TableModel

public class CitationPool
extends javax.swing.table.AbstractTableModel
implements Markable, Monitorable, Queue

Author:
Jing Ding edu.iastate.jtm.browser jtm
See Also:
Serialized Form

Field Summary
static int MODE_AND
           
static int MODE_OR
           
static int MODE_REPLACE
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Fields inherited from interface edu.iastate.jtm.gui.Markable
ALL_MARKED, EMPTY, NONE_MARKED, SOME_MARKED
 
Fields inherited from interface edu.iastate.jtm.util.Queue
EMPTY, FULL, SOME
 
Constructor Summary
CitationPool(int cap)
           
 
Method Summary
 void addCitationListener(CitationListener cl)
           
 void addMarkListener(MarkListener ml)
           
 boolean addPmid(java.lang.String pmid, boolean mark, int mode)
           
 void addQueueListener(QueueListener ql)
           
 int addSearchResult(PubMedQuerier querier, int mode)
           
 int export(java.io.File of, CitationManager cm)
           
 void fireCitationUpdate(int row)
           
 void fireMarkChanged()
           
 void fireQueueChanged()
           
 MedCitation getCitation(int row)
           
 java.lang.Class getColumnClass(int col)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int col)
           
 org.dom4j.Element getFullCitation(int row)
           
 java.lang.String getMessage()
           
 double getProgress()
           
 int getRowCount()
           
 java.lang.Object getValueAt(int row, int col)
           
 boolean isCellEditable(int row, int col)
           
 boolean isDeterministic()
           
 boolean isFinished()
           
 boolean isMonitorable()
           
 boolean isRunning()
           
 void markAll()
           
 void markNone()
           
 int markStatus()
           
 int open(java.io.File fromFile, int mode)
           
 int removeCitation(int row)
           
 void removeCitationListener(CitationListener cl)
           
 void removeMarkListener(MarkListener ml)
           
 void removeQueueListener(QueueListener ql)
           
 int removeUnmarked()
           
 void save(java.io.File toFile)
           
protected  void setMessage(java.lang.String m)
           
 void setMonitorable(boolean m)
           
protected  void setProgress(double p)
           
 void setStop(boolean stop)
           
 void setValueAt(java.lang.Object value, int row, int col)
           
 int status()
           
 
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

MODE_AND

public static final int MODE_AND
See Also:
Constant Field Values

MODE_OR

public static final int MODE_OR
See Also:
Constant Field Values

MODE_REPLACE

public static final int MODE_REPLACE
See Also:
Constant Field Values
Constructor Detail

CitationPool

public CitationPool(int cap)
             throws org.xml.sax.SAXException
Throws:
org.xml.sax.SAXException
Method Detail

setStop

public void setStop(boolean stop)

addPmid

public boolean addPmid(java.lang.String pmid,
                       boolean mark,
                       int mode)

markAll

public void markAll()
Specified by:
markAll in interface Markable

markNone

public void markNone()
Specified by:
markNone in interface Markable

markStatus

public int markStatus()
Specified by:
markStatus in interface Markable

addMarkListener

public void addMarkListener(MarkListener ml)
Specified by:
addMarkListener in interface Markable

removeMarkListener

public void removeMarkListener(MarkListener ml)
Specified by:
removeMarkListener in interface Markable

addQueueListener

public void addQueueListener(QueueListener ql)

removeQueueListener

public void removeQueueListener(QueueListener ql)

fireMarkChanged

public void fireMarkChanged()
Specified by:
fireMarkChanged in interface Markable

fireQueueChanged

public void fireQueueChanged()

removeCitation

public int removeCitation(int row)

removeUnmarked

public int removeUnmarked()

export

public int export(java.io.File of,
                  CitationManager cm)
           throws org.dom4j.DocumentException,
                  java.io.IOException
Throws:
org.dom4j.DocumentException
java.io.IOException

save

public void save(java.io.File toFile)
          throws java.io.IOException
Throws:
java.io.IOException

open

public int open(java.io.File fromFile,
                int mode)
         throws java.io.IOException
Throws:
java.io.IOException

addSearchResult

public int addSearchResult(PubMedQuerier querier,
                           int mode)
                    throws org.dom4j.DocumentException,
                           java.io.IOException
Throws:
org.dom4j.DocumentException
java.io.IOException

getCitation

public MedCitation getCitation(int row)

getFullCitation

public org.dom4j.Element getFullCitation(int row)
                                  throws org.dom4j.DocumentException,
                                         java.io.IOException
Throws:
org.dom4j.DocumentException
java.io.IOException

addCitationListener

public void addCitationListener(CitationListener cl)

removeCitationListener

public void removeCitationListener(CitationListener cl)

fireCitationUpdate

public void fireCitationUpdate(int row)

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface javax.swing.table.TableModel

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Specified by:
getValueAt in interface javax.swing.table.TableModel

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface javax.swing.table.TableModel

getColumnClass

public java.lang.Class getColumnClass(int col)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

getColumnName

public java.lang.String getColumnName(int col)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Specified by:
isCellEditable in interface javax.swing.table.TableModel
Overrides:
isCellEditable in class javax.swing.table.AbstractTableModel

getMessage

public java.lang.String getMessage()
Specified by:
getMessage in interface Monitorable
Returns:

getProgress

public double getProgress()
Specified by:
getProgress in interface Monitorable
Returns:

setMessage

protected void setMessage(java.lang.String m)

setProgress

protected void setProgress(double p)

setMonitorable

public void setMonitorable(boolean m)
Specified by:
setMonitorable in interface Monitorable

isMonitorable

public boolean isMonitorable()
Specified by:
isMonitorable in interface Monitorable

isDeterministic

public boolean isDeterministic()
Specified by:
isDeterministic in interface Monitorable
Returns:

isFinished

public boolean isFinished()
Specified by:
isFinished in interface Monitorable
Returns:

isRunning

public boolean isRunning()
Specified by:
isRunning in interface Monitorable
Returns:

status

public int status()
Specified by:
status in interface Queue