org.crosswire.bibledesktop.display.proxy
Class ProxyBookDataDisplay

java.lang.Object
  extended by org.crosswire.bibledesktop.display.proxy.ProxyBookDataDisplay
All Implemented Interfaces:
BookDataDisplay
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 functionallity component by component.

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.

Version:
$Id: ProxyBookDataDisplay.java,v 1.7 2005/03/06 04:55:44 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence

Field Summary
private  BookDataDisplay proxy
          The component to which we proxy
 
Constructor Summary
ProxyBookDataDisplay(BookDataDisplay proxy)
          Setup the proxy
 
Method Summary
 void addURLEventListener(URLEventListener listener)
          Add a listener for when someone clicks on a browser 'link'
 void copy()
          Copy the selection to the clipboard
 Book getBook()
          Accessor for the Book used in the current display, or null if we are not displaying anything.
 Component getComponent()
          Accessor for the Swing component
 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 refresh()
          Cause the BookData to be re-displayed.
 void removeURLEventListener(URLEventListener listener)
          Remove a listener for when someone clicks on a browser 'link'
 void setBookData(Book book, Key key)
          Set the BookData to be displayed.
 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.

addURLEventListener

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

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

removeURLEventListener

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

Specified by:
removeURLEventListener 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

setBookData

public void setBookData(Book book,
                        Key key)
Description copied from interface: BookDataDisplay
Set the BookData to be displayed. The data to be displayed is specified as a book and key rather than the more obvious BookData (the result of reading a book 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:
book - The Book to read data from
key - The key to read from the given book

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

getBook

public Book getBook()
Description copied from interface: BookDataDisplay
Accessor for the Book used in the current display, or null if we are not displaying anything.

Specified by:
getBook in interface BookDataDisplay
Returns:
The current book

Copyright ? 2003-2004