public class MetalComboBoxUI extends BasicComboBoxUI
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans
包。请看XMLEncoder
。
Modifier and Type | Class and Description |
---|---|
class |
MetalComboBoxUI.MetalComboBoxLayoutManager
这个类应该被视为一个“受保护的”内部类。
|
class |
MetalComboBoxUI.MetalComboPopup
过时的。
作为java 2平台V1.4。
|
class |
MetalComboBoxUI.MetalPropertyChangeListener
这个类应该被视为一个“受保护的”内部类。
|
BasicComboBoxUI.ComboBoxLayoutManager, BasicComboBoxUI.FocusHandler, BasicComboBoxUI.ItemHandler, BasicComboBoxUI.KeyHandler, BasicComboBoxUI.ListDataHandler, BasicComboBoxUI.PropertyChangeHandler
arrowButton, cachedMinimumSize, comboBox, currentValuePane, editor, focusListener, hasFocus, isMinimumSizeDirty, itemListener, keyListener, listBox, listDataListener, padding, popup, popupKeyListener, popupMouseListener, popupMouseMotionListener, propertyChangeListener, squareButton
Constructor and Description |
---|
MetalComboBoxUI() |
Modifier and Type | Method and Description |
---|---|
void |
configureEditor()
这种保护的方法是实现特定的,应该是私有的。
|
protected JButton |
createArrowButton()
创建一个按钮可显示或隐藏的组合框弹出部分的控制。
|
protected ComboBoxEditor |
createEditor()
创建默认的编辑器,用于编辑组合框。
|
protected LayoutManager |
createLayoutManager()
创建一个用于管理组成组合框的组件的布局管理器。
|
protected ComboPopup |
createPopup()
创建组合框弹出的部分。
|
PropertyChangeListener |
createPropertyChangeListener()
创建一个
PropertyChangeListener 这将被添加到组合框。
|
static ComponentUI |
createUI(JComponent c) |
protected void |
editablePropertyChanged(PropertyChangeEvent e)
过时的。
作为java 2平台V1.4。
|
int |
getBaseline(JComponent c, int width, int height)
返回基线。
|
Dimension |
getMinimumSize(JComponent c)
最小尺寸的显示面积加上插图加按钮的大小。
|
void |
layoutComboBox(Container parent, MetalComboBoxUI.MetalComboBoxLayoutManager manager) |
void |
paint(Graphics g, JComponent c)
适当地绘制指定的组件的外观和感觉。
|
void |
paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus)
如果必要,绘制当前选定的项目。
|
void |
paintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus)
如果必要的话,绘制当前选定项目的背景。
|
protected void |
removeListeners()
过时的。
作为java 2平台V1.4。
|
void |
unconfigureEditor()
这种保护的方法是实现特定的,应该是私有的。
|
addEditor, configureArrowButton, createFocusListener, createItemListener, createKeyListener, createListDataListener, createRenderer, getAccessibleChild, getAccessibleChildrenCount, getBaselineResizeBehavior, getDefaultSize, getDisplaySize, getInsets, getMaximumSize, getPreferredSize, getSizeForComponent, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, isFocusTraversable, isNavigationKey, isPopupVisible, rectangleForCurrentValue, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureArrowButton, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
contains, update
public static ComponentUI createUI(JComponent c)
public void paint(Graphics g, JComponent c)
ComponentUI
ComponentUI.update
方法调用时指定的组件正在粉刷。子类应重写此方法,并使用指定的
Graphics
对象呈现的成分含量。
paint
方法重写,继承类
BasicComboBoxUI
g
-
Graphics
背景的画
c
-正在绘制的构件;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
public void paintCurrentValue(Graphics g, Rectangle bounds, boolean hasFocus)
paintCurrentValue
方法重写,继承类
BasicComboBoxUI
g
图形绘
bounds
区画电流值
hasFocus
是否具有焦点的JComboBox
NullPointerException
如果任一参数为空。
public void paintCurrentValueBackground(Graphics g, Rectangle bounds, boolean hasFocus)
paintCurrentValueBackground
方法重写,继承类
BasicComboBoxUI
g
图形绘
bounds
区画背景
hasFocus
是否具有焦点的JComboBox
NullPointerException
如果任一参数为空。
public int getBaseline(JComponent c, int width, int height)
getBaseline
方法重写,继承类
BasicComboBoxUI
c
-
JComponent
基线被要求
width
的宽度得到基线
height
-高度得到基线
null
c
NullPointerException
IllegalArgumentException
如果宽度或高度小于0
JComponent.getBaseline(int, int)
protected ComboBoxEditor createEditor()
BasicComboBoxUI
setEditor
使用。
createEditor
方法重写,继承类
BasicComboBoxUI
ComboBoxEditor
JComboBox.setEditor(javax.swing.ComboBoxEditor)
protected ComboPopup createPopup()
BasicComboBoxUI
createPopup
方法重写,继承类
BasicComboBoxUI
ComboPopup
实例
ComboPopup
protected JButton createArrowButton()
BasicComboBoxUI
createArrowButton
方法重写,继承类
BasicComboBoxUI
public PropertyChangeListener createPropertyChangeListener()
BasicComboBoxUI
PropertyChangeListener
这将被添加到组合框。如果此方法返回的空值,则不会被添加到组合框中。
createPropertyChangeListener
方法重写,继承类
BasicComboBoxUI
PropertyChangeListener
或空的实例
@Deprecated protected void editablePropertyChanged(PropertyChangeEvent e)
protected LayoutManager createLayoutManager()
BasicComboBoxUI
createLayoutManager
方法重写,继承类
BasicComboBoxUI
public void layoutComboBox(Container parent, MetalComboBoxUI.MetalComboBoxLayoutManager manager)
@Deprecated protected void removeListeners()
public void configureEditor()
BasicComboBoxUI
configureEditor
方法重写,继承类
BasicComboBoxUI
BasicComboBoxUI.addEditor()
public void unconfigureEditor()
BasicComboBoxUI
unconfigureEditor
方法重写,继承类
BasicComboBoxUI
BasicComboBoxUI.addEditor()
public Dimension getMinimumSize(JComponent c)
BasicComboBoxUI
getMinimumSize
方法重写,继承类
BasicComboBoxUI
c
最小尺寸的是被查询的成分;这种说法常常被忽视,但可能如果UI对象是无状态的,共享由多个组件
Dimension
对象或
null
JComponent.getMinimumSize()
,
LayoutManager.minimumLayoutSize(java.awt.Container)
,
ComponentUI.getPreferredSize(javax.swing.JComponent)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.