Class BaseRootPaneUI

All Implemented Interfaces:
PropertyChangeListener, EventListener
Direct Known Subclasses:
AcrylRootPaneUI, AeroRootPaneUI, AluminiumRootPaneUI, BernsteinRootPaneUI, FastRootPaneUI, GraphiteRootPaneUI, HiFiRootPaneUI, LunaRootPaneUI, McWinRootPaneUI, MintRootPaneUI, SmartRootPaneUI, TextureRootPaneUI

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 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 Details

    • NONE

      public static final int NONE
      Constant NONE=0
      See Also:
    • FRAME

      public static final int FRAME
      Constant FRAME=1
      See Also:
    • PLAIN_DIALOG

      public static final int PLAIN_DIALOG
      Constant PLAIN_DIALOG=2
      See Also:
    • INFORMATION_DIALOG

      public static final int INFORMATION_DIALOG
      Constant INFORMATION_DIALOG=3
      See Also:
    • ERROR_DIALOG

      public static final int ERROR_DIALOG
      Constant ERROR_DIALOG=4
      See Also:
    • COLOR_CHOOSER_DIALOG

      public static final int COLOR_CHOOSER_DIALOG
      Constant COLOR_CHOOSER_DIALOG=5
      See Also:
    • FILE_CHOOSER_DIALOG

      public static final int FILE_CHOOSER_DIALOG
      Constant FILE_CHOOSER_DIALOG=6
      See Also:
    • QUESTION_DIALOG

      public static final int QUESTION_DIALOG
      Constant QUESTION_DIALOG=7
      See Also:
    • WARNING_DIALOG

      public static final int WARNING_DIALOG
      Constant WARNING_DIALOG=8
      See Also:
    • MAXIMIZED_HORIZ

      public static final int MAXIMIZED_HORIZ
      Constant MAXIMIZED_HORIZ=2
      See Also:
    • MAXIMIZED_VERT

      public static final int MAXIMIZED_VERT
      Constant MAXIMIZED_VERT=4
      See Also:
    • MAXIMIZED_BOTH

      public static final int MAXIMIZED_BOTH
      Constant MAXIMIZED_BOTH=MAXIMIZED_VERT | MAXIMIZED_HORIZ
      See Also:
  • Constructor Details

    • BaseRootPaneUI

      public BaseRootPaneUI()
  • Method Details

    • createUI

      public static ComponentUI createUI(JComponent c)

      Creates a UI for a JRootPane.

    • createLayoutManager

      public LayoutManager createLayoutManager()
      Returns a LayoutManager that will be set on the JRootPane.
      Returns:
      The layout manager
    • createTitlePane

      public JComponent createTitlePane(JRootPane root)
      Returns the JComponent to render the window decoration style.
      Parameters:
      root - The root pane
      Returns:
      The title pane
    • createWindowMouseInputListener

      public MouseInputListener createWindowMouseInputListener(JRootPane root)
      Returns a MouseListener that will be added to the Window containing the JRootPane.
      Parameters:
      root - The root pane
      Returns:
      The mouse listener
    • getRootPane

      public JRootPane getRootPane()

      getRootPane.

      Returns:
      a JRootPane object.
    • getTitlePane

      public BaseTitlePane 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

      public void installBorder(JRootPane root)

      installBorder.

      Parameters:
      root - a JRootPane object.
    • installClientDecorations

      public void installClientDecorations(JRootPane root)

      installClientDecorations.

      Parameters:
      root - a JRootPane object.
    • installLayout

      public void installLayout(JRootPane root)
      Installs the appropriate LayoutManager on the JRootPane to render the window decorations.
      Parameters:
      root - The root pane
    • installListeners

      protected void installListeners(JRootPane root)
      Overrides:
      installListeners in class BasicRootPaneUI
    • installUI

      public void installUI(JComponent c)
      Overrides:
      installUI in class BasicRootPaneUI
    • 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:
      root - The root pane
      parent - The parent of the JRootPane
    • propertyChange

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

      public 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. 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 pane
      titlePane - the JComponent to use for the window title pane.
    • uninstallBorder

      public void uninstallBorder(JRootPane root)
      Removes any border that may have been installed.
      Parameters:
      root - The root pane
    • uninstallClientDecorations

      public void uninstallClientDecorations(JRootPane root)

      uninstallClientDecorations.

      Parameters:
      root - a JRootPane object.
    • uninstallLayout

      public void uninstallLayout(JRootPane root)

      uninstallLayout.

      Parameters:
      root - a JRootPane object.
    • uninstallListeners

      protected void uninstallListeners(JRootPane root)
      Overrides:
      uninstallListeners in class BasicRootPaneUI
    • uninstallUI

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

      public void uninstallWindowListeners(JRootPane root)
      Uninstalls the necessary Listeners on the Window the Listeners were last installed on.
      Parameters:
      root - The root pane