JavaTM Platform
Standard Ed. 6

javax.swing.plaf.metal
�� MetalComboBoxUI

java.lang.Object
  �̳��� javax.swing.plaf.ComponentUI
      �̳��� javax.swing.plaf.ComboBoxUI
          �̳��� javax.swing.plaf.basic.BasicComboBoxUI
              �̳��� javax.swing.plaf.metal.MetalComboBoxUI

public class MetalComboBoxUI
extends BasicComboBoxUI

JComboBox �� Metal UI

���棺����������л��������Ժ�� Swing �汾�����ݡ���ǰ���л�֧�������ڶ��ڴ洢��������ͬ Swing �汾��Ӧ�ó���֮��� RMI���� 1.4 �汾��ʼ������ java.beans ����������֧������ JavaBeansTM ���ڴ洢�Ĺ��ܡ���μ� XMLEncoder��

������
MetalComboBoxEditor, MetalComboBoxButton

Ƕ����ժҪ
 class MetalComboBoxUI.MetalComboBoxLayoutManager
          ���ڲ�������������϶������Ϊ "public"��
 class MetalComboBoxUI.MetalComboPopup
          �ѹ�ʱ�� �� Java 2 platform v1.4 ��ʼ��
 class MetalComboBoxUI.MetalPropertyChangeListener
          ���ڲ������ڱ��������϶������Ϊ "public"��
 
���� javax.swing.plaf.basic.BasicComboBoxUI �̳е�Ƕ����/�ӿ�
BasicComboBoxUI.ComboBoxLayoutManager, BasicComboBoxUI.FocusHandler, BasicComboBoxUI.ItemHandler, BasicComboBoxUI.KeyHandler, BasicComboBoxUI.ListDataHandler, BasicComboBoxUI.PropertyChangeHandler
 
�ֶ�ժҪ
 
���� javax.swing.plaf.basic.BasicComboBoxUI �̳е��ֶ�
arrowButton, cachedMinimumSize, comboBox, currentValuePane, editor, focusListener, hasFocus, isMinimumSizeDirty, itemListener, keyListener, listBox, listDataListener, popup, popupKeyListener, popupMouseListener, popupMouseMotionListener, propertyChangeListener
 
���췽��ժҪ
MetalComboBoxUI()
           
 
����ժҪ
 void configureEditor()
          ���ܱ����������ض���ʵ�ֵģ�Ӧ��Ϊ˽�У���Ҫ���û���д��
protected  JButton createArrowButton()
          ����һ����ť����ʹ������������ʾ��������Ͽ�ĵ������֡�
protected  ComboBoxEditor createEditor()
          �������ڿɱ༭����Ͽ���ʹ�õ�Ĭ�ϱ༭����
protected  LayoutManager createLayoutManager()
          �������ڹ���������Ͽ������IJ��ֹ�������
protected  ComboPopup createPopup()
          ������Ͽ�ĵ������֡�
 PropertyChangeListener createPropertyChangeListener()
          ���������ӵ���Ͽ�� PropertyChangeListener��
static ComponentUI createUI(JComponent c)
           
protected  void editablePropertyChanged(PropertyChangeEvent e)
          �ѹ�ʱ�� �� Java 2 platform v1.4 ��ʼ��
 int getBaseline(JComponent c, int width, int height)
          ���ػ��ߡ�
 Dimension getMinimumSize(JComponent c)
          ��С��СΪ��ʾ������� insets �ټ��ϰ�ť�Ĵ�С��
 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 platform v1.4 ��ʼ��
 void unconfigureEditor()
          ���ܱ����������ض���ʵ�ֵģ�Ӧ��Ϊ˽�С�
 
���� javax.swing.plaf.basic.BasicComboBoxUI �̳еķ���
addEditor, configureArrowButton, createFocusListener, createItemListener, createKeyListener, createListDataListener, createRenderer, getAccessibleChild, getAccessibleChildrenCount, getBaselineResizeBehavior, getDefaultSize, getDisplaySize, getInsets, getMaximumSize, getPreferredSize, installComponents, installDefaults, installKeyboardActions, installListeners, installUI, isFocusTraversable, isNavigationKey, isPopupVisible, rectangleForCurrentValue, removeEditor, selectNextPossibleValue, selectPreviousPossibleValue, setPopupVisible, toggleOpenClose, unconfigureArrowButton, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners, uninstallUI
 
���� javax.swing.plaf.ComponentUI �̳еķ���
contains, update
 
���� java.lang.Object �̳еķ���
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

���췽����ϸ��Ϣ

MetalComboBoxUI

public MetalComboBoxUI()
������ϸ��Ϣ

createUI

public static ComponentUI createUI(JComponent c)

paint

public void paint(Graphics g,
                  JComponent c)
���� ComponentUI ���Ƶ�����
����ָ�������ʹ���ʺ���ۡ��ڽ�Ҫ����ָ�����ʱ���� ComponentUI.update �����е��ô˷���������Ӧ����д�˷�����ʹ��ָ�� Graphics ������������������ݡ�

���ǣ�
�� BasicComboBoxUI �е� paint
������
g - �������н��л��Ƶ� Graphics ������
c - �����Ƶ�������˲����������ԣ������ UI ��������״̬�IJ��ɶ����������������ʹ�øò���
������
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)

paintCurrentValue

public void paintCurrentValue(Graphics g,
                              Rectangle bounds,
                              boolean hasFocus)
���б�Ҫ�����Ƶ�ǰ��ѡ�

���ǣ�
�� BasicComboBoxUI �е� paintCurrentValue
������
g - ��Ϊ����Ŀ��� Graphic
bounds - ��ǰֵ�Ļ��Ʒ�Χ
hasFocus - JComboBox �Ƿ�ӵ�н���
�׳���
NullPointerException - ������в�����Ϊ null��
�����°汾��ʼ��
1.5

paintCurrentValueBackground

public void paintCurrentValueBackground(Graphics g,
                                        Rectangle bounds,
                                        boolean hasFocus)
���б�Ҫ�����Ƶ�ǰ��ѡ��ı�����

���ǣ�
�� BasicComboBoxUI �е� paintCurrentValueBackground
������
g - ��Ϊ����Ŀ��� Graphic
bounds - �����Ļ��Ʒ�Χ
hasFocus - JComboBox �Ƿ�ӵ�н���
�׳���
NullPointerException - ������в�����Ϊ null��
�����°汾��ʼ��
1.5

getBaseline

public int getBaseline(JComponent c,
                       int width,
                       int height)
���ػ��ߡ�

���ǣ�
�� BasicComboBoxUI �е� getBaseline
������
c - Ϊ��������ߵ� JComponent
width - Ϊ���ȡ���ߵĿ���
height - Ϊ���ȡ���ߵĸ߶�
���أ�
���ߣ����û�к����Ļ��ߣ��򷵻� < 0 ��ֵ
�׳���
NullPointerException - ��� c Ϊ null
IllegalArgumentException - ������Ȼ�߶� < 0
�����°汾��ʼ��
1.6
������
JComponent.getBaseline(int, int)

createEditor

protected ComboBoxEditor createEditor()
���� BasicComboBoxUI ���Ƶ�����
�������ڿɱ༭����Ͽ���ʹ�õ�Ĭ�ϱ༭��������û������ setEditor ��ʽ���ñ༭��ʱ��ʹ��Ĭ�ϱ༭����

���ǣ�
�� BasicComboBoxUI �е� createEditor
���أ�
������Ͽ�� ComboBoxEditor
������
JComboBox.setEditor(javax.swing.ComboBoxEditor)

createPopup

protected ComboPopup createPopup()
���� BasicComboBoxUI ���Ƶ�����
������Ͽ�ĵ������֡�

���ǣ�
�� BasicComboBoxUI �е� createPopup
���أ�
ComboPopup ��ʵ��
������
ComboPopup

createArrowButton

protected JButton createArrowButton()
���� BasicComboBoxUI ���Ƶ�����
����һ����ť����ʹ������������ʾ��������Ͽ�ĵ������֡�

���ǣ�
�� BasicComboBoxUI �е� createArrowButton
���أ�
��ʾ�����ؼ��İ�ť

createPropertyChangeListener

public PropertyChangeListener createPropertyChangeListener()
���� BasicComboBoxUI ���Ƶ�����
���������ӵ���Ͽ�� PropertyChangeListener������˷������� null���򲻻Ὣ�����ӵ���Ͽ�

���ǣ�
�� BasicComboBoxUI �е� createPropertyChangeListener
���أ�
PropertyChangeListener ��ʵ���� null

editablePropertyChanged

@Deprecated
protected void editablePropertyChanged(PropertyChangeEvent e)
�ѹ�ʱ�� �� Java 2 platform v1.4 ��ʼ��

�� Java 2 platform v1.4 ��ʼ���˷�������ʹ�á���Ҫ���û���д�˷������˷��������й��ܶ��� MetalPropertyChangeListener �С�


createLayoutManager

protected LayoutManager createLayoutManager()
���� BasicComboBoxUI ���Ƶ�����
�������ڹ���������Ͽ������IJ��ֹ�������

���ǣ�
�� BasicComboBoxUI �е� createLayoutManager
���أ�
���ֹ�������ʵ��

layoutComboBox

public void layoutComboBox(Container parent,
                           MetalComboBoxUI.MetalComboBoxLayoutManager manager)

removeListeners

@Deprecated
protected void removeListeners()
�ѹ�ʱ�� �� Java 2 platform v1.4 ��ʼ��

�� Java 2 platform v1.4 ��ʼ���˷�������ʹ�á�


configureEditor

public void configureEditor()
���� BasicComboBoxUI ���Ƶ�����
���ܱ����������ض���ʵ�ֵģ�Ӧ��Ϊ˽�У���Ҫ���û���д��

���ǣ�
�� BasicComboBoxUI �е� configureEditor
������
BasicComboBoxUI.addEditor()

unconfigureEditor

public void unconfigureEditor()
���� BasicComboBoxUI ���Ƶ�����
���ܱ����������ض���ʵ�ֵģ�Ӧ��Ϊ˽�С���Ҫ���û���д��

���ǣ�
�� BasicComboBoxUI �е� unconfigureEditor
������
BasicComboBoxUI.addEditor()

getMinimumSize

public Dimension getMinimumSize(JComponent c)
���� BasicComboBoxUI ���Ƶ�����
��С��СΪ��ʾ������� insets �ټ��ϰ�ť�Ĵ�С��

���ǣ�
�� BasicComboBoxUI �е� getMinimumSize
������
c - ����ѯ����С��С��������˲����������ԣ������ UI ��������״̬�IJ��ɶ����������������ʹ�øò���
���أ�
һ�� Dimension ����� null
������
JComponent.getMinimumSize(), LayoutManager.minimumLayoutSize(java.awt.Container), ComponentUI.getPreferredSize(javax.swing.JComponent)

JavaTM Platform
Standard Ed. 6

�ύ��������
�йظ���� API �ο����ϺͿ�����Ա�ĵ�������� Java SE ������Ա�ĵ������ĵ���������ϸ�ġ����򿪷���Ա���������Լ�������������ﶨ�塢ʹ�ü��ɺ͹�������ʾ����

��Ȩ���� 2007 Sun Microsystems, Inc. ��������Ȩ���� ����������֤��������������ĵ����·ַ�������