public class TextPaneBookDataDisplay extends Object implements BookDataDisplay, HyperlinkListener
for license details.| Modifier and Type | Field and Description |
|---|---|
private org.crosswire.jsword.book.BookData |
bdata
The book data being shown.
|
private boolean |
compareBooks
Whether the books should be compared.
|
private org.crosswire.common.xml.Converter |
converter
To convert OSIS to HTML
|
private static String |
DOUBLE_SLASH |
private static String |
HYPERLINK_STYLE |
private int |
lastLength
length of last enter event
|
private int |
lastStart
location of last enter event
|
private EventListenerList |
listenerList
The listeners for handling URIs
|
protected static org.slf4j.Logger |
log
The log stream
|
private static String |
RELATIVE_URI_PROTOCOL |
private static String |
SCROLL_TO_URI |
private Style |
style
A sytle used to underline a hyperlink
|
private StyledDocument |
styledDoc
The styled document of the JTextPane.
|
private JTextPane |
txtView
The display component
|
COMPARE_BOOKS| Constructor and Description |
|---|
TextPaneBookDataDisplay()
Simple ctor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addKeyChangeListener(KeyChangeListener listener)
Add a listener for when the key changes.
|
void |
addMouseListener(MouseListener li)
Forward the mouse listener to our child components
|
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
|
void |
fireActivateURI(URIEvent e)
Notify the listeners that the hyperlink (URI) has been activated.
|
void |
fireEnterURI(URIEvent e)
Notify the listeners that the hyperlink (URI) has been entered.
|
void |
fireLeaveURI(URIEvent e)
Notify the listeners that the hyperlink (URI) has been left.
|
org.crosswire.jsword.book.Book[] |
getBooks() |
Component |
getComponent()
Accessor for the Swing component
|
org.crosswire.jsword.book.Book |
getFirstBook() |
org.crosswire.jsword.passage.Key |
getKey()
The Book Key that we are displaying, or null if we are not displaying
anything
|
private String[] |
getParts(String reference) |
void |
hyperlinkUpdate(HyperlinkEvent ev) |
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 |
removeMouseListener(MouseListener li)
Forward the mouse listener to our child components
|
void |
removeURIEventListener(URIEventListener listener)
Remove a listener for when someone clicks on a browser 'link'
|
void |
setBookData(org.crosswire.jsword.book.Book[] books,
org.crosswire.jsword.passage.Key key)
Set the BookData to be displayed.
|
void |
setCompareBooks(boolean compare)
Establish whether books in the book array should be compared.
|
private static final String HYPERLINK_STYLE
private static final String DOUBLE_SLASH
private static final String SCROLL_TO_URI
private static final String RELATIVE_URI_PROTOCOL
private org.crosswire.jsword.book.BookData bdata
private boolean compareBooks
private org.crosswire.common.xml.Converter converter
private JTextPane txtView
private Style style
private int lastStart
private int lastLength
private StyledDocument styledDoc
private EventListenerList listenerList
protected static final org.slf4j.Logger log
public void clearBookData()
BookDataDisplaysetBookData(null, null).clearBookData in interface BookDataDisplaypublic void setBookData(org.crosswire.jsword.book.Book[] books,
org.crosswire.jsword.passage.Key key)
BookDataDisplaysetBookData in interface BookDataDisplaybooks - The Books to read data fromkey - The key to read from the given bookpublic void setCompareBooks(boolean compare)
BookDataDisplaysetCompareBooks in interface BookDataDisplaypublic void refresh()
BookDataDisplayrefresh in interface BookDataDisplaypublic void hyperlinkUpdate(HyperlinkEvent ev)
hyperlinkUpdate in interface HyperlinkListenerpublic void propertyChange(PropertyChangeEvent evt)
propertyChange in interface PropertyChangeListenerprivate String[] getParts(String reference) throws MalformedURLException
MalformedURLExceptionpublic Component getComponent()
BookDataDisplaygetComponent in interface BookDataDisplaypublic void copy()
BookDataDisplaycopy in interface BookDataDisplaypublic void addKeyChangeListener(KeyChangeListener listener)
BookDataDisplayaddKeyChangeListener in interface BookDataDisplaypublic void removeKeyChangeListener(KeyChangeListener listener)
BookDataDisplayremoveKeyChangeListener in interface BookDataDisplaypublic void addURIEventListener(URIEventListener listener)
BookDataDisplayaddURIEventListener in interface BookDataDisplaylistener - The listener to addpublic void removeURIEventListener(URIEventListener listener)
BookDataDisplayremoveURIEventListener in interface BookDataDisplaylistener - The listener to removepublic void fireActivateURI(URIEvent e)
e - the eventEventListenerListpublic void fireEnterURI(URIEvent e)
e - the eventEventListenerListpublic void fireLeaveURI(URIEvent e)
e - the eventEventListenerListpublic void removeMouseListener(MouseListener li)
public void addMouseListener(MouseListener li)
public org.crosswire.jsword.passage.Key getKey()
BookDataDisplaygetKey in interface BookDataDisplaypublic org.crosswire.jsword.book.Book[] getBooks()
getBooks in interface org.crosswire.jsword.book.BookProviderpublic org.crosswire.jsword.book.Book getFirstBook()
getFirstBook in interface org.crosswire.jsword.book.BookProvider