[jsword-devel] API tweaks from GUI tidy up

Joe Walker jsword-devel@crosswire.org
Sun, 09 Nov 2003 12:55:47 +0000


Hi,

To simplify the UI, I'd like to merge the Dictionary and Commentary 
panes into a reference pane, and as part of doing that I think there are 
some API changes that could prove useful.

Most importantly I have made Passage implement Key which I should 
probably have done ages ago, I've moved Key into the Passage package to 
stop any cyclic dependencies.
This simple change makes the Bible interface virtually the same as Book.

Commentary has a hasData(Verse) method that could be usefully 
generalized to hasData(Key) and promoted to Book. This is a 
generalization so it breaks nothing. Now Commentary is virtually the 
same as Book too.

Also I could find no examples of use of
     SortedSet Dictionary.getIndex(String startswith)
that actually passed in a meaning full string, so I propose simplifying to:
     SortedSet Dictionary.getIndex()
And now it is something that all books can implement.

The above may sound big, however the APIExamples class is virtually 
unchanged so I don't think it is that huge.

The good news from this is that a reference pane can treat all reference 
works in a similar way.

Any comments?

Joe.