Spec-Zone .ru
спецификации, руководства, описания, API
|
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPopupMenu | +--javax.swing.plaf.basic.BasicComboPopup
This is an implementation of the ComboPopup interface. It is primarily for use by BasicComboBoxUI and its subclasses. BasicComboPopup extends JPopupMenu because most combo boxes use a popup menu to display the list of possible selections. BasicComboBoxUI only requires a ComboPopup, so subclasses of BasicComboBoxUI aren't required to use this class. All event handling is handled by createxxxListener() methods and internal classes. You can change the behavior of this class by overriding the createxxxListener() methods and supplying your own event listeners or subclassing from the ones supplied in this class. Inner classes for handling events: InvocationMouseHandler InvocationMouseMotionHandler InvocationKeyHandler ListSelectionHandler ListDataHandler ListMouseHandler ListMouseMotionHandler PropertyChangeHandler ItemHandler
Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. A future release of Swing will provide support for long term persistence.
Inner Class Summary | |
class |
BasicComboPopup.InvocationKeyHandler
This listener watches for the spacebar being pressed and shows/hides the popup accordingly. |
protected class |
BasicComboPopup.InvocationMouseHandler
This listener knows how and when to invoke this popup menu. |
protected class |
BasicComboPopup.InvocationMouseMotionHandler
This listener watches for dragging and updates the current selection in the list if it is dragging over the list. |
protected class |
BasicComboPopup.ItemHandler
This listener watches for changes in the JComboBox's selection. |
class |
BasicComboPopup.ListDataHandler
Keeps the selected index in the list in-sync with the combo box's selection. |
protected class |
BasicComboPopup.ListMouseHandler
This listener hides the popup when the mouse is released in the list. |
protected class |
BasicComboPopup.ListMouseMotionHandler
This listener changes the selected item as you move the mouse over the list. |
protected class |
BasicComboPopup.ListSelectionHandler
This listener watches for changes in the list's selection and reports them to the combo box. |
protected class |
BasicComboPopup.PropertyChangeHandler
This listener watches for bound property changes in JComboBox. |
Inner classes inherited from class javax.swing.JPopupMenu |
JPopupMenu.AccessibleJPopupMenu, JPopupMenu.Separator |
Inner classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
Inner classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
Inner classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent |
Field Summary | |
protected Timer |
autoscrollTimer
|
protected JComboBox |
comboBox
|
protected boolean |
hasEntered
|
protected boolean |
isAutoScrolling
|
protected ItemListener |
itemListener
|
protected KeyListener |
keyListener
|
protected JList |
list
|
protected ListDataListener |
listDataListener
|
protected MouseListener |
listMouseListener
|
protected MouseMotionListener |
listMouseMotionListener
|
protected ListSelectionListener |
listSelectionListener
|
protected MouseListener |
mouseListener
|
protected MouseMotionListener |
mouseMotionListener
|
protected PropertyChangeListener |
propertyChangeListener
|
protected static int |
SCROLL_DOWN
|
protected static int |
SCROLL_UP
|
protected int |
scrollDirection
|
protected JScrollPane |
scroller
|
protected boolean |
valueIsAdjusting
|
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 | |
BasicComboPopup(JComboBox combo)
|
Method Summary | |
protected void |
autoScrollDown()
|
protected void |
autoScrollUp()
|
protected Rectangle |
computePopupBounds(int px,
int py,
int pw,
int ph)
|
protected void |
configureList()
Called to configure the list created by createList(). |
protected void |
configurePopup()
Called to configure this JPopupMenu (BasicComboPopup is a JPopupMenu). |
protected void |
configureScroller()
Called to configure the JScrollPane created by createScroller(). |
protected MouseEvent |
convertMouseEvent(MouseEvent e)
|
protected ItemListener |
createItemListener()
Creates an item listener that watches for changes in the selected item in the JComboBox. |
protected KeyListener |
createKeyListener()
Creates the key listener that is returned by ComboPopup.getKeyListener(). |
protected JList |
createList()
Creates the JList that is used in the popup to display the items in the model. |
protected ListDataListener |
createListDataListener()
Creates a list data listener that watches for inserted and removed items from the combo box model. |
protected MouseListener |
createListMouseListener()
Creates a mouse listener that watches for mouse events in the popup's list. |
protected MouseMotionListener |
createListMouseMotionListener()
Creates a mouse motion listener that watches for mouse events in the popup's list. |
protected ListSelectionListener |
createListSelectionListener()
Creates a list selection listener that watches for selection changes in the popup's list. |
protected MouseListener |
createMouseListener()
Creates the mouse listener that is returned by ComboPopup.getMouseListener(). |
protected MouseMotionListener |
createMouseMotionListener()
Creates the mouse motion listener that is returned by ComboPopup.getMouseMotionListener(). |
protected PropertyChangeListener |
createPropertyChangeListener()
Creates a property change listener that watches for changes in the bound properties in the JComboBox. |
protected JScrollPane |
createScroller()
Creates the JScrollPane that is used in the popup to hold the list. |
protected void |
delegateFocus(MouseEvent e)
This is is a utility method that helps event handlers figure out where to send the focus when the popup is brought up. |
KeyListener |
getKeyListener()
Implementation of ComboPopup.getKeyListener(). |
JList |
getList()
Implementation of ComboPopup.getList(). |
MouseListener |
getMouseListener()
Implementation of ComboPopup.getMouseListener(). |
MouseMotionListener |
getMouseMotionListener()
Implementation of ComboPopup.getMouseMotionListener(). |
protected int |
getPopupHeightForRowCount(int maxRowCount)
|
void |
hide()
Implementation of ComboPopup.hide(). |
protected void |
installComboBoxListeners()
This method adds the necessary listeners to the JComboBox. |
protected void |
installComboBoxModelListeners(ComboBoxModel model)
|
protected void |
installKeyboardActions()
|
protected void |
installListListeners()
Called by configureList() to add the necessary listeners to the list. |
boolean |
isFocusTraversable()
Overridden to unconditionally return false. |
void |
show()
Implementation of ComboPopup.show(). |
protected void |
startAutoScrolling(int direction)
Called by BasicComboPopup$InvocationMouseMotionHandler to handle auto- scrolling the list. |
protected void |
stopAutoScrolling()
|
protected void |
togglePopup()
Makes the popup visible if it is hidden and makes it hidden if it is visible. |
protected void |
uninstallComboBoxModelListeners(ComboBoxModel model)
|
void |
uninstallingUI()
Called when the UI is uninstalling. |
protected void |
uninstallKeyboardActions()
|
protected void |
updateListBoxSelectionForEvent(MouseEvent anEvent,
boolean shouldScroll)
A utility method used by the event listeners. |
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, removeAll, removeContainerListener, setLayout, validate, validateTree |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.swing.plaf.basic.ComboPopup |
isVisible |
Field Detail |
protected JComboBox comboBox
protected JList list
protected JScrollPane scroller
protected boolean valueIsAdjusting
protected MouseMotionListener mouseMotionListener
protected MouseListener mouseListener
protected KeyListener keyListener
protected ListSelectionListener listSelectionListener
protected ListDataListener listDataListener
protected MouseListener listMouseListener
protected MouseMotionListener listMouseMotionListener
protected PropertyChangeListener propertyChangeListener
protected ItemListener itemListener
protected Timer autoscrollTimer
protected boolean hasEntered
protected boolean isAutoScrolling
protected int scrollDirection
protected static final int SCROLL_UP
protected static final int SCROLL_DOWN
Constructor Detail |
public BasicComboPopup(JComboBox combo)
Method Detail |
public void show()
show
in interface ComboPopup
show
in class Component
public void hide()
hide
in interface ComboPopup
hide
in class JComponent
public JList getList()
getList
in interface ComboPopup
public MouseListener getMouseListener()
getMouseListener
in interface ComboPopup
public MouseMotionListener getMouseMotionListener()
getMouseMotionListener
in interface ComboPopup
public KeyListener getKeyListener()
getKeyListener
in interface ComboPopup
public void uninstallingUI()
uninstallingUI
in interface ComboPopup
protected void uninstallComboBoxModelListeners(ComboBoxModel model)
protected void uninstallKeyboardActions()
protected MouseListener createMouseListener()
protected MouseMotionListener createMouseMotionListener()
protected KeyListener createKeyListener()
protected ListSelectionListener createListSelectionListener()
protected ListDataListener createListDataListener()
protected MouseListener createListMouseListener()
protected MouseMotionListener createListMouseMotionListener()
protected PropertyChangeListener createPropertyChangeListener()
protected ItemListener createItemListener()
protected JList createList()
protected void configureList()
protected void installListListeners()
protected JScrollPane createScroller()
protected void configureScroller()
protected void configurePopup()
protected void installComboBoxListeners()
protected void installComboBoxModelListeners(ComboBoxModel model)
protected void installKeyboardActions()
public boolean isFocusTraversable()
isFocusTraversable
in class JComponent
javax.swing.JComponent
protected void startAutoScrolling(int direction)
protected void stopAutoScrolling()
protected void autoScrollUp()
protected void autoScrollDown()
protected void delegateFocus(MouseEvent e)
protected void togglePopup()
protected MouseEvent convertMouseEvent(MouseEvent e)
protected int getPopupHeightForRowCount(int maxRowCount)
protected Rectangle computePopupBounds(int px, int py, int pw, int ph)
protected void updateListBoxSelectionForEvent(MouseEvent anEvent, boolean shouldScroll)
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.