|
JavaTM Platform Standard Ed. 6 |
|||||||||
��һ���� ��һ���� | ��� ��� ������ | |||||||||
ժҪ�� Ƕ�� | �ֶ� | ���췽�� | ���� | ��ϸ��Ϣ�� �ֶ� | ���췽�� | ���� |
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.LabelUI
javax.swing.plaf.basic.BasicLabelUI
public class BasicLabelUI
LabelUI �� Windows L&F ʵ�֡���ʵ����ȫ�Ǿ�̬�ģ������� JLabel ���������һ�� UIView ʵ�֡�
�ֶ�ժҪ | |
---|---|
protected static BasicLabelUI |
labelUI
Ĭ�� BasicLabelUI ʵ���� |
���췽��ժҪ | |
---|---|
BasicLabelUI()
|
����ժҪ | |
---|---|
static ComponentUI |
createUI(JComponent c)
|
int |
getBaseline(JComponent c,
int width,
int height)
���ػ��ߡ� |
Component.BaselineResizeBehavior |
getBaselineResizeBehavior(JComponent c)
����һ��ö�٣���ָʾ����Ļ���������С�ĸı���������ġ� |
Dimension |
getMaximumSize(JComponent c)
����ָ��������ʺ���۵�����С�� |
Dimension |
getMinimumSize(JComponent c)
����ָ��������ʺ���۵���С��С�� |
Dimension |
getPreferredSize(JComponent c)
����ָ��������ʺ���۵���ѡ��С�� |
protected void |
installComponents(JLabel c)
|
protected void |
installDefaults(JLabel c)
|
protected void |
installKeyboardActions(JLabel l)
|
protected void |
installListeners(JLabel c)
|
void |
installUI(JComponent c)
����ָ�������ʹ���ʺ���ۡ� |
protected String |
layoutCL(JLabel label,
FontMetrics fontMetrics,
String text,
Icon icon,
Rectangle viewR,
Rectangle iconR,
Rectangle textR)
������ת���� SwingUtilities.layoutCompoundLabel()�� |
void |
paint(Graphics g,
JComponent c)
ʹ��ǰ��ɫ���Ʊ�ǩ�ı��������ǩ�����������ñ���ɫ�������������� |
protected void |
paintDisabledText(JLabel l,
Graphics g,
String s,
int textX,
int textY)
���� background.lighter() �� clippedText ������ textX��textY ����Ȼ������ background.darker() �������ƶ�һ�����ء� |
protected void |
paintEnabledText(JLabel l,
Graphics g,
String s,
int textX,
int textY)
���ñ�ǩ��ǰ��ɫ�� clippedText ������ textX��textY ���� |
void |
propertyChange(PropertyChangeEvent e)
�ڰ����Է�������ʱ���ô˷����� |
protected void |
uninstallComponents(JLabel c)
|
protected void |
uninstallDefaults(JLabel c)
|
protected void |
uninstallKeyboardActions(JLabel c)
|
protected void |
uninstallListeners(JLabel c)
|
void |
uninstallUI(JComponent c)
�� installUI �ڼ䣬��ָ������Ϸ���ִ�е����ò����� |
���� javax.swing.plaf.ComponentUI �̳еķ��� |
---|
contains, getAccessibleChild, getAccessibleChildrenCount, update |
���� java.lang.Object �̳еķ��� |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
�ֶ���ϸ��Ϣ |
---|
protected static BasicLabelUI labelUI
BasicLabelUI
ʵ�������Բ�ʹ�ô��ֶΡ�Ҫ����Ĭ��ʵ������ʹ����д createUI
���������࣬����������������Ĭ�ϱ��� "LabelUI" ��֮�¡�
���췽����ϸ��Ϣ |
---|
public BasicLabelUI()
������ϸ��Ϣ |
---|
protected String layoutCL(JLabel label, FontMetrics fontMetrics, String text, Icon icon, Rectangle viewR, Rectangle iconR, Rectangle textR)
SwingUtilities.layoutCompoundLabel(javax.swing.JComponent, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, int, int, int, int, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle, int)
protected void paintEnabledText(JLabel l, Graphics g, String s, int textX, int textY)
paint(java.awt.Graphics, javax.swing.JComponent)
,
paintDisabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)
protected void paintDisabledText(JLabel l, Graphics g, String s, int textX, int textY)
paint(java.awt.Graphics, javax.swing.JComponent)
,
paintEnabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)
public void paint(Graphics g, JComponent c)
ComponentUI
�е� paint
g
- �������н��л��Ƶ� Graphics
������c
- �����Ƶ�������˲����������ԣ������ UI ��������״̬�IJ��ɶ����������������ʹ�øò���paintEnabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)
,
paintDisabledText(javax.swing.JLabel, java.awt.Graphics, java.lang.String, int, int)
,
layoutCL(javax.swing.JLabel, java.awt.FontMetrics, java.lang.String, javax.swing.Icon, java.awt.Rectangle, java.awt.Rectangle, java.awt.Rectangle)
public Dimension getPreferredSize(JComponent c)
ComponentUI
���Ƶ�����null
������ѡ��С��������IJ��ֹ��������㣨���ڰ�װ���ض����ֹ�������������ԣ�������ѡ���������˷�����Ĭ��ʵ�ַ��� null
��
ComponentUI
�е� getPreferredSize
c
- ����ѯ����ѡ��С��������˲����������ԣ������ UI ��������״̬�IJ��ɶ����������������ʹ�øò���JComponent.getPreferredSize()
,
LayoutManager.preferredLayoutSize(java.awt.Container)
public Dimension getMinimumSize(JComponent c)
ComponentUI
���Ƶ�����null
������С��С��������IJ��ֹ��������㣨���ڰ�װ���ض����ֹ�������������ԣ�������ѡ���������˷�����Ĭ��ʵ�ֵ��� getPreferredSize
�����ظ�ֵ��
ComponentUI
�е� getMinimumSize
c
- ����ѯ����С��С��������˲����������ԣ������ UI ��������״̬�IJ��ɶ����������������ʹ�øò���
JComponent.getMinimumSize()
,
LayoutManager.minimumLayoutSize(java.awt.Container)
,
ComponentUI.getPreferredSize(javax.swing.JComponent)
public Dimension getMaximumSize(JComponent c)
ComponentUI
���Ƶ�����null
��������С��������IJ��ֹ��������㣨���ڰ�װ���ض����ֹ�������������ԣ�������ѡ���������˷�����Ĭ��ʵ�ֵ��� getPreferredSize
�����ظ�ֵ��
ComponentUI
�е� getMaximumSize
c
- ����ѯ������С��������˲����������ԣ������ UI ��������״̬�IJ��ɶ����������������ʹ�øò���
JComponent.getMaximumSize()
,
LayoutManager2.maximumLayoutSize(java.awt.Container)
public int getBaseline(JComponent c, int width, int height)
ComponentUI
�е� getBaseline
c
- Ϊ��������ߵ� JComponent
width
- Ϊ���ȡ���ߵĿ���height
- Ϊ���ȡ���ߵĸ߶�
NullPointerException
- ��� c
Ϊ null
IllegalArgumentException
- ������Ȼ�߶� < 0JComponent.getBaseline(int, int)
public Component.BaselineResizeBehavior getBaselineResizeBehavior(JComponent c)
ComponentUI
�е� getBaselineResizeBehavior
c
- Ϊ�䷵�ص�����С��Ϊ�� JComponent
NullPointerException
- ��� c
Ϊ null
JComponent.getBaseline(int, int)
public void installUI(JComponent c)
ComponentUI
���Ƶ�����ComponentUI
ʵ������Ϊ UI ί�а�װ��ָ�������ʱ���ɵ��ô˷������˷���Ӧ��Ϊ�������������������������·��棺
LayoutManager
��
PropertyChangeListener
��
ComponentUI
�е� installUI
c
- ����װ�� UI ί�е����ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public void uninstallUI(JComponent c)
ComponentUI
���Ƶ�����installUI
�ڼ䣬��ָ������Ϸ���ִ�е����ò��������� UIComponent
ʵ������Ϊ UI ί�д�ָ��������Ƴ�ʱ���ɵ��ô˷������˷���Ӧ��ȡ���� installUI
��ִ�е����ò������dz�С�ĵ�ʹ JComponent
ʵ������ij�ֽྻ״̬��û�ж������������û���ض�����۵����Զ���ȵ�)����������Ӧ�ð������·��棺
ComponentUI
�е� uninstallUI
c
- �����Ƴ��� UI ί�е�������˲����������ԣ������ UI ��������״̬�IJ��ɶ����������������ʹ�øò���ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.updateUI()
protected void installDefaults(JLabel c)
protected void installListeners(JLabel c)
protected void installComponents(JLabel c)
protected void installKeyboardActions(JLabel l)
protected void uninstallDefaults(JLabel c)
protected void uninstallListeners(JLabel c)
protected void uninstallComponents(JLabel c)
protected void uninstallKeyboardActions(JLabel c)
public static ComponentUI createUI(JComponent c)
public void propertyChange(PropertyChangeEvent e)
PropertyChangeListener
���Ƶ�����
PropertyChangeListener
�е� propertyChange
e
- �����¼�Դ���Ѹ������Ե� PropertyChangeEvent ����
|
JavaTM Platform Standard Ed. 6 |
|||||||||
��һ���� ��һ���� | ��� ��� ������ | |||||||||
ժҪ�� Ƕ�� | �ֶ� | ���췽�� | ���� | ��ϸ��Ϣ�� �ֶ� | ���췽�� | ���� |
��Ȩ���� 2007 Sun Microsystems, Inc. ��������Ȩ���� ����������֤��������������ĵ����·ַ�������