- 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 JavaBeansTM has been added to the
java.beans
package. Please seeXMLEncoder
.- Since:
- 1.4
-
-
Constructor Summary
Constructors Constructor and Description MetalRootPaneUI()
-
Method Summary
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.
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/swing/plaf/metal/metalrootpaneui.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.