所有类


javax.swing.plaf.basic
类 BasicComboBoxUI

java.lang.Object
  继承者 javax.swing.plaf.ComponentUI
      继承者 javax.swing.plaf.ComboBoxUI
          继承者 javax.swing.plaf.basic.BasicComboBoxUI
直接已知子类:
MetalComboBoxUI

public class BasicComboBoxUI
   
   
   
   
extends ComboBoxUI

JComboBox 的基本 UI 实现。

组合框是一个组合组件,这意味着它是很多简单组件的聚合。此类创建和管理组合框上的侦听器和组合框模型。这些侦听器更新用户界面以响应组合框的属性和状态的更改。

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

为了添加特殊动作,需要重写 installKeyboardActions 来添加响应 KeyStroke 绑定的动作。请参见 The Swing Connection 中的文章 Keyboard Bindings in Swing


嵌套类摘要
 classBasicComboBoxUI.ComboBoxLayoutManager
          此布局管理器处理组合框的“标准”布局。
 classBasicComboBoxUI.FocusHandler
          失去焦点时,此侦听器将隐藏弹出部分。
 classBasicComboBoxUI.ItemHandler
          此侦听器观察组合框中选择的更改。
 classBasicComboBoxUI.KeyHandler
          此侦听器检查键事件是否不是导航键。
 classBasicComboBoxUI.ListDataHandler
          此侦听器观察 ComboBoxModel 中的更改。
 classBasicComboBoxUI.PropertyChangeHandler
          此侦听器观察在组合框中发生更改的 bound 属性。
 
字段摘要
protected  JButtonarrowButton
           
protected  DimensioncachedMinimumSize
           
protected  JComboBoxcomboBox
           
protected  CellRendererPanecurrentValuePane
           
protected  Componenteditor
           
protected  FocusListenerfocusListener
          此受保护字段是特定于实现的。
protected  booleanhasFocus
          此受保护字段是特定于实现的。
protected  booleanisMinimumSizeDirty
           
protected  ItemListeneritemListener
          此受保护字段是特定于实现的。
protected  KeyListenerkeyListener
          此受保护字段是特定于实现的。
protected  JListlistBox
           
protected  ListDataListenerlistDataListener
          此受保护字段是特定于实现的。
protected  ComboPopuppopup
           
protected  KeyListenerpopupKeyListener
           
protected  MouseListenerpopupMouseListener
           
protected  MouseMotionListenerpopupMouseMotionListener
           
protected  PropertyChangeListenerpropertyChangeListener
          此受保护字段是特定于实现的。
 
构造方法摘要
BasicComboBoxUI()
           
 
方法摘要
 voidaddEditor()
          此公共方法是特定于实现的,应该为私有,不要调用或重写。
 voidconfigureArrowButton()
          此公共方法是特定于实现的,应该为私有。
protected  voidconfigureEditor()
          此受保护方法是特定于实现的,应该为私有,不要调用或重写。
protected  JButtoncreateArrowButton()
          创建一个按钮,将使用它来控制显示或隐藏组合框的弹出部分。
protected  ComboBoxEditorcreateEditor()
          创建将在可编辑的组合框中使用的默认编辑器。
protected  FocusListenercreateFocusListener()
          创建将添加到组合框的 FocusListener
protected  ItemListenercreateItemListener()
          创建将添加到组合框的 ItemListener
protected  KeyListenercreateKeyListener()
          创建将添加到组合框的 KeyListener
protected  LayoutManagercreateLayoutManager()
          创建用于管理构成组合框的组件的布局管理器。
protected  ListDataListenercreateListDataListener()
          创建将添加到 ComboBoxModel 的列表数据侦听器。
protected  ComboPopupcreatePopup()
          创建组合框的弹出部分。
protected  PropertyChangeListenercreatePropertyChangeListener()
          创建将添加到组合框的 PropertyChangeListener
protected  ListCellRenderercreateRenderer()
          创建将在不可编辑的组合框中使用的默认渲染器。
static ComponentUIcreateUI(JComponent c)
           
 AccessiblegetAccessibleChild(JComponent c, int i)
          返回对象的第 iAccessible 子对象。
 intgetAccessibleChildrenCount(JComponent c)
          返回对象中的可访问子对象数。
protected  DimensiongetDefaultSize()
          返回使用当前渲染器和字体的组合框的空显示区域的默认大小。
protected  DimensiongetDisplaySize()
          返回显示区域的计算大小。
protected  InsetsgetInsets()
          获取 JComboBox 的 insets。
 DimensiongetMaximumSize(JComponent c)
          返回指定组件的适合外观的最大大小。
 DimensiongetMinimumSize(JComponent c)
          最小大小为显示区域加上 insets 再加上按钮的大小。
 DimensiongetPreferredSize(JComponent c)
          返回指定组件的适合外观的首选大小。
protected  voidinstallComponents()
          创建并初始化构成聚合组合框的组件。
protected  voidinstallDefaults()
          将默认颜色、默认字体、默认渲染器和默认编辑器安装到 JComboBox 中。
protected  voidinstallKeyboardActions()
          将键盘动作添加到 JComboBox。
protected  voidinstallListeners()
          为组合框及其模型创建并安装侦听器。
 voidinstallUI(JComponent c)
          配置指定组件,使其适合外观。
 booleanisFocusTraversable(JComboBox c)
          确定 JComboBox 是否是可焦点遍历的。
protected  booleanisNavigationKey(int keyCode)
          返回提供的 keyCode 是否映射到用于导航的键。
 booleanisPopupVisible(JComboBox c)
          告知弹出控件是否可见。
 voidpaint(Graphics g, JComponent c)
          绘制指定组件,使其适合外观。
 voidpaintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus)
          绘制当前所选项。
 voidpaintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus)
          绘制当前所选项的背景。
protected  RectanglerectangleForCurrentValue()
          返回为绘制当前所选项而保留的区域。
 voidremoveEditor()
          此公共方法是特定于实现的,应该为私有,不要调用或重写。
protected  voidselectNextPossibleValue()
          选择列表中的下一项。
protected  voidselectPreviousPossibleValue()
          选择列表中的上一项。
 voidsetPopupVisible(JComboBox c, boolean v)
          隐藏弹出部分。
protected  voidtoggleOpenClose()
          如果正在显示弹出部分,则隐藏它;如果它是隐藏的,则显示它。
 voidunconfigureArrowButton()
          此公共方法是特定于实现的,应该为私有。
protected  voidunconfigureEditor()
          此受保护方法是特定于实现的,应该为私有。
protected  voiduninstallComponents()
          注销并卸载组成组合框的聚合组件。
protected  voiduninstallDefaults()
          从 JComboBox 中卸载默认颜色、默认字体、默认渲染器和默认编辑器。
protected  voiduninstallKeyboardActions()
          移除焦点 InputMap 和 ActionMap。
protected  voiduninstallListeners()
          从组合框及其模型中移除已安装的侦听器。
 voiduninstallUI(JComponent c)
          在 installUI 期间,在指定组件上反向执行的配置操作。
 
从类 javax.swing.plaf.ComponentUI 继承的方法
contains, update
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

comboBox

protected JComboBox comboBox

hasFocus

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


listBox

protected JList listBox

currentValuePane

protected CellRendererPane currentValuePane

popup

protected ComboPopup popup

editor

protected Component editor

arrowButton

protected JButton arrowButton