org.crosswire.bibledesktop.book
Class BibleComboBoxModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by org.crosswire.bibledesktop.book.BibleComboBoxModel
All Implemented Interfaces:
Serializable, ComboBoxModel, ListModel

public class BibleComboBoxModel
extends AbstractListModel
implements ComboBoxModel

A ComboBoxModel for selecting book/chapter/verse.

Author:
Joe Walker [joe at eireneh dot com]
See Also:
for license details. The copyright to this program is held by it's authors., Serialized Form

Field Summary
protected  int level
          Are we a book, chapter or verse selector
static int LEVEL_BOOK
          For when the we are a book level combo
static int LEVEL_CHAPTER
          For when the we are a chapter level combo
static int LEVEL_VERSE
          For when the we are a verse level combo
private static Logger log
          The log stream
private  Object selected
          What is currently selected?
private static long serialVersionUID
          Serialization ID
private  BibleComboBoxModelSet set
          Shared settings
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
protected BibleComboBoxModel(BibleComboBoxModelSet set, int level)
          Simple ctor for choosing verses
 
Method Summary
protected  void fireContentsChanged(Object source, int index0, int index1)
           
 Object getElementAt(int index)
           
 Object getSelectedItem()
           
 int getSize()
           
 void setBook(int book)
          Accessor for the book
 void setChapter(int chapter)
          Accessor for the chapter
 void setSelectedItem(Object selected)
           
 void setVerse(int verse)
          Accessor for the chapter
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, 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

log

private static final Logger log
The log stream


LEVEL_BOOK

public static final int LEVEL_BOOK
For when the we are a book level combo

See Also:
Constant Field Values

LEVEL_CHAPTER

public static final int LEVEL_CHAPTER
For when the we are a chapter level combo

See Also:
Constant Field Values

LEVEL_VERSE

public static final int LEVEL_VERSE
For when the we are a verse level combo

See Also:
Constant Field Values

set

private transient BibleComboBoxModelSet set
Shared settings


selected

private transient Object selected
What is currently selected?


level

protected int level
Are we a book, chapter or verse selector


serialVersionUID

private static final long serialVersionUID
Serialization ID

See Also:
Constant Field Values
Constructor Detail

BibleComboBoxModel

protected BibleComboBoxModel(BibleComboBoxModelSet set,
                             int level)
Simple ctor for choosing verses

Method Detail

setSelectedItem

public void setSelectedItem(Object selected)
Specified by:
setSelectedItem in interface ComboBoxModel

getSelectedItem

public Object getSelectedItem()
Specified by:
getSelectedItem in interface ComboBoxModel

getSize

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

getElementAt

public Object getElementAt(int index)
Specified by:
getElementAt in interface ListModel

setBook

public void setBook(int book)
Accessor for the book


setChapter

public void setChapter(int chapter)
Accessor for the chapter


setVerse

public void setVerse(int verse)
Accessor for the chapter


fireContentsChanged

protected void fireContentsChanged(Object source,
                                   int index0,
                                   int index1)
Overrides:
fireContentsChanged in class AbstractListModel

Copyright ยจ 2003-2007