org.crosswire.bibledesktop.book
Class MultiBookPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JSplitPane
                  extended by org.crosswire.bibledesktop.book.MultiBookPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, BookDataDisplay

public class MultiBookPane
extends JSplitPane
implements BookDataDisplay

Builds a panel on which all the non-Bible books and their entries are visible.

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

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JSplitPane
JSplitPane.AccessibleJSplitPane
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  Book book
           
private  JList bookList
           
private  Component commentaryPicker
           
private  JList dictionaryKeyList
           
private  Component dictionaryKeyScroller
           
private  BookDataDisplay display
          The display of OSIS data
private  Component genBookKeyScroller
           
private  JTree genBookKeyTree
           
private static Logger log
          The log stream
private static long serialVersionUID
          Serialization ID
protected  BibleComboBoxModelSet set
           
private  JSplitPane sptMain
           
 
Fields inherited from class javax.swing.JSplitPane
BOTTOM, CONTINUOUS_LAYOUT_PROPERTY, continuousLayout, DIVIDER, DIVIDER_LOCATION_PROPERTY, DIVIDER_SIZE_PROPERTY, dividerSize, HORIZONTAL_SPLIT, LAST_DIVIDER_LOCATION_PROPERTY, lastDividerLocation, LEFT, leftComponent, ONE_TOUCH_EXPANDABLE_PROPERTY, oneTouchExpandable, orientation, ORIENTATION_PROPERTY, RESIZE_WEIGHT_PROPERTY, RIGHT, rightComponent, TOP, VERTICAL_SPLIT
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MultiBookPane()
          Setup the GUI
 
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
private  Component createBookPicker()
          Create a book picker of all non-bibles
private  Component createCommentaryPicker()
          Build a tree for a GenBook
private  Component createDictionaryPicker()
          Build a tree for a GenBook
private  Component createGenBookPicker()
          Build a tree for a GenBook
 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
private  void init()
          GUI initialiser
(package private)  void newBook()
          Called when someone selects a new Dictionary
(package private)  void newEntry()
          Called when someone selects a new entry from the current dictionary
private  void readObject(ObjectInputStream is)
          Serialization support.
 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 selectBook(Book selectedBook)
           
(package private)  void selected()
          Something has been (un)selected in the tree
 void setBookData(Book book, Key key)
          Set the BookData to be displayed.
 void setKey(Key key)
          Accessor for the current passage
 void setWord(String data)
          See if the current dictionary has a mention of the word in question.
(package private)  void updateDisplay()
           
 
Methods inherited from class javax.swing.JSplitPane
addImpl, getAccessibleContext, getBottomComponent, getDividerLocation, getDividerSize, getLastDividerLocation, getLeftComponent, getMaximumDividerLocation, getMinimumDividerLocation, getOrientation, getResizeWeight, getRightComponent, getTopComponent, getUI, getUIClassID, isContinuousLayout, isOneTouchExpandable, isValidateRoot, paintChildren, paramString, remove, remove, removeAll, resetToPreferredSizes, setBottomComponent, setContinuousLayout, setDividerLocation, setDividerLocation, setDividerSize, setLastDividerLocation, setLeftComponent, setOneTouchExpandable, setOrientation, setResizeWeight, setRightComponent, setTopComponent, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

display

private transient BookDataDisplay display
The display of OSIS data


book

private transient Book book

set

protected transient BibleComboBoxModelSet set

commentaryPicker

private Component commentaryPicker

genBookKeyScroller

private Component genBookKeyScroller

genBookKeyTree

private JTree genBookKeyTree

bookList

private JList bookList

sptMain

private JSplitPane sptMain

dictionaryKeyScroller

private Component dictionaryKeyScroller

dictionaryKeyList

private JList dictionaryKeyList

log

private static final Logger log
The log stream


serialVersionUID

private static final long serialVersionUID
Serialization ID

See Also:
Constant Field Values
Constructor Detail

MultiBookPane

public MultiBookPane()
Setup the GUI

Method Detail

init

private void init()
GUI initialiser


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

getComponent

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

Specified by:
getComponent in interface BookDataDisplay

copy

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

Specified by:
copy in interface BookDataDisplay

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

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

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

setWord

public void setWord(String data)
See if the current dictionary has a mention of the word in question. LATER(joe): add a background task to highlight other dictionaries that have the word.


setKey

public void setKey(Key key)
Accessor for the current passage


selectBook

public void selectBook(Book selectedBook)

createBookPicker

private Component createBookPicker()
Create a book picker of all non-bibles

Returns:
The scrollable picker

createCommentaryPicker

private Component createCommentaryPicker()
Build a tree for a GenBook


createDictionaryPicker

private Component createDictionaryPicker()
Build a tree for a GenBook


createGenBookPicker

private Component createGenBookPicker()
Build a tree for a GenBook


newBook

final void newBook()
Called when someone selects a new Dictionary


updateDisplay

final void updateDisplay()

newEntry

final void newEntry()
Called when someone selects a new entry from the current dictionary


selected

void selected()
Something has been (un)selected in the tree


readObject

private void readObject(ObjectInputStream is)
                 throws IOException,
                        ClassNotFoundException
Serialization support.

Parameters:
is -
Throws:
IOException
ClassNotFoundException

Copyright ยจ 2003-2006