|
juife v0.1a |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
net.sf.juife.ComponentList
public class ComponentList
A component that contains a list of components and allows the user to select one or more of them.
Note that if you want to create a list of non-interactive
components that just show some kind of information consider using
JList
. In JList
this can be done
by setting a custom delegate to paint the cells using
JList.setCellRenderer(javax.swing.ListCellRenderer)
method.
ComponentListModel
,
DefaultComponentListModel
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.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 | |
---|---|
ComponentList()
Creates a new instance of ComponentList |
|
ComponentList(ComponentListModel model)
Creates a new instance of ComponentList with the specified data model. |
Method Summary | |
---|---|
void |
addListSelectionListener(javax.swing.event.ListSelectionListener listener)
Registers the specified listener for receiving list selection events. |
void |
clearSelection()
Clears the selection. |
void |
ensureIndexIsVisible(int index)
Scrolls the viewport to make the specified component visible. |
protected void |
fireSelectionChanged(javax.swing.event.ListSelectionEvent e)
Notifies ComponentList ListSelectionListener s that
the selection model has changed. |
void |
fireSelectionProbablyChanged(int index)
Notifies all listeners that have registered interest for notification on this event type. |
int |
getMaxSelectionIndex()
Gets the last selected index or -1 if the selection is empty. |
int |
getMinSelectionIndex()
Gets the first selected index or -1 if the selection is empty. |
ComponentListModel |
getModel()
Gets the data model of this list. |
java.awt.Component[] |
getSelectedComponents()
Gets all selected components. |
int[] |
getSelectedIndices()
Getss an array of all of the selected indices in increasing order. |
int |
getSelectionMode()
Gets the selection mode. |
javax.swing.ListSelectionModel |
getSelectionModel()
Gets the current selection model of this list. |
ComponentListUI |
getUI()
Gets the L&F object that renders this component. |
java.lang.String |
getUIClassID()
Gets a string that specifies the name of the L&F class that renders this component. |
boolean |
isSelectedIndex(int index)
Determines whether the specified index is selected. |
boolean |
isSelectionEmpty()
Determines whether the selection is empty. |
void |
removeListSelectionListener(javax.swing.event.ListSelectionListener listener)
Removes the specified listener. |
void |
selectAll()
Selects all components in the list. |
void |
setModel(ComponentListModel model)
Sets the data model of the list. |
void |
setSelectedComponent(java.awt.Component c,
boolean shouldScroll)
Selects the specified component. |
void |
setSelectedIndex(int index)
Selects the component at the specified index. |
void |
setSelectedIndices(int[] indices)
Selects the components with the specified indices. |
void |
setSelectionInterval(int index0,
int index1)
Changes the selection to be between index0 and index1 inclusive. |
void |
setSelectionMode(int selectionMode)
Sets the selection mode. |
void |
setSelectionModel(javax.swing.ListSelectionModel model)
Sets the selection model of this list. |
void |
setUI(ComponentListUI ui)
Sets the L&F object that renders this component. |
void |
updateUI()
Resets the UI property to a value from the current look and feel. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, paramString, setUI |
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 |
Constructor Detail |
---|
public ComponentList()
ComponentList
public ComponentList(ComponentListModel model)
ComponentList
with the specified data model.
model
- The data model for this ComponentList
instance.Method Detail |
---|
public java.lang.String getUIClassID()
getUIClassID
in class javax.swing.JPanel
public ComponentListUI getUI()
getUI
in class javax.swing.JPanel
public void setUI(ComponentListUI ui)
ui
- The new UI delegate.public void updateUI()
updateUI
in class javax.swing.JPanel
public void addListSelectionListener(javax.swing.event.ListSelectionListener listener)
listener
- The ListSelectionListener
to register.public void removeListSelectionListener(javax.swing.event.ListSelectionListener listener)
listener
- The ListSelectionListener
to remove.protected void fireSelectionChanged(javax.swing.event.ListSelectionEvent e)
ComponentList
ListSelectionListener
s that
the selection model has changed.
public ComponentListModel getModel()
public void setModel(ComponentListModel model)
model
- The new data model.public javax.swing.ListSelectionModel getSelectionModel()
public void setSelectionModel(javax.swing.ListSelectionModel model)
model
- The new selection model.public int getSelectionMode()
setSelectionMode(int)
,
ListSelectionModel.getSelectionMode()
public void setSelectionMode(int selectionMode)
ListSelectionModel.setSelectionMode(int)
,
getSelectionMode()
public void setSelectionInterval(int index0, int index1)
ListSelectionModel.setSelectionInterval(int, int)
public int getMinSelectionIndex()
ListSelectionModel.getMinSelectionIndex()
public int getMaxSelectionIndex()
ListSelectionModel.getMaxSelectionIndex()
public boolean isSelectionEmpty()
true
if nothing is selected.ListSelectionModel.isSelectionEmpty()
public boolean isSelectedIndex(int index)
true
if the specified index is selected,
false
otherwise.ListSelectionModel.isSelectedIndex(int)
public void setSelectedIndex(int index)
index
- The position of the component to be selected.public int[] getSelectedIndices()
public void setSelectedIndices(int[] indices)
indices
- An array of the indices of the components to be selected.public java.awt.Component[] getSelectedComponents()
public void setSelectedComponent(java.awt.Component c, boolean shouldScroll)
c
- The component to be selected.shouldScroll
- Determines whether the list should scroll to display
the selected component; true
if the list should scroll to display
the selected component, false
otherwise.public void selectAll()
public void clearSelection()
ListSelectionModel.clearSelection()
public void ensureIndexIsVisible(int index)
index
- The index of the component to make visible.public void fireSelectionProbablyChanged(int index)
|
juife v0.1a |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2005 Grigor Iliev. All rights reserved. |