Class MetalRootPaneUI
- 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
Provides the metal look and feel implementation ofRootPaneUI
.MetalRootPaneUI
provides support for thewindowDecorationStyle
property ofJRootPane
.MetalRootPaneUI
does this by way of installing a customLayoutManager
, a privateComponent
to render the appropriate widgets, and a privateBorder
. TheLayoutManager
is always installed, regardless of the value of thewindowDecorationStyle
property, but theBorder
andComponent
are only installed/added if thewindowDecorationStyle
is other thanJRootPane.NONE
.Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans™ has been added to the
java.beans
package. Please seeXMLEncoder
.- Since:
- 1.4
-
-
Constructor Summary
Constructors Constructor and Description MetalRootPaneUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static ComponentUI
createUI(JComponent c)
Creates a UI for aJRootPane
.void
installUI(JComponent c)
Invokes supers implementation ofinstallUI
to install the necessary state onto the passed inJRootPane
to render the metal look and feel implementation ofRootPaneUI
.void
propertyChange(PropertyChangeEvent e)
Invoked when a property changes.void
uninstallUI(JComponent c)
Invokes supers implementation to uninstall any of its state.-
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
-
-
-
-
Method Detail
createUI
public static ComponentUI createUI(JComponent c)
Creates a UI for aJRootPane
.- Parameters:
-
c
- the JRootPane the RootPaneUI will be created for - Returns:
- the RootPaneUI implementation for the passed in JRootPane
installUI
public void installUI(JComponent c)
Invokes supers implementation ofinstallUI
to install the necessary state onto the passed inJRootPane
to render the metal look and feel implementation ofRootPaneUI
. If thewindowDecorationStyle
property of theJRootPane
is other thanJRootPane.NONE
, this will add a customComponent
to render the widgets toJRootPane
, as well as installing a customBorder
andLayoutManager
on theJRootPane
.- Overrides:
-
installUI
in classBasicRootPaneUI
- Parameters:
-
c
- the JRootPane to install state onto - See Also:
-
ComponentUI.uninstallUI(javax.swing.JComponent)
,JComponent.setUI(javax.swing.plaf.ComponentUI)
,JComponent.updateUI()
uninstallUI
public void uninstallUI(JComponent c)
Invokes supers implementation to uninstall any of its state. This will also reset theLayoutManager
of theJRootPane
. If aComponent
has been added to theJRootPane
to render the window decoration style, this method will remove it. Similarly, this will revert the Border and LayoutManager of theJRootPane
to what it was beforeinstallUI
was invoked.- Overrides:
-
uninstallUI
in classBasicRootPaneUI
- Parameters:
-
c
- the JRootPane to uninstall state from - See Also:
-
ComponentUI.installUI(javax.swing.JComponent)
,JComponent.updateUI()
propertyChange
public void propertyChange(PropertyChangeEvent e)
Invoked when a property changes.MetalRootPaneUI
is primarily interested in events originating from theJRootPane
it has been installed on identifying the propertywindowDecorationStyle
. If thewindowDecorationStyle
has changed to a value other thanJRootPane.NONE
, this will add aComponent
to theJRootPane
to render the window decorations, as well as installing aBorder
on theJRootPane
. On the other hand, if thewindowDecorationStyle
has changed toJRootPane.NONE
, this will remove theComponent
that has been added to theJRootPane
as well resetting the Border to what it was beforeinstallUI
was invoked.- Specified by:
-
propertyChange
in interfacePropertyChangeListener
- Overrides:
-
propertyChange
in classBasicRootPaneUI
- Parameters:
-
e
- A PropertyChangeEvent object describing the event source and the property that has changed.
-
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, 2022, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.