org.crosswire.bibledesktop.book
Class DictionaryPane

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

public class DictionaryPane
extends JPanel
implements BookDataDisplay

Builds a panel on which all the Dictionaries and their entries are visible.

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: DictionaryPane.java,v 1.17 2005/03/21 02:37:18 dmsmith Exp $
Author:
Joe Walker [joe at eireneh dot com]
See Also:
Licence, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
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  JComboBox cboBooks
           
private  JComboBox cboChaps
           
private  JComboBox cboVerse
           
private  Book dict
           
private  BookDataDisplay display
          The display of OSIS data
private  BookFilter filter
           
private static Logger log
          The log stream
private  JList lstDicts
           
private  JList lstEntries
           
private  BooksComboBoxModel mdlDicts
           
private  JPanel pnlSelect
           
private  JScrollPane scrDicts
           
private  JScrollPane scrDisplay
           
private  JScrollPane scrEntries
           
private static long serialVersionUID
          Serialization ID
protected  BibleComboBoxModelSet set
           
private  JSplitPane sptMain
           
 
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
DictionaryPane()
          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
 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
protected  void newDictionary()
          Called when someone selects a new Dictionary
protected  void newEntry()
          Called when someone selects a new entry from the current dictionary
 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 selectDictionary(Book book)
           
 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.
protected  void updateDisplay()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, 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, isValidateRoot, paint, paintBorder, paintChildren, 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, addImpl, 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, remove, remove, removeAll, 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 BookDataDisplay display
The display of OSIS data


filter

private BookFilter filter

mdlDicts

private BooksComboBoxModel mdlDicts

dict

private Book dict

set

protected BibleComboBoxModelSet set

cboBooks

private JComboBox cboBooks

cboChaps

private JComboBox cboChaps

cboVerse

private JComboBox cboVerse

pnlSelect

private JPanel pnlSelect

scrDicts

private JScrollPane scrDicts

lstDicts

private JList lstDicts

sptMain

private JSplitPane sptMain

scrEntries

private JScrollPane scrEntries

scrDisplay

private JScrollPane scrDisplay

lstEntries

private JList lstEntries

log

private static final Logger log
The log stream


serialVersionUID

private static final long serialVersionUID
Serialization ID

See Also:
Constant Field Values
Constructor Detail

DictionaryPane

public DictionaryPane()
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


selectDictionary

public void selectDictionary(Book book)

newDictionary

protected void newDictionary()
Called when someone selects a new Dictionary


updateDisplay

protected void updateDisplay()

newEntry

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


Copyright ? 2003-2004