Class BaseRootPaneUI
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
- Direct Known Subclasses:
AcrylRootPaneUI
,AeroRootPaneUI
,AluminiumRootPaneUI
,BernsteinRootPaneUI
,FastRootPaneUI
,GraphiteRootPaneUI
,HiFiRootPaneUI
,LunaRootPaneUI
,McWinRootPaneUI
,MintRootPaneUI
,SmartRootPaneUI
,TextureRootPaneUI
BaseRootPaneUI provides support for the windowDecorationStyle property of JRootPane. BaseRootPaneUI does this by way of installing a custom LayoutManager, a private Component to render the appropriate widgets, and a private Border. The LayoutManager is always installed, regardless of the value of the windowDecorationStyle property, but the Border and Component are only installed/added if the windowDecorationStyle is other than JRootPane.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 TM has been added to the java.beans package. Please
see XMLEncoder
.
- Since:
- 1.4
- Version:
- 1.20 04/27/04 Author Terry Kellerman Author Michael Hagen
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Constant COLOR_CHOOSER_DIALOG=5static final int
Constant ERROR_DIALOG=4static final int
Constant FILE_CHOOSER_DIALOG=6static final int
Constant FRAME=1static final int
Constant INFORMATION_DIALOG=3static final int
Constant MAXIMIZED_BOTH=MAXIMIZED_VERT | MAXIMIZED_HORIZstatic final int
Constant MAXIMIZED_HORIZ=2static final int
Constant MAXIMIZED_VERT=4static final int
Constant NONE=0static final int
Constant PLAIN_DIALOG=2static final int
Constant QUESTION_DIALOG=7static final int
Constant WARNING_DIALOG=8 -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a LayoutManager that will be set on the JRootPane.createTitlePane
(JRootPane root) Returns the JComponent to render the window decoration style.static ComponentUI
Returns a MouseListener that will be added to the Window containing the JRootPane.getRootPane.Returns the BaseTitlePane rendering the title pane.void
installBorder
(JRootPane root) installBorder.void
installClientDecorations.void
installLayout
(JRootPane root) Installs the appropriate LayoutManager on the JRootPane to render the window decorations.protected void
installListeners
(JRootPane root) void
void
installWindowListeners
(JRootPane root, Component parent) Installs the necessary Listeners on the parent Window, if there is one.void
void
setTitlePane
(JRootPane root, JComponent titlePane) Sets the window title pane -- the JComponent used to provide a plaf a way to override the native operating system's window title pane with one whose look and feel are controlled by the plaf.void
uninstallBorder
(JRootPane root) Removes any border that may have been installed.void
uninstallClientDecorations.void
uninstallLayout
(JRootPane root) uninstallLayout.protected void
uninstallListeners
(JRootPane root) void
void
Uninstalls the necessary Listeners on the Window the Listeners were last installed on.Methods inherited from class javax.swing.plaf.basic.BasicRootPaneUI
installComponents, installDefaults, installKeyboardActions, uninstallComponents, uninstallDefaults, uninstallKeyboardActions
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint, update
-
Field Details
-
NONE
public static final int NONEConstant NONE=0- See Also:
-
FRAME
public static final int FRAMEConstant FRAME=1- See Also:
-
PLAIN_DIALOG
public static final int PLAIN_DIALOGConstant PLAIN_DIALOG=2- See Also:
-
INFORMATION_DIALOG
public static final int INFORMATION_DIALOGConstant INFORMATION_DIALOG=3- See Also:
-
ERROR_DIALOG
public static final int ERROR_DIALOGConstant ERROR_DIALOG=4- See Also:
-
COLOR_CHOOSER_DIALOG
public static final int COLOR_CHOOSER_DIALOGConstant COLOR_CHOOSER_DIALOG=5- See Also:
-
FILE_CHOOSER_DIALOG
public static final int FILE_CHOOSER_DIALOGConstant FILE_CHOOSER_DIALOG=6- See Also:
-
QUESTION_DIALOG
public static final int QUESTION_DIALOGConstant QUESTION_DIALOG=7- See Also:
-
WARNING_DIALOG
public static final int WARNING_DIALOGConstant WARNING_DIALOG=8- See Also:
-
MAXIMIZED_HORIZ
public static final int MAXIMIZED_HORIZConstant MAXIMIZED_HORIZ=2- See Also:
-
MAXIMIZED_VERT
public static final int MAXIMIZED_VERTConstant MAXIMIZED_VERT=4- See Also:
-
MAXIMIZED_BOTH
public static final int MAXIMIZED_BOTHConstant MAXIMIZED_BOTH=MAXIMIZED_VERT | MAXIMIZED_HORIZ- See Also:
-
-
Constructor Details
-
BaseRootPaneUI
public BaseRootPaneUI()
-
-
Method Details
-
createUI
Creates a UI for a JRootPane.
-
createLayoutManager
Returns a LayoutManager that will be set on the JRootPane.- Returns:
- The layout manager
-
createTitlePane
Returns the JComponent to render the window decoration style.- Parameters:
root
- The root pane- Returns:
- The title pane
-
createWindowMouseInputListener
Returns a MouseListener that will be added to the Window containing the JRootPane.- Parameters:
root
- The root pane- Returns:
- The mouse listener
-
getRootPane
getRootPane.
- Returns:
- a
JRootPane
object.
-
getTitlePane
Returns the BaseTitlePane rendering the title pane. If this returns null, it implies there is no need to render window decorations.- Returns:
- the current window title pane, or null
- See Also:
-
installBorder
installBorder.
- Parameters:
root
- aJRootPane
object.
-
installClientDecorations
installClientDecorations.
- Parameters:
root
- aJRootPane
object.
-
installLayout
Installs the appropriate LayoutManager on the JRootPane to render the window decorations.- Parameters:
root
- The root pane
-
installListeners
- Overrides:
installListeners
in classBasicRootPaneUI
-
installUI
- Overrides:
installUI
in classBasicRootPaneUI
-
installWindowListeners
Installs the necessary Listeners on the parent Window, if there is one.This takes the parent so that cleanup can be done from removeNotify, at which point the parent hasn't been reset yet.
- Parameters:
root
- The root paneparent
- The parent of the JRootPane
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classBasicRootPaneUI
-
setTitlePane
Sets the window title pane -- the JComponent used to provide a plaf a way to override the native operating system's window title pane with one whose look and feel are controlled by the plaf. The plaf creates and sets this value; the default is null, implying a native operating system window title pane.- Parameters:
root
- the JRootPane where to set the title panetitlePane
- the JComponent to use for the window title pane.
-
uninstallBorder
Removes any border that may have been installed.- Parameters:
root
- The root pane
-
uninstallClientDecorations
uninstallClientDecorations.
- Parameters:
root
- aJRootPane
object.
-
uninstallLayout
uninstallLayout.
- Parameters:
root
- aJRootPane
object.
-
uninstallListeners
- Overrides:
uninstallListeners
in classBasicRootPaneUI
-
uninstallUI
- Overrides:
uninstallUI
in classBasicRootPaneUI
-
uninstallWindowListeners
Uninstalls the necessary Listeners on the Window the Listeners were last installed on.- Parameters:
root
- The root pane
-