Class RadianceRootPaneUI

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener
    Direct Known Subclasses:
    RadianceRibbonRootPaneUI

    public class RadianceRootPaneUI
    extends javax.swing.plaf.basic.BasicRootPaneUI
    UI for root panes in Radiance look and feel.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected RadianceRootPaneUI()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.awt.LayoutManager createLayoutManager()
      Returns a LayoutManager that will be set on the JRootPane.
      protected RadianceTitlePane createTitlePane​(javax.swing.JRootPane root)
      Returns the JComponent to render the window decoration style.
      javax.swing.JButton createTitlePaneControlButton()  
      static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent comp)
      Creates a UI for a JRootPane.
      private javax.swing.event.MouseInputListener createWindowMouseInputListener()
      Returns a MouseListener that will be added to the Window containing the JRootPane.
      void extendContentIntoTitlePane()  
      protected javax.swing.JRootPane getRootPane()
      Returns the JRootPane we're providing the look and feel for.
      javax.swing.JComponent getTitlePane()
      Returns the JComponent rendering the title pane.
      java.awt.Insets getTitlePaneControlInsets()  
      static boolean hasCustomSkinOnAtLeastOneRootPane()  
      void installBorder​(javax.swing.JRootPane root)
      Installs the appropriate Border onto the JRootPane.
      private void installClientDecorations​(javax.swing.JRootPane root)
      Installs the necessary state onto the JRootPane to render client decorations.
      protected void installComponents​(javax.swing.JRootPane root)  
      protected void installDefaults​(javax.swing.JRootPane c)  
      private void installLayout​(javax.swing.JRootPane root)
      Installs the appropriate LayoutManager on the JRootPane to render the window decorations.
      protected void installListeners​(javax.swing.JRootPane root)  
      void installUI​(javax.swing.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​(javax.swing.JRootPane root, java.awt.Component parent)
      Installs the necessary Listeners on the parent Window, if there is one.
      private boolean isMouseEventInExtendedTitlePane​(java.awt.event.MouseEvent ev)  
      private void propagateModificationState()  
      void propertyChange​(java.beans.PropertyChangeEvent e)  
      void setPreferredTitlePaneHeight​(int preferredTitlePaneHeight)  
      private void setTitlePane​(javax.swing.JRootPane root, RadianceTitlePane 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​(javax.swing.JRootPane root)
      Removes any border that may have been installed.
      private void uninstallClientDecorations​(javax.swing.JRootPane root)
      Uninstalls any state that installClientDecorations has installed.
      protected void uninstallComponents​(javax.swing.JRootPane root)  
      protected void uninstallDefaults​(javax.swing.JRootPane root)  
      private void uninstallLayout​(javax.swing.JRootPane root)
      Uninstalls the previously installed LayoutManager.
      protected void uninstallListeners​(javax.swing.JRootPane root)  
      void uninstallUI​(javax.swing.JComponent c)
      Invokes super implementation to uninstall any of its state.
      private void uninstallWindowListeners()
      Uninstalls the necessary Listeners on the Window the Listeners were last installed on.
      void update​(java.awt.Graphics g, javax.swing.JComponent c)  
      • Methods inherited from class javax.swing.plaf.basic.BasicRootPaneUI

        installKeyboardActions, uninstallKeyboardActions
      • Methods inherited from class javax.swing.plaf.ComponentUI

        contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CORNER_DRAG_WIDTH

        private static final int CORNER_DRAG_WIDTH
        The amount of space (in pixels) that the cursor is changed on.
        See Also:
        Constant Field Values
      • BORDER_DRAG_THICKNESS

        private static final int BORDER_DRAG_THICKNESS
        Region from edges that dragging is active from.
        See Also:
        Constant Field Values
      • window

        private java.awt.Window window
        Window the JRootPane is in.
      • titlePane

        private RadianceTitlePane titlePane
        JComponent providing window decorations. This will be null if not providing window decorations.
      • isContentExtendingIntoTitlePane

        private boolean isContentExtendingIntoTitlePane
      • radianceMouseInputListener

        private javax.swing.event.MouseInputListener radianceMouseInputListener
        MouseInputListener that is added to the parent Window the JRootPane is contained in.
      • radianceTitleMouseInputListener

        private javax.swing.event.MouseInputListener radianceTitleMouseInputListener
        Mouse listener on the title pane (dragging).
      • layoutManager

        private java.awt.LayoutManager layoutManager
        The LayoutManager that is set on the JRootPane.
      • savedOldLayout

        private java.awt.LayoutManager savedOldLayout
        LayoutManager of the JRootPane before we replaced it.
      • root

        private javax.swing.JRootPane root
        JRootPane providing the look and feel for.
      • radianceWindowListener

        private java.awt.event.WindowListener radianceWindowListener
        Window listener that stops all Radiance threads when the last frame is disposed.
      • radianceCurrentWindow

        private java.awt.Window radianceCurrentWindow
        The current window.
      • radianceHierarchyListener

        private java.awt.event.HierarchyListener radianceHierarchyListener
        Hierarchy listener to keep track of the associated top-level window.
      • radianceWindowComponentListener

        private java.awt.event.ComponentListener radianceWindowComponentListener
        Component listener to keep track of the primary graphics configuration (for recomputing the maximized bounds) - fix for defect 213.
      • currentRootPaneGC

        private java.awt.GraphicsConfiguration currentRootPaneGC
        The graphics configuration that contains the top-left corner of the window (fix for defect 213).
      • radiancePropertyChangeListener

        private java.beans.PropertyChangeListener radiancePropertyChangeListener
      • lastCursor

        private java.awt.Cursor lastCursor
        Cursor used to track the cursor set by the user. This is initially Cursor.DEFAULT_CURSOR.
      • cursorMapping

        private static final int[] cursorMapping
        Maps from positions to cursor type. Refer to calculateCorner and calculatePosition for details of this.
    • Constructor Detail

      • RadianceRootPaneUI

        protected RadianceRootPaneUI()
    • Method Detail

      • createUI

        public static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent comp)
        Creates a UI for a JRootPane.
        Parameters:
        comp - the JRootPane the RootPaneUI will be created for
        Returns:
        the RootPaneUI implementation for the passed in JRootPane
      • installUI

        public void installUI​(javax.swing.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. 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.
        Overrides:
        installUI in class javax.swing.plaf.basic.BasicRootPaneUI
        Parameters:
        c - the JRootPane to install state onto
      • uninstallUI

        public void uninstallUI​(javax.swing.JComponent c)
        Invokes super implementation to uninstall any of its state. This will also reset the 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.
        Overrides:
        uninstallUI in class javax.swing.plaf.basic.BasicRootPaneUI
        Parameters:
        c - the JRootPane to uninstall state from
      • installBorder

        public void installBorder​(javax.swing.JRootPane root)
        Installs the appropriate Border onto the JRootPane.
        Parameters:
        root - Root pane.
      • uninstallBorder

        private void uninstallBorder​(javax.swing.JRootPane root)
        Removes any border that may have been installed.
        Parameters:
        root - Root pane.
      • installDefaults

        protected void installDefaults​(javax.swing.JRootPane c)
        Overrides:
        installDefaults in class javax.swing.plaf.basic.BasicRootPaneUI
      • uninstallDefaults

        protected void uninstallDefaults​(javax.swing.JRootPane root)
        Overrides:
        uninstallDefaults in class javax.swing.plaf.basic.BasicRootPaneUI
      • update

        public void update​(java.awt.Graphics g,
                           javax.swing.JComponent c)
        Overrides:
        update in class javax.swing.plaf.ComponentUI
      • installWindowListeners

        private void installWindowListeners​(javax.swing.JRootPane root,
                                            java.awt.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 - Root pane.
        parent - The parent of the JRootPane
      • uninstallWindowListeners

        private void uninstallWindowListeners()
        Uninstalls the necessary Listeners on the Window the Listeners were last installed on.
        Parameters:
        root - Root pane.
      • installLayout

        private void installLayout​(javax.swing.JRootPane root)
        Installs the appropriate LayoutManager on the JRootPane to render the window decorations.
        Parameters:
        root - Root pane.
      • installListeners

        protected void installListeners​(javax.swing.JRootPane root)
        Overrides:
        installListeners in class javax.swing.plaf.basic.BasicRootPaneUI
      • uninstallListeners

        protected void uninstallListeners​(javax.swing.JRootPane root)
        Overrides:
        uninstallListeners in class javax.swing.plaf.basic.BasicRootPaneUI
      • installComponents

        protected void installComponents​(javax.swing.JRootPane root)
        Overrides:
        installComponents in class javax.swing.plaf.basic.BasicRootPaneUI
      • uninstallComponents

        protected void uninstallComponents​(javax.swing.JRootPane root)
        Overrides:
        uninstallComponents in class javax.swing.plaf.basic.BasicRootPaneUI
      • uninstallLayout

        private void uninstallLayout​(javax.swing.JRootPane root)
        Uninstalls the previously installed LayoutManager.
        Parameters:
        root - Root pane.
      • installClientDecorations

        private void installClientDecorations​(javax.swing.JRootPane root)
        Installs the necessary state onto the JRootPane to render client decorations. This is ONLY invoked if the JRootPane has a decoration style other than JRootPane.NONE.
        Parameters:
        root - Root pane.
      • uninstallClientDecorations

        private void uninstallClientDecorations​(javax.swing.JRootPane root)
        Uninstalls any state that installClientDecorations has installed.

        NOTE: This may be called if you haven't installed client decorations yet (ie before installClientDecorations has been invoked).

        Parameters:
        root - Root pane.
      • createTitlePane

        protected RadianceTitlePane createTitlePane​(javax.swing.JRootPane root)
        Returns the JComponent to render the window decoration style.
        Parameters:
        root - Root pane.
        Returns:
        The title pane component.
      • createWindowMouseInputListener

        private javax.swing.event.MouseInputListener createWindowMouseInputListener()
        Returns a MouseListener that will be added to the Window containing the JRootPane.
        Returns:
        Window mouse listener.
      • createLayoutManager

        protected java.awt.LayoutManager createLayoutManager()
        Returns a LayoutManager that will be set on the JRootPane.
        Returns:
        Layout manager.
      • setTitlePane

        private void setTitlePane​(javax.swing.JRootPane root,
                                  RadianceTitlePane 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 - Root pane
        titlePane - The JComponent to use for the window title pane.
      • createTitlePaneControlButton

        public javax.swing.JButton createTitlePaneControlButton()
      • getTitlePaneControlInsets

        public java.awt.Insets getTitlePaneControlInsets()
      • extendContentIntoTitlePane

        public void extendContentIntoTitlePane()
      • setPreferredTitlePaneHeight

        public void setPreferredTitlePaneHeight​(int preferredTitlePaneHeight)
      • getRootPane

        protected javax.swing.JRootPane getRootPane()
        Returns the JRootPane we're providing the look and feel for.
        Returns:
        The associated root pane.
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent e)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
        Overrides:
        propertyChange in class javax.swing.plaf.basic.BasicRootPaneUI
      • propagateModificationState

        private void propagateModificationState()
      • hasCustomSkinOnAtLeastOneRootPane

        public static boolean hasCustomSkinOnAtLeastOneRootPane()
      • isMouseEventInExtendedTitlePane

        private boolean isMouseEventInExtendedTitlePane​(java.awt.event.MouseEvent ev)