Graphics2D Actor API

g2d.pla.list
Class PLAListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by g2d.pla.list.PLAListModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.ListModel

public class PLAListModel
extends javax.swing.AbstractListModel

Custom implementation of list model that serves for accessing elements in their natural order.

Author:
linda
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
PLAListModel()
           
 
Method Summary
 java.lang.Object getElementAt(int i)
           
 int getSize()
           
 int indexOfCompletion(java.lang.String prefix, int start)
          Search for the first occurrence of an object, whose name has a partial name (partial names are tokens within the name separated by '(', ':', or ')' such as complexes) that begins with the given prefix (case insensitive).
 int indexOfName(java.lang.String name, boolean caseSensitive, int start)
          Searches for the first occurrence of an object with the given name from the given starting index.
 int indexOfPattern(java.lang.String pattern, boolean caseSensitive, int start)
          Searches for the first occurrence of an object with the given name from the given starting index.
 void setData(java.util.List<? extends Essence> list)
          Update data from given list.
 void setData(java.util.List<? extends Essence> list, boolean sorted)
          Update data from given list.
 
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
 

Constructor Detail

PLAListModel

public PLAListModel()
Method Detail

setData

public void setData(java.util.List<? extends Essence> list)
Update data from given list. This erases all previous entries and adds new entries in their natural order. If NULL is given, treats this as if the list is empty.

Parameters:
list - List of items in this model (can be NULL)

setData

public void setData(java.util.List<? extends Essence> list,
                    boolean sorted)
Update data from given list. This erases all previous entries and adds new entries. If NULL is given, treats this as if the list is empty.

Parameters:
list - List of items in this model (can be NULL)
sorted - boolean indicating whether sorting is desired

indexOfName

public int indexOfName(java.lang.String name,
                       boolean caseSensitive,
                       int start)
Searches for the first occurrence of an object with the given name from the given starting index.

Parameters:
name - String to be used to find a Essence in data
caseSensitive - Match given name in case sensitive manner to data
start - Index to start looking from
Returns:
Index of the first occurrence of an object with given name or -1 if no such object is found or if start index lies outside of boundaries (< 0 or > length of list)

indexOfCompletion

public int indexOfCompletion(java.lang.String prefix,
                             int start)
Search for the first occurrence of an object, whose name has a partial name (partial names are tokens within the name separated by '(', ':', or ')' such as complexes) that begins with the given prefix (case insensitive). For example, a name "(4Ebp1:Eif4e)-CLc" matches "4ebp" or "eif" (note: case insensitive). Returns -1 if no such object is found or if NULL or empty String is given. Searches from the given starting position skipping the first elements.

Parameters:
prefix - String that is beginning part of name
start - Index to start looking from (must not be < 0 or > length of list)
Returns:
index of the first occurrence of an object with given prefix being beginning of its name or -1 if no such object is found

indexOfPattern

public int indexOfPattern(java.lang.String pattern,
                          boolean caseSensitive,
                          int start)
Searches for the first occurrence of an object with the given name from the given starting index.

Parameters:
pattern - String to be used to find a Essence in data
caseSensitive - Match given name in case sensitive manner to data
start - Index to start looking from
Returns:
Index of the first occurrence of an object with given name or -1 if no such object is found or if start index lies outside of boundaries (< 0 or > length of list)

getSize

public int getSize()

getElementAt

public java.lang.Object getElementAt(int i)

Graphics2D Actor API