public class MetalToggleButtonUI extends BasicToggleButtonUI
警告:此类的序列化对象与将来的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 |
---|
MetalToggleButtonUI() |
Modifier and Type | Method and Description |
---|---|
static ComponentUI |
createUI(JComponent b) |
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 |
paintIcon(Graphics g, AbstractButton b, Rectangle iconRect)
在空间
iconRect 按钮
b 的相应图标。
|
protected void |
paintText(Graphics g, JComponent c, Rectangle textRect, String text)
从Java 2平台v 1.4开始,这种方法不应该被使用或覆盖。
|
protected void |
uninstallDefaults(AbstractButton b) |
void |
update(Graphics g, JComponent c)
如果需要涂抹组件的背景,然后调用
paint 。
|
getPropertyPrefix, getTextShiftOffset, paint
clearTextShiftOffset, createButtonListener, getBaseline, getBaselineResizeBehavior, getDefaultTextIconGap, getMaximumSize, getMinimumSize, getPreferredSize, installKeyboardActions, installListeners, installUI, paintIcon, paintText, setTextShiftOffset, uninstallKeyboardActions, uninstallListeners, uninstallUI
contains, getAccessibleChild, getAccessibleChildrenCount
protected Color focusColor
protected Color selectColor
protected Color disabledTextColor
public static ComponentUI createUI(JComponent b)
public void installDefaults(AbstractButton b)
protected void uninstallDefaults(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 paintText(Graphics g, JComponent c, Rectangle textRect, String text)
BasicButtonUI
paintText
在
BasicButtonUI
protected void paintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)
paintFocus
在
BasicButtonUI
protected void paintIcon(Graphics g, AbstractButton b, Rectangle iconRect)
iconRect
按钮
b
的相应图标。
paintIcon
在
BasicToggleButtonUI
g
- 绘图的图形
b
- 要呈现的按钮
iconRect
- 要呈现的空间
NullPointerException
- 如果任何参数为空。
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.