public class MetalButtonUI extends BasicButtonUI
警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,对所有JavaBeans的长期存储的支持已经添加到java.beans
包中。 请参阅XMLEncoder
。
Modifier and Type | Field and Description |
---|---|
protected Color |
disabledTextColor |
protected Color |
focusColor |
protected Color |
selectColor |
defaultTextIconGap, defaultTextShiftOffset
Constructor and Description |
---|
MetalButtonUI() |
Modifier and Type | Method and Description |
---|---|
protected BasicButtonListener |
createButtonListener(AbstractButton b) |
static ComponentUI |
createUI(JComponent c) |
protected Color |
getDisabledTextColor() |
protected Color |
getFocusColor() |
protected Color |
getSelectColor() |
void |
installDefaults(AbstractButton b) |
protected void |
paintButtonPressed(Graphics g, AbstractButton b) |
protected void |
paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect) |
protected void |
paintText(Graphics g, JComponent c, Rectangle textRect, String text)
从Java 2平台v 1.4开始,这种方法不应该被使用或覆盖。
|
void |
uninstallDefaults(AbstractButton b) |
void |
update(Graphics g, JComponent c)
如果需要涂抹组件的背景,然后调用
paint 。
|
clearTextShiftOffset, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, getPropertyPrefix, getTextShiftOffset, installKeyboardActions, installListeners, installUI, paint, paintIcon, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallListeners, uninstallUI
contains, getAccessibleChild, getAccessibleChildrenCount
protected Color focusColor
protected Color selectColor
protected Color disabledTextColor
public static ComponentUI createUI(JComponent c)
public void installDefaults(AbstractButton b)
public void uninstallDefaults(AbstractButton b)
protected BasicButtonListener createButtonListener(AbstractButton b)
protected Color getSelectColor()
protected Color getDisabledTextColor()
protected Color getFocusColor()
public void update(Graphics g, JComponent c)
paint
。
update
在
ComponentUI
g
- 绘制图形
c
- JComponent绘画
NullPointerException
- 如果
g
或
c
为空
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
,
ComponentUI.paint(java.awt.Graphics, javax.swing.JComponent)
protected void paintButtonPressed(Graphics g, AbstractButton b)
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)
paintFocus
在
BasicButtonUI
protected void paintText(Graphics g, JComponent c, Rectangle textRect, String text)
BasicButtonUI
paintText
在
BasicButtonUI
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.