|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.RootPaneUI
javax.swing.plaf.basic.BasicRootPaneUI
javax.swing.plaf.metal.MetalRootPaneUI
Provides the metal look and feel implementation of RootPaneUI.
MetalRootPaneUI provides support for the
windowDecorationStyle property of JRootPane.
MetalRootPaneUI 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 JavaBeansTM
has been added to the java.beans package.
Please see XMLEncoder.
| Nested Class Summary | |
private static class |
MetalRootPaneUI.MetalRootLayout
A custom layout manager that is responsible for the layout of layeredPane, glassPane, menuBar and titlePane, if one has been installed. |
private class |
MetalRootPaneUI.MouseInputHandler
MouseInputHandler is responsible for handling resize/moving of the Window. |
| Nested classes inherited from class javax.swing.plaf.basic.BasicRootPaneUI |
|
| Field Summary | |
private static int |
BORDER_DRAG_THICKNESS
Region from edges that dragging is active from. |
private static String[] |
borderKeys
Keys to lookup borders in defaults table. |
private static int |
CORNER_DRAG_WIDTH
The amount of space (in pixels) that the cursor is changed on. |
private static int[] |
cursorMapping
Maps from positions to cursor type. |
private Cursor |
lastCursor
Cursor used to track the cursor set by the user.
|
private LayoutManager |
layoutManager
The LayoutManager that is set on the
JRootPane. |
private MouseInputListener |
mouseInputListener
MouseInputListener that is added to the parent
Window the JRootPane is contained in. |
private JRootPane |
root
JRootPane providing the look and feel for. |
private LayoutManager |
savedOldLayout
LayoutManager of the JRootPane before we
replaced it. |
private JComponent |
titlePane
JComponent providing window decorations. |
private Window |
window
Window the JRootPane is in. |
| Fields inherited from class javax.swing.plaf.basic.BasicRootPaneUI |
|
| Constructor Summary | |
MetalRootPaneUI()
|
|
| Method Summary | |
private LayoutManager |
createLayoutManager()
Returns a LayoutManager that will be set on the
JRootPane. |
private JComponent |
createTitlePane(JRootPane root)
Returns the JComponent to render the window decoration
style. |
static ComponentUI |
createUI(JComponent c)
Creates a UI for a JRootPane. |
private MouseInputListener |
createWindowMouseInputListener(JRootPane root)
Returns a MouseListener that will be added to the
Window containing the JRootPane. |
private JRootPane |
getRootPane()
Returns the JRootPane we're providing the look and
feel for. |
private JComponent |
getTitlePane()
Returns the JComponent rendering the title pane. |
(package private) void |
installBorder(JRootPane root)
Installs the appropriate Border onto the
JRootPane. |
private void |
installClientDecorations(JRootPane root)
Installs the necessary state onto the JRootPane to render client decorations. |
private void |
installLayout(JRootPane root)
Installs the appropriate LayoutManager on the JRootPane
to render the window decorations. |
void |
installUI(JComponent c)
Invokes supers implementation of installUI to install
the necessary state onto the passed in JRootPane
to render the metal look and feel implementation of
RootPaneUI. |
private void |
installWindowListeners(JRootPane root,
Component parent)
Installs the necessary Listeners on the parent Window,
if there is one.
|
void |
propertyChange(java.beans.PropertyChangeEvent e)
Invoked when a property changes. |
private 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. |
private void |
uninstallBorder(JRootPane root)
Removes any border that may have been installed. |
private void |
uninstallClientDecorations(JRootPane root)
Uninstalls any state that installClientDecorations has
installed.
|
private void |
uninstallLayout(JRootPane root)
Uninstalls the previously installed LayoutManager. |
void |
uninstallUI(JComponent c)
Invokes supers implementation to uninstall any of its state. |
private void |
uninstallWindowListeners(JRootPane root)
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, installListeners, uninstallComponents, uninstallDefaults, uninstallKeyboardActions, uninstallListeners |
| Methods inherited from class javax.swing.plaf.ComponentUI |
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, getPreferredSize, paint, update |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private static final String[] borderKeys
private static final int CORNER_DRAG_WIDTH
private static final int BORDER_DRAG_THICKNESS
private Window window
JRootPane is in.
private JComponent titlePane
JComponent providing window decorations. This will be
null if not providing window decorations.
private MouseInputListener mouseInputListener
MouseInputListener that is added to the parent
Window the JRootPane is contained in.
private LayoutManager layoutManager
LayoutManager that is set on the
JRootPane.
private LayoutManager savedOldLayout
LayoutManager of the JRootPane before we
replaced it.
private JRootPane root
JRootPane providing the look and feel for.
private Cursor lastCursor
Cursor used to track the cursor set by the user.
This is initially Cursor.DEFAULT_CURSOR.
private static final int[] cursorMapping
| Constructor Detail |
public MetalRootPaneUI()
| Method Detail |
public static ComponentUI createUI(JComponent c)
JRootPane.
c - the JRootPane the RootPaneUI will be created for
public void installUI(JComponent c)
installUI to install
the necessary state onto the passed in JRootPane
to render the metal look and feel implementation of
RootPaneUI. If
the windowDecorationStyle property of the
JRootPane is other than JRootPane.NONE,
this will add a custom Component to render the widgets to
JRootPane, as well as installing a custom
Border and LayoutManager on the
JRootPane.
installUI in class BasicRootPaneUIc - the JRootPane to install state ontopublic void uninstallUI(JComponent c)
LayoutManager of the JRootPane.
If a Component has been added to the JRootPane
to render the window decoration style, this method will remove it.
Similarly, this will revert the Border and LayoutManager of the
JRootPane to what it was before installUI
was invoked.
uninstallUI in class BasicRootPaneUIc - the JRootPane to uninstall state fromvoid installBorder(JRootPane root)
Border onto the
JRootPane.
private void uninstallBorder(JRootPane root)
private void installWindowListeners(JRootPane root,
Component 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.
parent - The parent of the JRootPaneprivate void uninstallWindowListeners(JRootPane root)
Window the
Listeners were last installed on.
private void installLayout(JRootPane root)
JRootPane
to render the window decorations.
private void uninstallLayout(JRootPane root)
LayoutManager.
private void installClientDecorations(JRootPane root)
JRootPane
has a decoration style other than JRootPane.NONE.
private void uninstallClientDecorations(JRootPane root)
installClientDecorations has
installed.
NOTE: This may be called if you haven't installed client decorations
yet (ie before installClientDecorations has been invoked).
private JComponent createTitlePane(JRootPane root)
JComponent to render the window decoration
style.
private MouseInputListener createWindowMouseInputListener(JRootPane root)
MouseListener that will be added to the
Window containing the JRootPane.
private LayoutManager createLayoutManager()
LayoutManager that will be set on the
JRootPane.
private void setTitlePane(JRootPane root,
JComponent titlePane)
private JComponent getTitlePane()
JComponent rendering the title pane. If this
returns null, it implies there is no need to render window decorations.
setTitlePane(javax.swing.JRootPane, javax.swing.JComponent)private JRootPane getRootPane()
JRootPane we're providing the look and
feel for.
public void propertyChange(java.beans.PropertyChangeEvent e)
MetalRootPaneUI is
primarily interested in events originating from the
JRootPane it has been installed on identifying the
property windowDecorationStyle. If the
windowDecorationStyle has changed to a value other
than JRootPane.NONE, this will add a Component
to the JRootPane to render the window decorations, as well
as installing a Border on the JRootPane.
On the other hand, if the windowDecorationStyle has
changed to JRootPane.NONE, this will remove the
Component that has been added to the JRootPane
as well resetting the Border to what it was before
installUI was invoked.
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class BasicRootPaneUIe - A PropertyChangeEvent object describing the event source
and the property that has changed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||