- 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 Description MetalRootPaneUI()
-
Method Summary
Modifier and Type Method 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 declared in class javax.swing.plaf.basic.BasicRootPaneUI
installComponents, installDefaults, installKeyboardActions, installListeners, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners
-
Methods declared in 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 classComponentUI
- 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 classComponentUI
- 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.
-
-