所有类


javax.swing.plaf.basic
类 BasicComboPopup

java.lang.Object
  继承者 java.awt.Component
      继承者 java.awt.Container
          继承者 javax.swing.JComponent
              继承者 javax.swing.JPopupMenu
                  继承者 javax.swing.plaf.basic.BasicComboPopup
所有已实现的接口:
ImageObserver, MenuContainer, Serializable, Accessible, MenuElement, ComboPopup
直接已知子类:
MetalComboBoxUI.MetalComboPopup

public class BasicComboPopup
   
   
   
   
extends JPopupMenu
implements ComboPopup

此为 ComboPopup 接口的基本实现。 此类表示组合框的弹出部分的 UI。

所有事件处理都是由利用 createxxxListener() 方法和内部类创建的侦听器类处理的。通过重写 createxxxListener() 方法,并提供自己的事件侦听器或者从此类提供的事件侦听器创建子类,可以更改此类的行为。

警告:此类的序列化对象将与以后的 Swing 版本不兼容。当前的序列化支持适用于短期存储或运行相同 Swing 版本的应用程序之间的 RMI。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder


嵌套类摘要
 classBasicComboPopup.InvocationKeyHandler
          从 Java 2 平台 v 1.4 开始,现在已废弃此类,包括它仅为了具有向后 API 兼容性。
protected  classBasicComboPopup.InvocationMouseHandler
          要在组合框( 其弹出菜单)上注册的侦听器,该侦听器处理影响弹出菜单状态的鼠标事件。
protected  classBasicComboPopup.InvocationMouseMotionHandler
          此侦听器观察拖动操作,如果是在列表上进行拖动,则它还更新列表中的当前选择。
protected  classBasicComboPopup.ItemHandler
          此侦听器观察组合框中选择的更改。
 classBasicComboPopup.ListDataHandler
          从 1.4 开始,此类已废弃,不再执行任何操作,包括它只是为了具有向后 API 兼容性。
protected  classBasicComboPopup.ListMouseHandler
          在列表中释放鼠标时,此侦听器隐藏弹出部分。
protected  classBasicComboPopup.ListMouseMotionHandler
          在列表上移动鼠标时,此侦听器更改所选项。
protected  classBasicComboPopup.ListSelectionHandler
          从 Java 2 平台 v 1.4 开始,此类已废弃,不再执行任何操作,包括它只是为了具有向后 API 兼容性。
protected  classBasicComboPopup.PropertyChangeHandler
          此侦听器观察已在组合框中更改的 bound 属性。
 
从类 javax.swing.JPopupMenu 继承的嵌套类/接口
JPopupMenu.AccessibleJPopupMenu, JPopupMenu.Separator
 
从类 javax.swing.JComponent 继承的嵌套类/接口
JComponent.AccessibleJComponent
 
从类 java.awt.Container 继承的嵌套类/接口
Container.AccessibleAWTContainer
 
从类 java.awt.Component 继承的嵌套类/接口
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
字段摘要
protected  TimerautoscrollTimer
          此受保护字段是特定于实现的。
protected  JComboBoxcomboBox
           
protected  booleanhasEntered
           
protected  booleanisAutoScrolling
           
protected  ItemListeneritemListener
          此受保护字段是特定于实现的。
protected  KeyListenerkeyListener
          此受保护字段是特定于实现的。
protected  JListlist
          此受保护字段是特定于实现的。
protected  ListDataListenerlistDataListener
          此受保护字段是特定于实现的。
protected  MouseListenerlistMouseListener
          此受保护字段是特定于实现的。
protected  MouseMotionListenerlistMouseMotionListener
          此受保护字段是特定于实现的。
protected  ListSelectionListenerlistSelectionListener
          此受保护字段是特定于实现的。
protected  MouseListenermouseListener
          此受保护字段是特定于实现的。
protected  MouseMotionListenermouseMotionListener
          此受保护字段是特定于实现的。
protected  PropertyChangeListenerpropertyChangeListener
          此受保护字段是特定于实现的。
protected static intSCROLL_DOWN
           
protected static intSCROLL_UP
           
protected  intscrollDirection
           
protected  JScrollPanescroller
          此受保护字段是特定于实现的。
protected  booleanvalueIsAdjusting
          从 Java 2 平台 v1.4 开始,不再使用这种以前没有记录的字段。
 
从类 javax.swing.JComponent 继承的字段
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
从类 java.awt.Component 继承的字段
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
从接口 java.awt.image.ImageObserver 继承的字段
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
构造方法摘要
BasicComboPopup(JComboBox combo)
           
 
方法摘要
protected  voidautoScrollDown()
          此受保护方法是特定于实现的,应该为私有,不要调用或重写。
protected  voidautoScrollUp()
          此受保护方法是特定于实现的,应该为私有,不要调用或重写。
protected  RectanglecomputePopupBounds(int px, int py, int pw, int ph)
          基于组合框的位置和封闭的屏幕界限计算组合框的弹出部分的位置和大小。
protected  voidconfigureList()
          配置用于保存弹出部分中的组合框项的列表。
protected  voidconfigurePopup()
          配置组合框的弹出部分。
protected  voidconfigureScroller()
          配置在组合框弹出控件中保存列表的可滚动部分。
protected  MouseEventconvertMouseEvent(MouseEvent e)
           
protected  ItemListenercreateItemListener()
          创建将添加到组合框的 ItemListener
protected  KeyListenercreateKeyListener()
          创建将添加到组合框的键侦听器。
protected  JListcreateList()
          创建在显示组合框模型项的弹出控件中使用的 JList。
protected  ListDataListenercreateListDataListener()
          创建将添加到 ComboBoxModel 的列表数据侦听器。
protected  MouseListenercreateListMouseListener()
          创建观察弹出列表中的鼠标事件的鼠标侦听器。
protected  MouseMotionListenercreateListMouseMotionListener()
          创建观察弹出列表中的鼠标移动事件的鼠标移动侦听器。
protected  ListSelectionListenercreateListSelectionListener()
          创建观察弹出列表中的选择更改的列表选择侦听器。
protected  MouseListenercreateMouseListener()
          创建将观察组合框上的鼠标按下和释放事件的侦听器。
protected  MouseMotionListenercreateMouseMotionListener()
          创建将添加到组合框的鼠标移动侦听器。
protected  PropertyChangeListenercreatePropertyChangeListener()
          创建将添加到组合框的 PropertyChangeListener
protected  JScrollPanecreateScroller()
          创建容纳可滚动列表的滚动窗格。
protected  voiddelegateFocus(MouseEvent e)
          此为一种实用程序方法,用于帮助事件处理程序计算出在调出弹出控件时将焦点发送到的位置。
protected  voidfirePopupMenuCanceled()
          通知 PopupMenuListener 此弹出菜单将被取消。
protected  voidfirePopupMenuWillBecomeInvisible()
          通知 PopupMenuListener 此弹出菜单将变得不可见。
protected  voidfirePopupMenuWillBecomeVisible()
          通知 PopupMenuListener 此弹出菜单将变得可见。
 AccessibleContextgetAccessibleContext()
          获取与此 BasicComboPopup 关联的 AccessibleContext。
 KeyListenergetKeyListener()
          ComboPopup.getKeyListener() 的实现。
 JListgetList()
          ComboPopup.getList() 的实现。
 MouseListenergetMouseListener()
          ComboPopup.getMouseListener() 的实现。
 MouseMotionListenergetMouseMotionListener()
          ComboPopup.getMouseMotionListener() 的实现。
protected  intgetPopupHeightForRowCount(int maxRowCount)
          基于当前 ListCellRenderer 和最大行数检索弹出部分的高度。
 voidhide()
          ComboPopup.hide() 的实现。
protected  voidinstallComboBoxListeners()
          此方法在 JComboBox 中添加必需的侦听器。
protected  voidinstallComboBoxModelListeners(ComboBoxModel model)
          在组合框模型中安装侦听器。
protected  voidinstallKeyboardActions()
           
protected  voidinstallListListeners()
          将侦听器添加到列表控件。
 booleanisFocusTraversable()
          重写以无条件返回 false。
 voidshow()
          ComboPopup.show() 的实现。
protected  voidstartAutoScrolling(int direction)
          此受保护方法是特定于实现的,应该为私有,不要调用或重写。
protected  voidstopAutoScrolling()
          此受保护方法是特定于实现的,应该为私有,不要调用或重写。
protected  voidtogglePopup()
          如果弹出部分是隐藏的,则使其可见;如果它是可见的,则将其隐藏。
protected  voiduninstallComboBoxModelListeners(ComboBoxModel model)
          从组合框模型中移除侦听器
 voiduninstallingUI()
          卸载 UI 时调用。
protected  voiduninstallKeyboardActions()
           
protected  voidupdateListBoxSelectionForEvent(MouseEvent anEvent, boolean shouldScroll)
          供事件侦听器使用的实用程序方法。
 
从类 javax.swing.JPopupMenu 继承的方法
add, add, add, addMenuKeyListener, addPopupMenuListener, addSeparator, createActionChangeListener, createActionComponent, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getMenuKeyListeners, getPopupMenuListeners, getSelectionModel, getSubElements, getUI, getUIClassID, insert, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, paintBorder, paramString, processFocusEvent, processKeyEvent, processKeyEvent, processMouseEvent, remove, removeMenuKeyListener, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, setVisible, show, updateUI
 
从类 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, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, 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, unregisterKeyboardAction, update
 
从类 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, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
从类 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, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, 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, setName, setSize, setSize, show, size, toString, transferFocus, transferFocusUpCycle
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
从接口 javax.swing.plaf.basic.ComboPopup 继承的方法
isVisible
 

字段详细信息

comboBox

protected JComboBox comboBox

list

protected JList list
此受保护字段是特定于实现的。不要直接访问或重写。可以改为使用访问器方法。

另请参见:
getList(), createList()

scroller

protected JScrollPane scroller
此受保护字段是特定于实现的。不要直接访问或重写。可以改为使用创建方法。

另请参见:
createScroller()

valueIsAdjusting

protected boolean valueIsAdjusting
从 Java 2 平台 v1.4 开始,不再使用这种以前没有记录的字段。


mouseMotionListener

protected MouseMotionListener mouseMotionListener
此受保护字段是特定于实现的。不要直接访问或重写。可以改为使用访问器或创建方法。

另请参见:
getMouseMotionListener(), createMouseMotionListener()

mouseListener

protected MouseListener mouseListener
此受保护字段是特定于实现的。不要直接访问或重写。可以改为使用访问器或创建方法。

另请参见:
getMouseListener(), createMouseListener()

keyListener

protected KeyListener keyListener
此受保护字段是特定于实现的。不要直接访问或重写。可以改为使用访问器或创建方法。

另请参见:
getKeyListener(), createKeyListener()