org.crosswire.bibledesktop.display
Class ProxyBookDataDisplay

java.lang.Object
  extended by org.crosswire.bibledesktop.display.ProxyBookDataDisplay
All Implemented Interfaces:
PropertyChangeListener, EventListener, BookDataDisplay, BookProvider
Direct Known Subclasses:
ScrolledBookDataDisplay

public class ProxyBookDataDisplay
extends Object
implements BookDataDisplay

An implementation of BookDataDisplay that simply proxies all requests to an underlying BookDataDisplay.

Useful for chaining a few BookDataDisplays together to add functionality component by component.

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

Field Summary
private  BookDataDisplay proxy
          The component to which we proxy
 
Fields inherited from interface org.crosswire.bibledesktop.display.BookDataDisplay
COMPARE_BOOKS
 
Constructor Summary
ProxyBookDataDisplay(BookDataDisplay proxy)
          Setup the proxy
 
Method Summary
 void addKeyChangeListener(KeyChangeListener listener)
          Add a listener for when the key changes.
 void addURIEventListener(URIEventListener listener)
          Add a listener for when someone clicks on a browser 'link'
 void clearBookData()
          Clear any BookData that is displayed.
 void copy()
          Copy the selection to the clipboard
 Book[] getBooks()
          Provide books.
 Component getComponent()
          Accessor for the Swing component
 Book getFirstBook()
          Provide the first book.
 Key getKey()
          The Book Key that we are displaying, or null if we are not displaying anything
protected  BookDataDisplay getProxy()
          Accessor for the proxy
 void propertyChange(PropertyChangeEvent evt)
           
 void refresh()
          Cause the BookData to be re-displayed.
 void removeKeyChangeListener(KeyChangeListener listener)
          Remove a listener for when the key changes.
 void removeURIEventListener(URIEventListener listener)
          Remove a listener for when someone clicks on a browser 'link'
 void setBookData(Book[] books, Key key)
          Set the BookData to be displayed.
 void setCompareBooks(boolean compare)
          Establish whether books in the book array should be compared.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

proxy

private BookDataDisplay proxy
The component to which we proxy

Constructor Detail

ProxyBookDataDisplay

public ProxyBookDataDisplay(BookDataDisplay proxy)
Setup the proxy

Method Detail

getProxy

protected BookDataDisplay getProxy()
Accessor for the proxy

Returns:
Returns the proxy.

addKeyChangeListener

public void addKeyChangeListener(KeyChangeListener listener)
Description copied from interface: BookDataDisplay
Add a listener for when the key changes.

Specified by:
addKeyChangeListener in interface BookDataDisplay

removeKeyChangeListener

public void removeKeyChangeListener(KeyChangeListener listener)
Description copied from interface: BookDataDisplay
Remove a listener for when the key changes.

Specified by:
removeKeyChangeListener in interface BookDataDisplay

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Specified by:
propertyChange in interface PropertyChangeListener

addURIEventListener

public void addURIEventListener(URIEventListener listener)
Description copied from interface: BookDataDisplay
Add a listener for when someone clicks on a browser 'link'

Specified by:
addURIEventListener in interface BookDataDisplay
Parameters:
listener - The listener to add

removeURIEventListener

public void removeURIEventListener(URIEventListener listener)
Description copied from interface: BookDataDisplay
Remove a listener for when someone clicks on a browser 'link'

Specified by:
removeURIEventListener in interface BookDataDisplay
Parameters:
listener - The listener to remove

copy

public void copy()
Description copied from interface: BookDataDisplay
Copy the selection to the clipboard

Specified by:
copy in interface BookDataDisplay

getComponent

public Component getComponent()
Description copied from interface: BookDataDisplay
Accessor for the Swing component

Specified by:
getComponent in interface BookDataDisplay

clearBookData

public void clearBookData()
Description copied from interface: BookDataDisplay
Clear any BookData that is displayed. This is equivalent to: setBookData(null, null).

Specified by:
clearBookData in interface BookDataDisplay

setBookData

public void setBookData(Book[] books,
                        Key key)
Description copied from interface: BookDataDisplay
Set the BookData to be displayed. The data to be displayed is specified as a books and key rather than the more obvious BookData (the result of reading books using a key) since some displays may wish so split up the display and only look up smaller sections at a time.

Specified by:
setBookData in interface BookDataDisplay
Parameters:
books - The Books to read data from
key - The key to read from the given book

setCompareBooks

public void setCompareBooks(boolean compare)
Description copied from interface: BookDataDisplay
Establish whether books in the book array should be compared.

Specified by:
setCompareBooks in interface BookDataDisplay

refresh

public void refresh()
Description copied from interface: BookDataDisplay
Cause the BookData to be re-displayed.

Specified by:
refresh in interface BookDataDisplay

toString

public String toString()
Overrides:
toString in class Object

getKey

public Key getKey()
Description copied from interface: BookDataDisplay
The Book Key that we are displaying, or null if we are not displaying anything

Specified by:
getKey in interface BookDataDisplay
Returns:
The current key

getBooks

public Book[] getBooks()
Description copied from interface: BookProvider
Provide books.

Specified by:
getBooks in interface BookProvider
Returns:
the books

getFirstBook

public Book getFirstBook()
Description copied from interface: BookProvider
Provide the first book.

Specified by:
getFirstBook in interface BookProvider
Returns:
the first book

Copyright ? 2003-2011