com.jtattoo.plaf
Class BaseRootPaneUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.RootPaneUI
          extended by javax.swing.plaf.basic.BasicRootPaneUI
              extended by com.jtattoo.plaf.BaseRootPaneUI
All Implemented Interfaces:
PropertyChangeListener, EventListener
Direct Known Subclasses:
AcrylRootPaneUI, AeroRootPaneUI, AluminiumRootPaneUI, FastRootPaneUI, GraphiteRootPaneUI, HiFiRootPaneUI

public class BaseRootPaneUI
extends BasicRootPaneUI

This source is a modified copy of javax.swing.plaf.metal.MetalRootPaneUI Provides the base look and feel implementation of RootPaneUI.

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 JavaBeansTM has been added to the java.beans package. Please see XMLEncoder.

Since:
1.4
Version:
1.20 04/27/04
Author:
Terry Kellerman, Michael Hagen

Field Summary
static int COLOR_CHOOSER_DIALOG
           
static int ERROR_DIALOG
           
static int FILE_CHOOSER_DIALOG
           
static int FRAME
           
static int INFORMATION_DIALOG
           
static int MAXIMIZED_BOTH
           
static int MAXIMIZED_HORIZ
           
static int MAXIMIZED_VERT
           
static int NONE
           
static int PLAIN_DIALOG
           
static int QUESTION_DIALOG
           
static int WARNING_DIALOG
           
 
Constructor Summary
BaseRootPaneUI()
           
 
Method Summary
 LayoutManager createLayoutManager()
          Returns a LayoutManager that will be set on the JRootPane.
 BaseTitlePane createTitlePane(JRootPane root)
          Returns the JComponent to render the window decoration style.
static ComponentUI createUI(JComponent c)
          Creates a UI for a JRootPane.
 MouseInputListener createWindowMouseInputListener(JRootPane root)
          Returns a MouseListener that will be added to the Window containing the JRootPane.
 JRootPane getRootPane()
           
 BaseTitlePane getTitlePane()
          Returns the JComponent rendering the title pane.
 void installBorder(JRootPane root)
           
 void installClientDecorations(JRootPane root)
           
 void installLayout(JRootPane root)
          Installs the appropriate LayoutManager on the JRootPane to render the window decorations.
 void installUI(JComponent c)
           
 void installWindowListeners(JRootPane root, Component parent)
          Installs the necessary Listeners on the parent Window, if there is one.
 void propertyChange(PropertyChangeEvent e)
           
 void setTitlePane(JRootPane root, BaseTitlePane 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(JRootPane root)
           
 void uninstallLayout(JRootPane root)
           
 void uninstallUI(JComponent c)
           
 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, getBaseline, getBaselineResizeBehavior, 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

NONE

public static final int NONE
See Also:
Constant Field Values

FRAME

public static final int FRAME
See Also:
Constant Field Values

PLAIN_DIALOG

public static final int PLAIN_DIALOG
See Also:
Constant Field Values

INFORMATION_DIALOG

public static final int INFORMATION_DIALOG
See Also:
Constant Field Values

ERROR_DIALOG

public static final int ERROR_DIALOG
See Also:
Constant Field Values

COLOR_CHOOSER_DIALOG

public static final int COLOR_CHOOSER_DIALOG
See Also:
Constant Field Values

FILE_CHOOSER_DIALOG

public static final int FILE_CHOOSER_DIALOG
See Also:
Constant Field Values

QUESTION_DIALOG

public static final int QUESTION_DIALOG
See Also:
Constant Field Values

WARNING_DIALOG

public static final int WARNING_DIALOG
See Also:
Constant Field Values

MAXIMIZED_HORIZ

public static final int MAXIMIZED_HORIZ
See Also:
Constant Field Values

MAXIMIZED_VERT

public static final int MAXIMIZED_VERT
See Also:
Constant Field Values

MAXIMIZED_BOTH

public static final int MAXIMIZED_BOTH
See Also:
Constant Field Values
Constructor Detail

BaseRootPaneUI

public BaseRootPaneUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent c)
Creates a UI for a JRootPane.

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)
Overrides:
installUI in class BasicRootPaneUI

uninstallUI

public void uninstallUI(JComponent c)
Overrides:
uninstallUI in class BasicRootPaneUI

installBorder

public void installBorder(JRootPane root)

uninstallBorder

public void uninstallBorder(JRootPane root)
Removes any border that may have been installed.


installWindowListeners

public void installWindowListeners(JRootPane root,
                                   Component parent)
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:
parent - The parent of the JRootPane

uninstallWindowListeners

public void uninstallWindowListeners(JRootPane root)
Uninstalls the necessary Listeners on the Window the Listeners were last installed on.


installLayout

public void installLayout(JRootPane root)
Installs the appropriate LayoutManager on the JRootPane to render the window decorations.


uninstallLayout

public void uninstallLayout(JRootPane root)

installClientDecorations

public void installClientDecorations(JRootPane root)

uninstallClientDecorations

public void uninstallClientDecorations(JRootPane root)

createTitlePane

public BaseTitlePane createTitlePane(JRootPane root)
Returns the JComponent to render the window decoration style.


createWindowMouseInputListener

public MouseInputListener createWindowMouseInputListener(JRootPane root)
Returns a MouseListener that will be added to the Window containing the JRootPane.


createLayoutManager

public LayoutManager createLayoutManager()
Returns a LayoutManager that will be set on the JRootPane.


setTitlePane

public void setTitlePane(JRootPane root,
                         BaseTitlePane 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. The plaf creates and sets this value; the default is null, implying a native operating system window title pane.

Parameters:
content - the JComponent to use for the window title pane.

getTitlePane

public BaseTitlePane getTitlePane()
Returns the JComponent 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:
setTitlePane(javax.swing.JRootPane, com.jtattoo.plaf.BaseTitlePane)

getRootPane

public JRootPane getRootPane()

propertyChange

public void propertyChange(PropertyChangeEvent e)
Specified by:
propertyChange in interface PropertyChangeListener
Overrides:
propertyChange in class BasicRootPaneUI


Copyright © 2011. All Rights Reserved.