|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractListModel
org.crosswire.bibledesktop.passage.PassageListModel
public class PassageListModel
The PassageListModel class gives access to a Passage via a ListModel.
Distribution Licence: JSword is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. The License is available on the internet here, or by writing to: Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA The copyright to this program is held by it's authors. |
Licence
,
JList
,
AbstractListModel
,
Serialized FormField Summary | |
---|---|
private PassageListType |
mode
Are we modelling in groups or individually |
private Passage |
ref
The Passage that we are modelling |
private RestrictionType |
restrict
If we are modelling in groups, do we break at chapter/book boundries |
private static long |
serialVersionUID
Serialization ID |
private int |
size
We need to cache the passage size because we need to report on changed ranges, when informed by the passage that has already changed |
Fields inherited from class javax.swing.AbstractListModel |
---|
listenerList |
Constructor Summary | |
---|---|
PassageListModel()
Create a PassageListModel (in verse mode) from a Passage. |
|
PassageListModel(Passage ref)
Create a PassageListModel (in verse mode) from a Passage. |
|
PassageListModel(Passage ref,
PassageListType mode,
RestrictionType restrict)
Create a PassageListModel from a Passage. |
Method Summary | |
---|---|
Object |
getElementAt(int index)
Returns the value at the specified index. |
PassageListType |
getMode()
Return the mode we are operating in. |
Passage |
getPassage()
Accessor for the current passage |
RestrictionType |
getRestriction()
Return the current txtRestrict |
int |
getSize()
Returns the length of the list. |
private void |
recomputeSize()
Recompute the size from the reference. |
void |
setMode(PassageListType mode)
Change the mode we are operating in. |
void |
setPassage(Passage newRef)
Accessor for the current passage |
void |
setRestriction(RestrictionType restrict)
Change the restrictions we are using when the mode is LIST_RANGES. |
void |
versesAdded(PassageEvent ev)
Sent after stuff has been added to the Passage. |
void |
versesChanged(PassageEvent ev)
Sent after verses have been simultaneously added and removed from the Passage. |
void |
versesRemoved(PassageEvent ev)
Sent after stuff has been removed from the Passage. |
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 |
---|
private Passage ref
private int size
private PassageListType mode
private RestrictionType restrict
private static final long serialVersionUID
Constructor Detail |
---|
public PassageListModel()
IllegalArgumentException
- If the mode is illegalpublic PassageListModel(Passage ref)
ref
- The reference that we are modeling
IllegalArgumentException
- If the mode is illegalpublic PassageListModel(Passage ref, PassageListType mode, RestrictionType restrict)
ref
- The reference that we are modelingmode
- The verse/range moderestrict
- When we are in range mode, do we chop at chapter boundries
IllegalArgumentException
- If the mode is illegalMethod Detail |
---|
public final void setMode(PassageListType mode)
mode
- The new operation mode
IllegalArgumentException
- If the mode is illegalpublic PassageListType getMode()
public void setRestriction(RestrictionType restrict)
RESTRICT_NONE
, RESTRICT_BOOK
or
RESTRICT_CHAPTER
restrict
- The new restrictionspublic RestrictionType getRestriction()
public int getSize()
getSize
in interface ListModel
private void recomputeSize()
public Object getElementAt(int index)
getElementAt
in interface ListModel
index
- The index (based at 0) of the element to fetch
public void versesAdded(PassageEvent ev)
versesAdded
in interface PassageListener
ev
- a PassageEvent encapuslating the event informationpublic void versesRemoved(PassageEvent ev)
versesRemoved
in interface PassageListener
ev
- a PassageEvent encapuslating the event informationpublic void versesChanged(PassageEvent ev)
versesChanged
in interface PassageListener
ev
- a PassageEvent encapuslating the event informationpublic final void setPassage(Passage newRef)
public Passage getPassage()
|
Copyright ? 2003-2004 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |