org.crosswire.bibledesktop.passage

## Class KeySidebar

- java.lang.Object
- - java.awt.Component
  - - java.awt.Container
    - - javax.swing.JComponent
      - - javax.swing.JPanel
        - - org.crosswire.bibledesktop.passage.KeySidebar

- All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, EventListener, Accessible, DisplaySelectListener, KeyChangeListener

      public class KeySidebar
      extends JPanel
      implements DisplaySelectListener, KeyChangeListener

  A list view of a key range list.
  Author:
    DM Smith
  See Also:
    `for license details.`, 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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private CWAction` | `actBlur1`
    `private CWAction` | `actBlur5`
    `private CWAction` | `actDelete`
    `private org.crosswire.jsword.book.Book[]` | `books` The books who's keys we are looking at
    `private org.crosswire.jsword.passage.Key` | `key` The whole key that we are viewing
    `private List<KeyChangeListener>` | `keyChangeListeners` The listener for KeyChangeEvents
    `private JList` | `list`
    `private RangeListModel` | `model`
    `private org.crosswire.jsword.passage.Key` | `partial` The key that is selected
    `private static long` | `serialVersionUID` Serialization ID

    - ### 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

    Constructors
    Constructor and Description
    `KeySidebar(org.crosswire.jsword.book.Book[] books)` Initialize the SplitBookDataDisplay

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addKeyChangeListener(KeyChangeListener listener)` Add a command listener
    `void` | `bookChosen(DisplaySelectEvent ev)` This method is called to indicate that a command has been made.
    `private void` | `doBlur(int amount)` Blur (expand) the current key action by amount verses on each side.
    `void` | `doBlur1()` Blur (expand) the current passage action by one verse on each side.
    `void` | `doBlur5()` Blur (expand) the current key by five verses on each side.
    `void` | `doDeleteSelected()` Remove the selected verses out of this KeySidebar.
    `(package private) void` | `fireKeyChanged(KeyChangeEvent ev)` Inform the command keyChangeListeners
    `org.crosswire.jsword.passage.Key` | `getKey()`
    `private void` | `init()` Create the GUI
    `void` | `keyChanged(KeyChangeEvent ev)` This method is called to indicate that a key has been changed.
    `void` | `passageSelected(DisplaySelectEvent ev)` This method is called to indicate that a command has been made.
    `private void` | `readObject(ObjectInputStream is)` Serialization support.
    `void` | `removeKeyChangeListener(KeyChangeListener listener)` Remove a command listener
    `(package private) void` | `selection()` Someone clicked on a value in the list
    `private void` | `setActive()` Make sure the correct buttons are made active
    `private void` | `setKey(org.crosswire.jsword.passage.Key newKey)`

    - ### 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, getBaseline, getBaselineResizeBehavior, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, 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, 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, transferFocusBackward, transferFocusUpCycle`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### key

          private org.crosswire.jsword.passage.Key key

      The whole key that we are viewing

    - #### partial

          private org.crosswire.jsword.passage.Key partial

      The key that is selected

    - #### books

          private transient org.crosswire.jsword.book.Book[] books

      The books who's keys we are looking at

    - #### keyChangeListeners

          private transient List<KeyChangeListener> keyChangeListeners

      The listener for KeyChangeEvents

    - #### list

          private JList list

    - #### model

          private RangeListModel model

    - #### actDelete

          private CWAction actDelete

    - #### actBlur1

          private CWAction actBlur1

    - #### actBlur5

          private CWAction actBlur5

    - #### serialVersionUID

          private static final long serialVersionUID

      Serialization ID
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### KeySidebar

          public KeySidebar(org.crosswire.jsword.book.Book[] books)

      Initialize the SplitBookDataDisplay

  - ### Method Detail

    - #### init

          private void init()

      Create the GUI

    - #### doBlur1

          public void doBlur1()

      Blur (expand) the current passage action by one verse on each side. This bound by the boundaries of the Chapter.

    - #### doBlur5

          public void doBlur5()

      Blur (expand) the current key by five verses on each side. This bound by the boundaries of the Chapter.

    - #### doBlur

          private void doBlur(int amount)

      Blur (expand) the current key action by amount verses on each side. This bound by the default Blur Restriction.
      Parameters:
        `amount` - The amount of blurring

    - #### doDeleteSelected

          public void doDeleteSelected()

      Remove the selected verses out of this KeySidebar.

    - #### getKey

          public org.crosswire.jsword.passage.Key getKey()

    - #### setKey

          private void setKey(org.crosswire.jsword.passage.Key newKey)

    - #### selection

          final void selection()

      Someone clicked on a value in the list

    - #### setActive

          private void setActive()

      Make sure the correct buttons are made active

    - #### passageSelected

          public void passageSelected(DisplaySelectEvent ev)

      Description copied from interface: `DisplaySelectListener`
      This method is called to indicate that a command has been made.
      Specified by:
        `passageSelected` in interface `DisplaySelectListener`
      Parameters:
        `ev` - Describes the change

    - #### bookChosen

          public void bookChosen(DisplaySelectEvent ev)

      Description copied from interface: `DisplaySelectListener`
      This method is called to indicate that a command has been made.
      Specified by:
        `bookChosen` in interface `DisplaySelectListener`
      Parameters:
        `ev` - Describes the change

    - #### keyChanged

          public void keyChanged(KeyChangeEvent ev)

      Description copied from interface: `KeyChangeListener`
      This method is called to indicate that a key has been changed.
      Specified by:
        `keyChanged` in interface `KeyChangeListener`
      Parameters:
        `ev` - Describes the change

    - #### addKeyChangeListener

          public void addKeyChangeListener(KeyChangeListener listener)

      Add a command listener

    - #### removeKeyChangeListener

          public void removeKeyChangeListener(KeyChangeListener listener)

      Remove a command listener

    - #### fireKeyChanged

          final void fireKeyChanged(KeyChangeEvent ev)

      Inform the command keyChangeListeners

    - #### readObject

          private void readObject(ObjectInputStream is)
                           throws IOException,
                                  ClassNotFoundException

      Serialization support.
      Parameters:
        `is` -
      Throws:
        `IOException`
        `ClassNotFoundException`