- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.RootPaneUI
-
- javax.swing.plaf.basic.BasicRootPaneUI
-
- javax.swing.plaf.metal.MetalRootPaneUI
-
- All Implemented Interfaces:
-
PropertyChangeListener,EventListener
public class MetalRootPaneUI extends BasicRootPaneUI
提供金属外观实现RootPaneUI。MetalRootPaneUI提供windowDecorationStyle属性JRootPane。MetalRootPaneUI通过安装自定义的LayoutManager,一个私人的Component来呈现相应的小部件,以及一个私人的Border。 该LayoutManager始终安装,无论价值的windowDecorationStyle财产,但Border和Component只安装/添加如果windowDecorationStyle比其他JRootPane.NONE。警告:此类的序列化对象与将来的Swing版本不兼容。 当前的序列化支持适用于运行相同版本的Swing的应用程序之间的短期存储或RMI。 从1.4开始,支持所有JavaBeans的长期存储已被添加到
java.beans软件包中。 请参阅XMLEncoder。- 从以下版本开始:
- 1.4
-
-
构造方法摘要
构造方法 Constructor 描述 MetalRootPaneUI()
-
方法摘要
所有方法 静态方法 接口方法 具体的方法 Modifier and Type 方法 描述 static ComponentUIcreateUI(JComponent c)创建一个JRootPane的UI。voidinstallUI(JComponent c)调用超实现的installUI安装必要的状态到传递JRootPane呈现金属外观实现的RootPaneUI。voidpropertyChange(PropertyChangeEvent e)当属性更改时调用。voiduninstallUI(JComponent c)调用supers实现来卸载其任何状态。-
Methods inherited from class javax.swing.plaf.basic.BasicRootPaneUI
installComponents, installDefaults, installKeyboardActions, installListeners, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
-
-
-
-
方法详细信息
-
createUI
public static ComponentUI createUI(JComponent c)
创建一个JRootPane的UI。- 参数
-
c- 将创建JRootPane RootPaneUI - 结果
- 在JRootPane中传递的RootPaneUI实现
-
installUI
public void installUI(JComponent c)
调用installUI执行installUI,将必要的状态安装到JRootPane传递给金属外观和实现RootPaneUI。 如果windowDecorationStyle的财产JRootPane比其他JRootPane.NONE,这将一个自定义添加Component呈现小部件JRootPane,以及安装自定义Border和LayoutManager上JRootPane。- 重写:
-
installUI在BasicRootPaneUI - 参数
-
c- 将JRootPane安装到 - 另请参见:
-
ComponentUI.uninstallUI(javax.swing.JComponent),JComponent.setUI(javax.swing.plaf.ComponentUI),JComponent.updateUI()
-
uninstallUI
public void uninstallUI(JComponent c)
调用supers实现来卸载其任何状态。 这也将复位LayoutManager的JRootPane。 如果一个Component已经添加到JRootPane来渲染窗口装饰样式,这个方法将会删除它。 同样,这将将JRootPane的Border和LayoutManagerJRootPane到installUI被调用之前。- 重写:
-
uninstallUI在BasicRootPaneUI - 参数
-
c- JRootPane卸载状态 - 另请参见:
-
ComponentUI.installUI(javax.swing.JComponent),JComponent.updateUI()
-
propertyChange
public void propertyChange(PropertyChangeEvent e)
当属性更改时调用。MetalRootPaneUI主要对源自JRootPane事件感兴趣,它已被安装在识别属性windowDecorationStyle。 如果windowDecorationStyle已更改为JRootPane.NONE以外的值,则会向Component添加JRootPane以呈现窗口装饰,以及在Border上安装JRootPane。 在另一方面,如果windowDecorationStyle已更改为JRootPane.NONE,这将消除Component已添加到JRootPane边境以及重置为它以前installUI被调用。- Specified by:
-
propertyChange在接口PropertyChangeListener - 重写:
-
propertyChange在BasicRootPaneUI - 参数
-
e- 描述事件源和已更改属性的PropertyChangeEvent对象。
-
-