Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.virtuosotechnologies.asaph.maingui
Class SongListModel  view SongListModel download SongListModel.java

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended bycom.virtuosotechnologies.asaph.maingui.SongListModel
All Implemented Interfaces:
javax.swing.ListModel, java.io.Serializable

class SongListModel
extends javax.swing.AbstractListModel

ListModel implementation for a song list


Nested Class Summary
(package private)  class SongListModel.Item
          JList element type
(package private) static class SongListModel.ItemComparator
          Definition of ordering for songs
(package private) static interface SongListModel.SizeChangeListener
           
 
Field Summary
private  java.text.Collator collator_
           
private  SongListModel.ItemComparator curComparator_
           
private  com.virtuosotechnologies.asaph.model.SongDatabase database_
           
private  com.virtuosotechnologies.lib.base.LinkedObject delim_
           
private  com.virtuosotechnologies.asaph.model.opsemantics.PredicateSemantics filterPredicate_
           
private  java.util.List list_
           
private  SongListModel.SizeChangeListener sizeChangeListener_
           
private  com.virtuosotechnologies.asaph.modelutils.SongUtils songUtils_
           
private static java.lang.String STR_SongList_DatabaseErrorName
           
private static java.lang.String STR_SongList_NoTitleName
           
private static java.lang.String STR_SongList_SongNotFoundName
           
private  int totalSize_
           
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
(package private) SongListModel(com.virtuosotechnologies.asaph.model.SongDatabase database, com.virtuosotechnologies.asaph.modelutils.SongUtils songUtils, SongListModel.ItemComparator comparator, com.virtuosotechnologies.asaph.model.opsemantics.PredicateSemantics filter)
          Constructor
 
Method Summary
(package private)  int addSongID(com.virtuosotechnologies.asaph.model.SongID songID)
          Add a song id to the list model
(package private)  void addSongIDs(java.util.Collection songIDs)
          Add a collection of song ids to the list model
(package private)  void clear()
          Clear the whole list
private  SongListModel.Item findItem(com.virtuosotechnologies.asaph.model.SongID songID)
           
private  int findSongIndex(com.virtuosotechnologies.asaph.model.SongID songID)
           
(package private)  SongListModel.ItemComparator getComparator()
          Get the comparator currently used to order songs.
 java.lang.Object getElementAt(int index)
          Required by ListModel interface
(package private)  com.virtuosotechnologies.asaph.model.opsemantics.PredicateSemantics getFilter()
           
(package private)  java.lang.String getNameForSongID(com.virtuosotechnologies.asaph.model.SongID id)
           
 int getSize()
          Required by ListModel interface
(package private)  int getTotalSize()
          Get the total size including filtered out elements
(package private)  void removeSongID(com.virtuosotechnologies.asaph.model.SongID songID)
          Remove a song from the given list model
(package private)  void setComparator(SongListModel.ItemComparator comparator)
          Set the comparator used to order songs.
(package private)  void setFilter(com.virtuosotechnologies.asaph.model.opsemantics.PredicateSemantics filter)
          This method is okay to be called from outside the AWT thread
(package private)  void setSizeChangeListener(SongListModel.SizeChangeListener listener)
           
(package private)  int updateSongID(com.virtuosotechnologies.asaph.model.SongID songID)
          Notify that a song name has been updated
 
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
 

Field Detail

STR_SongList_SongNotFoundName

private static final java.lang.String STR_SongList_SongNotFoundName

STR_SongList_NoTitleName

private static final java.lang.String STR_SongList_NoTitleName

STR_SongList_DatabaseErrorName

private static final java.lang.String STR_SongList_DatabaseErrorName

database_

private com.virtuosotechnologies.asaph.model.SongDatabase database_

songUtils_

private com.virtuosotechnologies.asaph.modelutils.SongUtils songUtils_

list_

private java.util.List list_

delim_

private com.virtuosotechnologies.lib.base.LinkedObject delim_

collator_

private java.text.Collator collator_

curComparator_

private SongListModel.ItemComparator curComparator_

filterPredicate_

private com.virtuosotechnologies.asaph.model.opsemantics.PredicateSemantics filterPredicate_

sizeChangeListener_

private SongListModel.SizeChangeListener sizeChangeListener_

totalSize_

private int totalSize_
Constructor Detail

SongListModel

SongListModel(com.virtuosotechnologies.asaph.model.SongDatabase database,
              com.virtuosotechnologies.asaph.modelutils.SongUtils songUtils,
              SongListModel.ItemComparator comparator,
              com.virtuosotechnologies.asaph.model.opsemantics.PredicateSemantics filter)
Constructor

Method Detail

getElementAt

public java.lang.Object getElementAt(int index)
Required by ListModel interface


getSize

public int getSize()
Required by ListModel interface


getTotalSize

int getTotalSize()
Get the total size including filtered out elements


addSongID

int addSongID(com.virtuosotechnologies.asaph.model.SongID songID)
Add a song id to the list model


addSongIDs

void addSongIDs(java.util.Collection songIDs)
Add a collection of song ids to the list model


clear

void clear()
Clear the whole list


findSongIndex

private int findSongIndex(com.virtuosotechnologies.asaph.model.SongID songID)

findItem

private SongListModel.Item findItem(com.virtuosotechnologies.asaph.model.SongID songID)

removeSongID

void removeSongID(com.virtuosotechnologies.asaph.model.SongID songID)
Remove a song from the given list model


updateSongID

int updateSongID(com.virtuosotechnologies.asaph.model.SongID songID)
Notify that a song name has been updated


getNameForSongID

java.lang.String getNameForSongID(com.virtuosotechnologies.asaph.model.SongID id)

setComparator

void setComparator(SongListModel.ItemComparator comparator)
Set the comparator used to order songs. A null comparator makes the ordering undefined.


getComparator

SongListModel.ItemComparator getComparator()
Get the comparator currently used to order songs. A null comparator makes the ordering undefined.


setFilter

void setFilter(com.virtuosotechnologies.asaph.model.opsemantics.PredicateSemantics filter)
This method is okay to be called from outside the AWT thread


getFilter

com.virtuosotechnologies.asaph.model.opsemantics.PredicateSemantics getFilter()

setSizeChangeListener

void setSizeChangeListener(SongListModel.SizeChangeListener listener)