JavaTM 2 Platform
Standard Ed. 5.0

javax.swing.plaf.basic
类 BasicDesktopIconUI

java.lang.Object
  继承者 javax.swing.plaf.ComponentUI
      继承者 javax.swing.plaf.DesktopIconUI
          继承者 javax.swing.plaf.basic.BasicDesktopIconUI
直接已知子类:
MetalDesktopIconUI

public class BasicDesktopIconUI
extends DesktopIconUI

用于桌面最小化窗口的 L&F。


嵌套类摘要
 class BasicDesktopIconUI.MouseInputHandler
          侦听鼠标移动及对其操作。
 
字段摘要
protected  JInternalFrame.JDesktopIcon desktopIcon
           
protected  JInternalFrame frame
           
protected  JComponent iconPane
          在桌面图标中使用的标题窗格组件。
 
构造方法摘要
BasicDesktopIconUI()
           
 
方法摘要
protected  MouseInputListener createMouseInputListener()
           
static ComponentUI createUI(JComponent c)
           
 void deiconize()
           
 Insets getInsets(JComponent c)
           
 Dimension getMaximumSize(JComponent c)
          不能调整桌面图标的大小。
 Dimension getMinimumSize(JComponent c)
          返回指定组件的适合外观的最小大小。
 Dimension getPreferredSize(JComponent c)
          返回指定组件的适合外观的首选大小。
protected  void installComponents()
           
protected  void installDefaults()
           
protected  void installListeners()
           
 void installUI(JComponent c)
          配置指定组件,使其适合外观。
protected  void uninstallComponents()
           
protected  void uninstallDefaults()
           
protected  void uninstallListeners()
           
 void uninstallUI(JComponent c)
          在 installUI 期间,在指定组件上反向执行的配置操作。
 
从类 javax.swing.plaf.ComponentUI 继承的方法
contains, getAccessibleChild, getAccessibleChildrenCount, paint, update
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

desktopIcon

protected JInternalFrame.JDesktopIcon desktopIcon

frame

protected JInternalFrame frame

iconPane

protected JComponent iconPane
在桌面图标中使用的标题窗格组件。

从以下版本开始:
1.5
构造方法详细信息

BasicDesktopIconUI

public BasicDesktopIconUI()
方法详细信息

createUI

public static ComponentUI createUI(JComponent c)

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()

uninstallUI

public void uninstallUI(JComponent c)
从类 ComponentUI 复制的描述
installUI 期间,在指定组件上反向执行的配置操作。当此 UIComponent 实例将作为 UI 委托从指定组件上移除时,可调用此方法。此方法应该取消在 installUI 中执行的配置操作,非常小心地使 JComponent 实例处于某种洁净状态(没有额外的侦听器、没有特定于外观的属性对象等等)。配置内容应该包括以下方面:
  1. 从组件中移除所有 UI 设置的边框。
  2. 从组件上移除所有 UI 设置的布局管理器。
  3. 从组件中移除所有 UI 添加的子组件。
  4. 从组件中移除所有 UI 添加的事件/属性侦听器。
  5. 从组件中移除所有 UI 安装的键盘 UI。
  6. 使所有已分配的实例数据对象无效,从而允许进行 GC 操作。

覆盖:
ComponentUI 中的 uninstallUI
参数:
c - 从中移除此 UI 委托的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数
另请参见:
ComponentUI.installUI(javax.swing.JComponent), JComponent.updateUI()

installComponents

protected void installComponents()

uninstallComponents

protected void uninstallComponents()

installListeners

protected void installListeners()

uninstallListeners

protected void uninstallListeners()

installDefaults

protected void installDefaults()

uninstallDefaults

protected void uninstallDefaults()

createMouseInputListener

protected MouseInputListener createMouseInputListener()

getPreferredSize

public Dimension getPreferredSize(JComponent c)
从类 ComponentUI 复制的描述
返回指定组件的适合外观的首选大小。如果返回 null,则首选大小将由组件的布局管理器计算(对于安装了特定布局管理器的组件而言,这是首选方法)。此方法的默认实现返回 null

覆盖:
ComponentUI 中的 getPreferredSize
参数:
c - 将查询其首选大小的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数
另请参见:
JComponent.getPreferredSize(), LayoutManager.preferredLayoutSize(java.awt.Container)

getMinimumSize

public Dimension getMinimumSize(JComponent c)
从类 ComponentUI 复制的描述
返回指定组件的适合外观的最小大小。如果返回 null,则最小大小将由组件的布局管理器计算(对于安装了特定布局管理器的组件而言,这是首选方法)。此方法的默认实现调用 getPreferredSize 并返回该值。

覆盖:
ComponentUI 中的 getMinimumSize
参数:
c - 将查询其最小大小的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数
返回:
一个 Dimension 对象或 null
另请参见:
JComponent.getMinimumSize(), LayoutManager.minimumLayoutSize(java.awt.Container), ComponentUI.getPreferredSize(javax.swing.JComponent)

getMaximumSize

public Dimension getMaximumSize(JComponent c)
不能调整桌面图标的大小。因此,应该始终返回桌面图标的最小大小。

覆盖:
ComponentUI 中的 getMaximumSize
参数:
c - 将查询其最大大小的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数
返回:
一个 Dimension 对象或 null
另请参见:
getMinimumSize(javax.swing.JComponent)

getInsets

public Insets getInsets(JComponent c)

deiconize

public void deiconize()

JavaTM 2 Platform
Standard Ed. 5.0

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策