所有类


javax.swing.plaf.basic
类 BasicButtonUI

java.lang.Object
  继承者 javax.swing.plaf.ComponentUI
      继承者 javax.swing.plaf.ButtonUI
          继承者 javax.swing.plaf.basic.BasicButtonUI
直接已知子类:
BasicToggleButtonUI, MetalButtonUI

public class BasicButtonUI
   
   
   
   
extends ButtonUI

BasicButton 实现


字段摘要
protected  intdefaultTextIconGap
           
protected  intdefaultTextShiftOffset
           
 
构造方法摘要
BasicButtonUI()
           
 
方法摘要
protected  voidclearTextShiftOffset()
           
protected  BasicButtonListenercreateButtonListener(AbstractButton b)
           
static ComponentUIcreateUI(JComponent c)
           
 intgetDefaultTextIconGap(AbstractButton b)
           
 DimensiongetMaximumSize(JComponent c)
          返回指定组件的适合外观的最大大小。
 DimensiongetMinimumSize(JComponent c)
          返回指定组件的适合外观的最小大小。
 DimensiongetPreferredSize(JComponent c)
          返回指定组件的适合外观的首选大小。
protected  StringgetPropertyPrefix()
           
protected  intgetTextShiftOffset()
           
protected  voidinstallDefaults(AbstractButton b)
           
protected  voidinstallKeyboardActions(AbstractButton b)
           
protected  voidinstallListeners(AbstractButton b)
           
 voidinstallUI(JComponent c)
          配置指定组件,使其适合外观。
 voidpaint(Graphics g, JComponent c)
          绘制指定组件,使其适合外观。
protected  voidpaintButtonPressed(Graphics g, AbstractButton b)
           
protected  voidpaintFocus(Graphics g, AbstractButton b, Rectangle viewRect, Rectangle textRect, Rectangle iconRect)
           
protected  voidpaintIcon(Graphics g, JComponent c, Rectangle iconRect)
           
protected  voidpaintText(Graphics g, AbstractButton b, Rectangle textRect, String text)
          呈现当前按钮文本的方法。
protected  voidpaintText(Graphics g, JComponent c, Rectangle textRect, String text)
          从 Java 2 平台 v 1.4 开始,不应再使用或重写此方法。
protected  voidsetTextShiftOffset()
           
protected  voiduninstallDefaults(AbstractButton b)
           
protected  voiduninstallKeyboardActions(AbstractButton b)
           
protected  voiduninstallListeners(AbstractButton b)
           
 voiduninstallUI(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
 

字段详细信息

defaultTextIconGap

protected int defaultTextIconGap

defaultTextShiftOffset

protected int defaultTextShiftOffset
构造方法详细信息

BasicButtonUI

public BasicButtonUI()
方法详细信息

createUI

public static ComponentUI createUI(JComponent c)

getPropertyPrefix

protected String getPropertyPrefix()

installUI

public void installUI(JComponent c)
从类 ComponentUI 复制的描述
配置指定组件,使其适合外观。当 ComponentUI 实例将作为 UI 委托安装在指定组件上时,可调用此方法。此方法应该为外观完整地配置组件,包括以下方面:
  1. 在组件上安装用于颜色、字体、边框、图标、不透明性等方面的所有默认属性值。只要有可能,就 应该重写由客户端程序初始化的属性值。
  2. 如有必要,可在组件上安装一个 LayoutManager
  3. 将所需的所有子组件创建/添加到组件中。
  4. 在组件上创建/安装事件侦听器。
  5. 为了检测和适当响应组件属性更改,可在组件上创建/安装一个 PropertyChangeListener
  6. 在组件上安装键盘 UI(助记符、遍历等等)。
  7. 初始化任何适当的实例数据。

覆盖:
ComponentUI 中的 installUI
参数:
c - 将安装此 UI 委托的组件
另请参见:
ComponentUI.uninstallUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

installDefaults

protected void installDefaults(AbstractButton b)

installListeners

protected void installListeners(AbstractButton b)

installKeyboardActions

protected void installKeyboardActions(AbstractButton b)