Home / Development / Documentation / 2.0.44 / RecentlyUsedExpressionsListModel
TreeGraph 2
 


info.bioinfweb.treegraph.gui.dialogs.nodebranchdata
Class RecentlyUsedExpressionsListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by info.bioinfweb.treegraph.gui.dialogs.nodebranchdata.RecentlyUsedExpressionsListModel
All Implemented Interfaces:
Serializable, ListModel

public class RecentlyUsedExpressionsListModel
extends AbstractListModel
implements ListModel

Manages the list of recently used expressions.

Since:
2.0.24
Author:
Ben Stöver
See Also:
Serialized Form

Field Summary
private  List<String> expressions
           
static String FILE_NAME
           
static int MAXIMAL_COUNT
           
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
RecentlyUsedExpressionsListModel()
           
 
Method Summary
 void addExpression(String expression)
          Adds expression to the list.
private  void cutToSize()
           
 String getElementAt(int pos)
           
 String getFileName()
           
 int getSize()
           
 void loadList()
          Loads the list of recently used expressions from the TreeGraph configuration directory if the according file exists.
 void saveList()
          Writes the list of recently used expressions to the TreeGraph configuration directory.
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
 

Field Detail

FILE_NAME

public static final String FILE_NAME
See Also:
Constant Field Values

MAXIMAL_COUNT

public static final int MAXIMAL_COUNT
See Also:
Constant Field Values

expressions

private List<String> expressions
Constructor Detail

RecentlyUsedExpressionsListModel

public RecentlyUsedExpressionsListModel()
Method Detail

getFileName

public String getFileName()

cutToSize

private void cutToSize()

addExpression

public void addExpression(String expression)
Adds expression to the list. If it is already contained, it will be moved to the front.

Parameters:
expression -

loadList

public void loadList()
              throws IOException
Loads the list of recently used expressions from the TreeGraph configuration directory if the according file exists.

Throws:
IOException

saveList

public void saveList()
              throws IOException
Writes the list of recently used expressions to the TreeGraph configuration directory.

Throws:
IOException

getElementAt

public String getElementAt(int pos)
Specified by:
getElementAt in interface ListModel

getSize

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