com.zfqjava.swing
Class JSideBar

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.zfqjava.swing.JSidePane
                          |
                          +--com.zfqjava.swing.JSideBar
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JSideBar
extends JSidePane
implements javax.accessibility.Accessible

JSideBar provides a side bar.

See Also:
ValueAction, Serialized Form

Inner Class Summary
protected  class JSideBar.AccessibleJSideBar
          This class implements accessibility support for the JSideBar class.
 
Inner classes inherited from class com.zfqjava.swing.JSidePane
JSidePane.AccessibleJSidePane
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
static int LARGE_ICON_VIEW_MODE
          Identifies the large icon view mode.
static int LIST_VIEW_MODE
          Identifies the list view mode.
static int SMALL_ICON_VIEW_MODE
          Identifies the small icon view mode.
static int THUMBNAILS_VIEW_MODE
          Identifies the thumbnails view mode.
 
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
JSideBar()
          Constructs a JSideBar with an empty model.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Adds an action listener to the JSideBar.
 void addGroup(javax.swing.ListModel model)
          Adds the group listmodel.
 void addGroup(javax.swing.ListModel model, javax.swing.Action action)
          Adds the group componet with the group header action.
 void addGroupAt(javax.swing.ListModel model, javax.swing.Action action, int index)
          Adds the group listmodel at the specify index with the group header action.
protected  javax.swing.JList createList(javax.swing.ListModel model)
          Creates the JList for the specified ListModel.
protected  void fireActionPerformed(java.awt.event.ActionEvent e)
          Notifies all listeners that have registered interest for notification on this event type.
 javax.accessibility.AccessibleContext getAccessibleContext()
          Gets the AccessibleContext associated with this JSideBar.
 java.awt.event.ActionListener[] getActionListeners()
          Returns an array of all the action listeners registered on this JSideBar.
 DefaultCellEditor getCellEditor()
          Returns the cell editor for render list item.
 CellProvider getCellProvider()
          Returns the cell provider for renderer and editor.
 DefaultCellRenderer getCellRenderer()
          Returns the cell renderer for render list item.
protected  javax.swing.JList getListAt(int index)
          Returns the JList at the specified group index.
 java.lang.Object getSelectedItem()
          Returns the selected item.
 int getViewMode()
          Gets the JSideBar display mode in use.
protected  int indexOfListModel(javax.swing.ListModel model)
          Returns the group index for the specified list model.
protected  java.lang.String paramString()
          Returns a string representation of this JSideBar.
 void removeActionListener(java.awt.event.ActionListener listener)
          Removes the specified action listener from the JSideBar.
 void removeGroup(javax.swing.ListModel model)
          Removes the group listmodel.
 void setCellEditor(DefaultCellEditor cellEditor)
          Sets the cell editor for render list item.
 void setCellProvider(CellProvider cellProvider)
          Sets the cell provider for renderer and editor.
 void setCellRenderer(DefaultCellRenderer cellRenderer)
          Sets the cell renderer for render list item.
 void setSelectionMode(int selectionMode)
          Determines whether single-item or multiple-item selections are allowed.
 void setViewMode(int mode)
          Sets the JSideBar display mode.
 void updateUI()
           
 
Methods inherited from class com.zfqjava.swing.JSidePane
addGroup, addGroup, addGroupAt, addListSelectionListener, createDefaultButton, createSelectionModel, fireSelectionValueChanged, getActionAt, getComponentAt, getGroupCount, getListSelectionListeners, getSelectedComponent, getSelectedIndex, getSelectionMode, getSelectionModel, indexOfAction, indexOfComponent, paintComponent, removeAllGroup, removeGroup, removeGroupAt, removeListSelectionListener, setActionAt, setComponentAt, setLayout, setSelectedComponent, setSelectedIndex, setSelectionModel
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SMALL_ICON_VIEW_MODE

public static final int SMALL_ICON_VIEW_MODE
Identifies the small icon view mode.

LARGE_ICON_VIEW_MODE

public static final int LARGE_ICON_VIEW_MODE
Identifies the large icon view mode.

LIST_VIEW_MODE

public static final int LIST_VIEW_MODE
Identifies the list view mode.

THUMBNAILS_VIEW_MODE

public static final int THUMBNAILS_VIEW_MODE
Identifies the thumbnails view mode.
Constructor Detail

JSideBar

public JSideBar()
Constructs a JSideBar with an empty model.
Method Detail

updateUI

public void updateUI()
Overrides:
updateUI in class JSidePane

setCellRenderer

public void setCellRenderer(DefaultCellRenderer cellRenderer)
Sets the cell renderer for render list item.
Parameters:
cellRenderer - the cell renderer
See Also:
getCellRenderer()

getCellRenderer

public DefaultCellRenderer getCellRenderer()
Returns the cell renderer for render list item.
Returns:
the cell renderer
See Also:
setCellRenderer(com.zfqjava.swing.cell.DefaultCellRenderer)

setCellEditor

public void setCellEditor(DefaultCellEditor cellEditor)
Sets the cell editor for render list item.
Parameters:
cellEditor - the cell editor
See Also:
getCellEditor()

getCellEditor

public DefaultCellEditor getCellEditor()
Returns the cell editor for render list item.
Returns:
the cell editor
See Also:
setCellEditor(com.zfqjava.swing.cell.DefaultCellEditor)

setCellProvider

public void setCellProvider(CellProvider cellProvider)
Sets the cell provider for renderer and editor.
Parameters:
cellProvider - the cell provider
See Also:
getCellProvider()

getCellProvider

public CellProvider getCellProvider()
Returns the cell provider for renderer and editor.
Returns:
the cell provider
See Also:
setCellProvider

setViewMode

public void setViewMode(int mode)
Sets the JSideBar display mode.
Parameters:
mode - one of 4 legal values:
  • JSideBar.SMALL_ICON_VIEW_MODE
  • JSideBar.LARGE_ICON_VIEW_MODE
  • JSideBar.LIST_VIEW_MODE
  • JSideBar.THUMBNAILS_VIEW_MODE
Throws:
java.lang.IllegalArgumentException - if the mode illegal

getViewMode

public int getViewMode()
Gets the JSideBar display mode in use.
Returns:
the display mode in use, one of 4 legal values:
  • JSideBar.SMALL_ICON_VIEW_MODE
  • JSideBar.LARGE_ICON_VIEW_MODE
  • JSideBar.LIST_VIEW_MODE
  • JSideBar.THUMBNAILS_VIEW_MODE

setSelectionMode

public void setSelectionMode(int selectionMode)
Description copied from class: JSidePane
Determines whether single-item or multiple-item selections are allowed. The following selectionMode values are allowed:
Overrides:
setSelectionMode in class JSidePane
Following copied from class: com.zfqjava.swing.JSidePane
Parameters:
selectionMode - an integer specifying the type of selections that are permissible
See Also:
JSidePane.getSelectionMode()

addGroup

public void addGroup(javax.swing.ListModel model)
Adds the group listmodel.
Parameters:
model - the listmodel to add

addGroup

public void addGroup(javax.swing.ListModel model,
                     javax.swing.Action action)
Adds the group componet with the group header action.
Parameters:
model - the group listmodel
action - the group action

addGroupAt

public void addGroupAt(javax.swing.ListModel model,
                       javax.swing.Action action,
                       int index)
Adds the group listmodel at the specify index with the group header action.
Parameters:
model - the listmodel to add
action - the group action
index - the listmodel index
Throws:
java.lang.IndexOutOfBoundsException -  

removeGroup

public void removeGroup(javax.swing.ListModel model)
Removes the group listmodel.
Parameters:
model - the listmodel to remove

createList

protected javax.swing.JList createList(javax.swing.ListModel model)
Creates the JList for the specified ListModel.
Parameters:
mode - the list model
Returns:
the JList

getListAt

protected javax.swing.JList getListAt(int index)
Returns the JList at the specified group index.
Returns:
the JList
See Also:
JSidePane.getComponentAt(int)

indexOfListModel

protected int indexOfListModel(javax.swing.ListModel model)
Returns the group index for the specified list model.
Parameters:
mode - the list model
Returns:
the group index

getSelectedItem

public java.lang.Object getSelectedItem()
Returns the selected item.
Returns:
the selected item

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Adds an action listener to the JSideBar.
Parameters:
listener - the listener to add
See Also:
JSideBar()

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Removes the specified action listener from the JSideBar.
Parameters:
listener - the listener to remove

getActionListeners

public java.awt.event.ActionListener[] getActionListeners()
Returns an array of all the action listeners registered on this JSideBar.
Returns:
all of the JSideBar's ActionListeners or an empty array if no action listeners are currently registered
See Also:
addActionListener(java.awt.event.ActionListener), removeActionListener(java.awt.event.ActionListener)

fireActionPerformed

protected void fireActionPerformed(java.awt.event.ActionEvent e)
Notifies all listeners that have registered interest for notification on this event type.
Parameters:
e - the action event to fire
See Also:
EventListenerList

paramString

protected java.lang.String paramString()
Returns a string representation of this JSideBar. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.
Overrides:
paramString in class JSidePane
Returns:
a string representation of this JSideBar.

getAccessibleContext

public javax.accessibility.AccessibleContext getAccessibleContext()
Gets the AccessibleContext associated with this JSideBar. For JSideBars, the AccessibleContext takes the form of an AccessibleJSideBar. A new AccessibleJSideBar instance is created if necessary.
Specified by:
getAccessibleContext in interface javax.accessibility.Accessible
Overrides:
getAccessibleContext in class JSidePane
Returns:
an AccessibleJSideBar that serves as the AccessibleContext of this JSideBar


Copyright © 2001-2003 Extreme Component, Inc. All rights reserved.