TV-Browser 2.7.5 API

util.ui.customizableitems
Class SelectableItemList

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 util.ui.customizableitems.SelectableItemList
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class SelectableItemList
extends JPanel

A class that provides a list that contains selectable items.

Author:
René Mach
See Also:
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 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
SelectableItemList(Object[] currSelection, Object[] allItems)
          Creates the SelectableItemList without the selection buttons.
SelectableItemList(Object[] currSelection, Object[] allItems, boolean showSelectionButtons)
          Creates the SelectableItemList.
SelectableItemList(Object[] currSelection, Object[] allItems, boolean showSelectionButtons, Object[] notSelectableItems)
          Creates the SelectableItemList.
SelectableItemList(Object[] currSelection, Object[] allItems, Object[] notSelectableItems)
          Creates the SelectableItemList without the selection buttons.
 
Method Summary
 void addCenterRendererComponent(Class clazz, SelectableItemRendererCenterComponentIf component)
          Adds the render component that is to be used for the given class or it's super class.
 void addListSelectionListener(ListSelectionListener listener)
           
 void addMouseListener(MouseListener listener)
          Adds a mouse listener to the list.
 void calculateSize()
          Calcualtes the size of the list.
 void clearSelection()
          Clear the selection.
 Object[] getListSelection()
          Current selected Items in the List.
 Object getSelectedValue()
           
 Object[] getSelection()
          Attention: This is not a List with all selected Items in the List.
 void invertSelection()
          Invert the selection
 void removeListSelectionListener(ListSelectionListener listener)
           
 void selectAll()
          Select all items.
 void setEnabled(boolean value)
           
 void setFilterComboBox(JComboBox filterBox)
          Sets the combo box that contains ItemFilters to filter the shown values of the list.
 void setHorizontalScrollBarPolicy(int value)
          Sets if the horizontal scroll policy.
 void setListUI(ListUI ui)
          Sets the UI to be used for the list.
 void setSelectionMode(int selectionMode)
           
 
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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, 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, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectableItemList

public SelectableItemList(Object[] currSelection,
                          Object[] allItems)
Creates the SelectableItemList without the selection buttons.

Parameters:
currSelection - The currently selected Objects.
allItems - All Objects of the list.

SelectableItemList

public SelectableItemList(Object[] currSelection,
                          Object[] allItems,
                          Object[] notSelectableItems)
Creates the SelectableItemList without the selection buttons.

Parameters:
currSelection - The currently selected Objects.
allItems - All Objects of the list.
notSelectableItems - All Objects that could not be selected/deselected
Since:
2.7.2

SelectableItemList

public SelectableItemList(Object[] currSelection,
                          Object[] allItems,
                          boolean showSelectionButtons)
Creates the SelectableItemList.

Parameters:
currSelection - The currently selected Objects.
allItems - All Objects of the list.
showSelectionButtons - If the selection buttons should be shown.

SelectableItemList

public SelectableItemList(Object[] currSelection,
                          Object[] allItems,
                          boolean showSelectionButtons,
                          Object[] notSelectableItems)
Creates the SelectableItemList.

Parameters:
currSelection - The currently selected Objects.
allItems - All Objects of the list.
showSelectionButtons - If the selection buttons should be shown.
notSelectableItems - All Objects that could not be selected/deselected
Since:
2.7.2
Method Detail

addListSelectionListener

public void addListSelectionListener(ListSelectionListener listener)
Parameters:
listener - Add this Listener
Since:
2.5

removeListSelectionListener

public void removeListSelectionListener(ListSelectionListener listener)
Parameters:
listener - Remove this Listener
Since:
2.5

setSelectionMode

public void setSelectionMode(int selectionMode)
Parameters:
selectionMode - The selection mode of the list.
Since:
2.5

getListSelection

public Object[] getListSelection()
Current selected Items in the List. Attention: This is not a List with all activated Items.

Returns:
Current selected Items in the List
Since:
2.5

getSelection

public Object[] getSelection()
Attention: This is not a List with all selected Items in the List. This List is a List with all checked Items

Returns:
The selected Objects

getSelectedValue

public Object getSelectedValue()
Returns:
The current selected value (value that has focus)
Since:
2.5

invertSelection

public void invertSelection()
Invert the selection


selectAll

public void selectAll()
Select all items.


clearSelection

public void clearSelection()
Clear the selection.


setEnabled

public void setEnabled(boolean value)
Overrides:
setEnabled in class JComponent

calculateSize

public void calculateSize()
Calcualtes the size of the list.


addCenterRendererComponent

public void addCenterRendererComponent(Class clazz,
                                       SelectableItemRendererCenterComponentIf component)
Adds the render component that is to be used for the given class or it's super class.

Parameters:
clazz - The class to use the render component for, the render component is also used for the super class of clazz.
component - The render component.
Since:
2.7

setListUI

public void setListUI(ListUI ui)
Sets the UI to be used for the list.

Parameters:
ui - The list ui that should be used for the list.
Since:
2.7

setHorizontalScrollBarPolicy

public void setHorizontalScrollBarPolicy(int value)
Sets if the horizontal scroll policy.

Parameters:
value - The values from ScrollPaneConstants.
Since:
2.7

addMouseListener

public void addMouseListener(MouseListener listener)
Adds a mouse listener to the list.

Overrides:
addMouseListener in class Component
Parameters:
listener - The listener to add.
Since:
2.7

setFilterComboBox

public void setFilterComboBox(JComboBox filterBox)
Sets the combo box that contains ItemFilters to filter the shown values of the list.

Parameters:
filterBox - The combo box with the ItemFilters.
Since:
2.7

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)