JavaTM 2 Platform
Standard Ed. 6

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


嵌套类摘要
 class BasicComboPopup.InvocationKeyHandler
          从 Java 2 平台 v 1.4 开始,现在已废弃此类,包括它仅为了具有向后 API 兼容性。
protected  class BasicComboPopup.InvocationMouseHandler
          要在组合框( 其弹出菜单)上注册的侦听器,该侦听器处理影响弹出菜单状态的鼠标事件。
protected  class BasicComboPopup.InvocationMouseMotionHandler
          此侦听器观察拖动操作,如果是在列表上进行拖动,则它还更新列表中的当前选择。
protected  class BasicComboPopup.ItemHandler
          此侦听器观察组合框中选择的更改。
 class BasicComboPopup.ListDataHandler
          从 1.4 开始,此类已废弃,不再执行任何操作,包括它只是为了具有向后 API 兼容性。
protected  class BasicComboPopup.ListMouseHandler
          在列表中释放鼠标时,此侦听器隐藏弹出部分。
protected  class BasicComboPopup.ListMouseMotionHandler
          在列表上移动鼠标时,此侦听器更改所选项。
protected  class BasicComboPopup.ListSelectionHandler
          从 Java 2 平台 v 1.4 开始,此类已废弃,不再执行任何操作,包括它只是为了具有向后 API 兼容性。
protected  class BasicComboPopup.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.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
字段摘要
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
          从 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  void autoScrollDown()
          此受保护方法是特定于实现的,应该为私有,不要调用或重写。
protected  void autoScrollUp()
          此受保护方法是特定于实现的,应该为私有,不要调用或重写。
protected  Rectangle computePopupBounds(int px, int py, int pw, int ph)
          基于组合框的位置和封闭的屏幕界限计算组合框的弹出部分的位置和大小。
protected  void configureList()
          配置用于保存弹出部分中的组合框项的列表。
protected  void configurePopup()
          配置组合框的弹出部分。
protected  void configureScroller()
          配置在组合框弹出控件中保存列表的可滚动部分。
protected  MouseEvent convertMouseEvent(MouseEvent e)
           
protected  ItemListener createItemListener()
          创建将添加到组合框的 ItemListener
protected  KeyListener createKeyListener()
          创建将添加到组合框的键侦听器。
protected  JList createList()
          创建在显示组合框模型项的弹出控件中使用的 JList。
protected  ListDataListener createListDataListener()
          创建将添加到 ComboBoxModel 的列表数据侦听器。
protected  MouseListener createListMouseListener()
          创建观察弹出列表中的鼠标事件的鼠标侦听器。
protected  MouseMotionListener createListMouseMotionListener()
          创建观察弹出列表中的鼠标移动事件的鼠标移动侦听器。
protected  ListSelectionListener createListSelectionListener()
          创建观察弹出列表中的选择更改的列表选择侦听器。
protected  MouseListener createMouseListener()
          创建将观察组合框上的鼠标按下和释放事件的侦听器。
protected  MouseMotionListener createMouseMotionListener()
          创建将添加到组合框的鼠标移动侦听器。
protected  PropertyChangeListener createPropertyChangeListener()
          创建将添加到组合框的 PropertyChangeListener
protected  JScrollPane createScroller()
          创建容纳可滚动列表的滚动窗格。
protected  void delegateFocus(MouseEvent e)
          此为一种实用程序方法,用于帮助事件处理程序计算出在调出弹出控件时将焦点发送到的位置。
protected  void firePopupMenuCanceled()
          通知 PopupMenuListener 此弹出菜单将被取消。
protected  void firePopupMenuWillBecomeInvisible()
          通知 PopupMenuListener 此弹出菜单将变得不可见。
protected  void firePopupMenuWillBecomeVisible()
          通知 PopupMenuListener 此弹出菜单将变得可见。
 AccessibleContext getAccessibleContext()
          获取与此 BasicComboPopup 关联的 AccessibleContext。
 KeyListener getKeyListener()
          ComboPopup.getKeyListener() 的实现。
 JList getList()
          ComboPopup.getList() 的实现。
 MouseListener getMouseListener()
          ComboPopup.getMouseListener() 的实现。
 MouseMotionListener getMouseMotionListener()
          ComboPopup.getMouseMotionListener() 的实现。
protected  int getPopupHeightForRowCount(int maxRowCount)
          基于当前 ListCellRenderer 和最大行数检索弹出部分的高度。
 void hide()
          ComboPopup.hide() 的实现。
protected  void installComboBoxListeners()
          此方法在 JComboBox 中添加必需的侦听器。
protected  void installComboBoxModelListeners(ComboBoxModel model)
          在组合框模型中安装侦听器。
protected  void installKeyboardActions()
           
protected  void installListListeners()
          将侦听器添加到列表控件。
 boolean isFocusTraversable()
          重写以无条件返回 false。
 void show()
          ComboPopup.show() 的实现。
protected  void startAutoScrolling(int direction)
          此受保护方法是特定于实现的,应该为私有,不要调用或重写。
protected  void stopAutoScrolling()
          此受保护方法是特定于实现的,应该为私有,不要调用或重写。
protected  void togglePopup()
          如果弹出部分是隐藏的,则使其可见;如果它是可见的,则将其隐藏。
protected  void uninstallComboBoxModelListeners(ComboBoxModel model)
          从组合框模型中移除侦听器
 void uninstallingUI()
          卸载 UI 时调用。
protected  void uninstallKeyboardActions()
           
protected  void updateListBoxSelectionForEvent(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, 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, 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()

listSelectionListener

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

另请参见:
createListSelectionListener()

listMouseListener

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

另请参见:
createListMouseListener()

listMouseMotionListener

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

另请参见:
createListMouseMotionListener()

propertyChangeListener

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

另请参见:
createPropertyChangeListener()

listDataListener

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

另请参见:
createListDataListener()

itemListener

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

另请参见:
createItemListener()

autoscrollTimer

protected Timer autoscrollTimer
此受保护字段是特定于实现的。不要直接访问或重写。


hasEntered

protected boolean hasEntered

isAutoScrolling

protected boolean isAutoScrolling

scrollDirection

protected int scrollDirection

SCROLL_UP

protected static final int SCROLL_UP
另请参见:
常量字段值

SCROLL_DOWN

protected static final int SCROLL_DOWN
另请参见:
常量字段值
构造方法详细信息

BasicComboPopup

public BasicComboPopup(JComboBox combo)
方法详细信息

show

public void show()
ComboPopup.show() 的实现。

指定者:
接口 ComboPopup 中的 show
覆盖:
Component 中的 show

hide

public void hide()
ComboPopup.hide() 的实现。

指定者:
接口 ComboPopup 中的 hide
覆盖:
Component 中的 hide

getList

public JList getList()
ComboPopup.getList() 的实现。

指定者:
接口 ComboPopup 中的 getList

getMouseListener

public MouseListener getMouseListener()
ComboPopup.getMouseListener() 的实现。

指定者:
接口 ComboPopup 中的 getMouseListener
返回:
MouseListener 或 null
另请参见:
ComboPopup.getMouseListener()

getMouseMotionListener

public MouseMotionListener getMouseMotionListener()
ComboPopup.getMouseMotionListener() 的实现。

指定者:
接口 ComboPopup 中的 getMouseMotionListener
返回:
MouseMotionListener 或 null
另请参见:
ComboPopup.getMouseMotionListener()

getKeyListener

public KeyListener getKeyListener()
ComboPopup.getKeyListener() 的实现。

指定者:
接口 ComboPopup 中的 getKeyListener
返回:
KeyListener 或 null
另请参见:
ComboPopup.getKeyListener()

uninstallingUI

public void uninstallingUI()
卸载 UI 时调用。由于此弹出部分不在组件树中,因此其 uninstallUI() 不会被调用。它移除已添加在 addComboBoxListeners() 中的侦听器。

指定者:
接口 ComboPopup 中的 uninstallingUI

uninstallComboBoxModelListeners

protected void uninstallComboBoxModelListeners(ComboBoxModel model)
从组合框模型中移除侦听器

参数:
model - 要安装侦听器的组合框
另请参见:
installComboBoxModelListeners(javax.swing.ComboBoxModel)

uninstallKeyboardActions

protected void uninstallKeyboardActions()

firePopupMenuWillBecomeVisible

protected void firePopupMenuWillBecomeVisible()
从类 JPopupMenu 复制的描述
通知 PopupMenuListener 此弹出菜单将变得可见。

覆盖:
JPopupMenu 中的 firePopupMenuWillBecomeVisible

firePopupMenuWillBecomeInvisible

protected void firePopupMenuWillBecomeInvisible()
从类 JPopupMenu 复制的描述
通知 PopupMenuListener 此弹出菜单将变得不可见。

覆盖:
JPopupMenu 中的 firePopupMenuWillBecomeInvisible

firePopupMenuCanceled

protected void firePopupMenuCanceled()
从类 JPopupMenu 复制的描述
通知 PopupMenuListener 此弹出菜单将被取消。

覆盖:
JPopupMenu 中的 firePopupMenuCanceled

createMouseListener

protected MouseListener createMouseListener()
创建将观察组合框上的鼠标按下和释放事件的侦听器。 警告:重写此方法时,确保维护现有行为。

返回:
将添加到组合框的 MouseListener,或者返回 null

createMouseMotionListener

protected MouseMotionListener createMouseMotionListener()
创建将添加到组合框的鼠标移动侦听器。 警告:重写此方法时,确保维护现有行为。

返回:
将添加到组合框的 MouseMotionListener,或者返回 null

createKeyListener

protected KeyListener createKeyListener()
创建将添加到组合框的键侦听器。如果此方法返回 null,则不会将其添加到组合框。

返回:
KeyListener 的实例或 null

createListSelectionListener

protected ListSelectionListener createListSelectionListener()
创建观察弹出列表中的选择更改的列表选择侦听器。如果此方法返回 null,则不会将其添加到弹出列表。

返回:
ListSelectionListener 的实例或 null

createListDataListener

protected ListDataListener createListDataListener()
创建将添加到 ComboBoxModel 的列表数据侦听器。如果此方法返回 null,则不会将其添加到组合框模型。

返回:
ListDataListener 的实例或 null

createListMouseListener

protected MouseListener createListMouseListener()
创建观察弹出列表中的鼠标事件的鼠标侦听器。如果此方法返回 null,则不会将其添加到组合框。

返回:
MouseListener 的实例或 null

createListMouseMotionListener

protected MouseMotionListener createListMouseMotionListener()
创建观察弹出列表中的鼠标移动事件的鼠标移动侦听器。如果此方法返回 null,则不会将其添加到组合框。

返回:
MouseMotionListener 的实例或 null

createPropertyChangeListener

protected PropertyChangeListener createPropertyChangeListener()
创建将添加到组合框的 PropertyChangeListener。如果此方法返回 null,则不会将其添加到组合框。

返回:
PropertyChangeListener 的实例或 null

createItemListener

protected ItemListener createItemListener()
创建将添加到组合框的 ItemListener。如果此方法返回 null,则不会将其添加到组合框。

子类可以重写此方法以返回其 ItemEvent 处理程序的实例。

返回:
ItemListener 的实例或 null

createList

protected JList createList()
创建在显示组合框模型项的弹出控件中使用的 JList。创建 UI 类时调用此方法。

返回:
用于显示组合框项的 JList

configureList

protected void configureList()
配置用于保存弹出部分中的组合框项的列表。创建 UI 类时调用此方法。

另请参见:
createList()

installListListeners

protected void installListListeners()
将侦听器添加到列表控件。


createScroller

protected JScrollPane createScroller()
创建容纳可滚动列表的滚动窗格。


configureScroller

protected void configureScroller()
配置在组合框弹出控件中保存列表的可滚动部分。创建 UI 类时调用此方法。


configurePopup

protected void configurePopup()
配置组合框的弹出部分。创建 UI 类时调用此方法。


installComboBoxListeners

protected void installComboBoxListeners()
此方法在 JComboBox 中添加必需的侦听器。


installComboBoxModelListeners

protected void installComboBoxModelListeners(ComboBoxModel model)
在组合框模型中安装侦听器。应该用 uninstallComboBoxModelListeners 移除添加到组合框模型上的所有侦听器。

参数:
model - 要安装侦听器的组合框模型
另请参见:
uninstallComboBoxModelListeners(javax.swing.ComboBoxModel)

installKeyboardActions

protected void installKeyboardActions()

isFocusTraversable

public boolean isFocusTraversable()
重写以无条件返回 false。

覆盖:
Component 中的 isFocusTraversable
返回:
如果此 Component 是可以获得焦点的,则返回 true;否则返回 false
另请参见:
Component.setFocusable(boolean)

startAutoScrolling

protected void startAutoScrolling(int direction)
此受保护方法是特定于实现的,应该为私有,不要调用或重写。


stopAutoScrolling

protected void stopAutoScrolling()
此受保护方法是特定于实现的,应该为私有,不要调用或重写。


autoScrollUp

protected void autoScrollUp()
此受保护方法是特定于实现的,应该为私有,不要调用或重写。


autoScrollDown

protected void autoScrollDown()
此受保护方法是特定于实现的,应该为私有,不要调用或重写。


getAccessibleContext

public AccessibleContext getAccessibleContext()
获取与此 BasicComboPopup 关联的 AccessibleContext。将 AccessibleContext 的父级设置为 ComboBox。

指定者:
接口 Accessible 中的 getAccessibleContext
覆盖:
JPopupMenu 中的 getAccessibleContext
返回:
用于 BasicComboPopup 的 AccessibleContext
从以下版本开始:
1.5

delegateFocus

protected void delegateFocus(MouseEvent e)
此为一种实用程序方法,用于帮助事件处理程序计算出在调出弹出控件时将焦点发送到的位置。标准实现将焦点委托给编辑器(如果组合框可编辑)或者 JComboBox(如果组合框不可编辑)。


togglePopup

protected void togglePopup()
如果弹出部分是隐藏的,则使其可见;如果它是可见的,则将其隐藏。


convertMouseEvent

protected MouseEvent convertMouseEvent(MouseEvent e)

getPopupHeightForRowCount

protected int getPopupHeightForRowCount(int maxRowCount)
基于当前 ListCellRenderer 和最大行数检索弹出部分的高度。


computePopupBounds

protected Rectangle computePopupBounds(int px,
                                       int py,
                                       int pw,
                                       int ph)
基于组合框的位置和封闭的屏幕界限计算组合框的弹出部分的位置和大小。如果不需要进行转换,则返回的矩形将具有相同的参数值。

参数:
px - 初始 x 位置
py - 初始 y 位置
pw - 初始宽度
ph - 初始高度
返回:
表示弹出部分的位置和大小的矩形

updateListBoxSelectionForEvent

protected void updateListBoxSelectionForEvent(MouseEvent anEvent,
                                              boolean shouldScroll)
供事件侦听器使用的实用程序方法。如果给定鼠标事件,则其将列表选择更改为鼠标指针所在的列表项。


JavaTM 2 Platform
Standard Ed. 6

提交错误或意见

版权所有 2008 Sun Microsystems, Inc. 保留所有权利。请遵守GNU General Public License, version 2 only