net.sourceforge.wohenchan
Class PagingListModel

java.lang.Object
  |
  +--javax.swing.AbstractListModel
        |
        +--net.sourceforge.wohenchan.PagingListModel
All Implemented Interfaces:
javax.swing.ListModel, java.io.Serializable

public class PagingListModel
extends javax.swing.AbstractListModel

PagingListModel is a ListModel decorator which presents a subset of the list elements in the underlying (decorated) model.

Version:
$Name: $ $Date: 2003/09/14 08:26:56 $
Author:
$Author: wtanaka $
See Also:
Serialized Form

Field Summary
private  javax.swing.ListModel m_inner
          This is the underlying ListModel which actually contains the data.
private  int m_pagedSize
          The size of the listmodel presented by this class.
private  int m_startIndex
          The index, into the underlying ListModel (m_inner) to present as element 0 to the outside world by this class.
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
PagingListModel(javax.swing.ListModel inner)
          Constructs a PagingListModel
 
Method Summary
protected  void fireContentsChanged(java.lang.Object source, int index0, int index1)
          This is overridden in an attempt to fix wohenchan bug 117453.
protected  void fireIntervalAdded(java.lang.Object source, int index0, int index1)
          This is overridden in an attempt to fix wohenchan bug 117453.
protected  void fireIntervalRemoved(java.lang.Object source, int index0, int index1)
          This is overridden in an attempt to fix wohenchan bug 117453.
 java.lang.Object getElementAt(int index)
           
 int getSize()
           
 void setPagedSize(int size)
          Sets the max size of the model that this class presents to the outside world.
 void setStartIndex(int index)
          Sets the index, in the underlying list model, which is used as element 0 for this list model.
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_inner

private javax.swing.ListModel m_inner
This is the underlying ListModel which actually contains the data.


m_startIndex

private int m_startIndex
The index, into the underlying ListModel (m_inner) to present as element 0 to the outside world by this class.


m_pagedSize

private int m_pagedSize
The size of the listmodel presented by this class.

Constructor Detail

PagingListModel

public PagingListModel(javax.swing.ListModel inner)
Constructs a PagingListModel

Parameters:
inner - WHERE (inner != null) the underlying ListModel which actually contains the data.
Method Detail

getSize

public int getSize()

getElementAt

public java.lang.Object getElementAt(int index)

setStartIndex

public void setStartIndex(int index)
Sets the index, in the underlying list model, which is used as element 0 for this list model.

Parameters:
index - the index, into the underlying (decorated) list model which is returned as element 0.

setPagedSize

public void setPagedSize(int size)
Sets the max size of the model that this class presents to the outside world. If this is set to be negative, it will be ignored, and this ListModel will not limit the size based on this property.

Parameters:
size - the maximum size that this list model will return from getSize()

fireContentsChanged

protected void fireContentsChanged(java.lang.Object source,
                                   int index0,
                                   int index1)
This is overridden in an attempt to fix wohenchan bug 117453. http://sourceforge.net/bugs/?func=detailbug&bug_id=117453&group_id=5614

Overrides:
fireContentsChanged in class javax.swing.AbstractListModel

fireIntervalAdded

protected void fireIntervalAdded(java.lang.Object source,
                                 int index0,
                                 int index1)
This is overridden in an attempt to fix wohenchan bug 117453. http://sourceforge.net/bugs/?func=detailbug&bug_id=117453&group_id=5614

Overrides:
fireIntervalAdded in class javax.swing.AbstractListModel

fireIntervalRemoved

protected void fireIntervalRemoved(java.lang.Object source,
                                   int index0,
                                   int index1)
This is overridden in an attempt to fix wohenchan bug 117453. http://sourceforge.net/bugs/?func=detailbug&bug_id=117453&group_id=5614

Overrides:
fireIntervalRemoved in class javax.swing.AbstractListModel