org.jvnet.substance
Class SubstanceRootPaneUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.RootPaneUI
          extended by javax.swing.plaf.basic.BasicRootPaneUI
              extended by org.jvnet.substance.SubstanceRootPaneUI
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener

public class SubstanceRootPaneUI
extends javax.swing.plaf.basic.BasicRootPaneUI

UI for root panes in Substance look and feel.

Author:
Kirill Grouchnikov, Larry Salibra (fix for defect 198)

Field Summary
protected  java.awt.GraphicsConfiguration currentRootPaneGC
          The graphics configuration that contains the top-left corner of the window (fix for defect 213).
protected static java.lang.reflect.Method getLocationOnScreenMethod
          Stores the pointer to MouseInfo#getLocationOnScreen() method (available only under JDK 6.0).
protected  java.awt.Window substanceCurrentWindow
          The current window.
protected  java.awt.event.HierarchyListener substanceHierarchyListener
          Hierarchy listener to keep track of the associated top-level window.
protected  java.awt.event.ComponentListener substanceWindowComponentListener
          Component listener to keep track of the primary graphics configuration (for recomputing the maximized bounds) - fix for defect 213.
protected  java.awt.event.WindowListener substanceWindowListener
          Window listener that stops all Substance thread when the last frame is disposed.
 
Constructor Summary
SubstanceRootPaneUI()
           
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Creates a UI for a JRootPane.
 javax.swing.JComponent getTitlePane()
          Returns the JComponent rendering the title pane.
 void installBorder(javax.swing.JRootPane root)
          Installs the appropriate Border onto the JRootPane.
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.
 void propertyChange(java.beans.PropertyChangeEvent e)
           
 void setHeapStatusPanePermanentVisibility(boolean isVisible)
          Makes the heap status panel appear / disappear permanently on the associated title pane and removes the corresponding check box menu items from the system menu.
 void setMaximized()
          Sets maximized bounds according to the display screen insets.
protected  void uninstallListeners(javax.swing.JRootPane root)
           
 void uninstallUI(javax.swing.JComponent c)
          Invokes supers implementation to uninstall any of its state.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

substanceWindowListener

protected java.awt.event.WindowListener substanceWindowListener
Window listener that stops all Substance thread when the last frame is disposed.


substanceCurrentWindow

protected java.awt.Window substanceCurrentWindow
The current window.


substanceHierarchyListener

protected java.awt.event.HierarchyListener substanceHierarchyListener
Hierarchy listener to keep track of the associated top-level window.


substanceWindowComponentListener

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


currentRootPaneGC

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


getLocationOnScreenMethod

protected static java.lang.reflect.Method getLocationOnScreenMethod
Stores the pointer to MouseInfo#getLocationOnScreen() method (available only under JDK 6.0). Is used to provide fix for defect 198.

Constructor Detail

SubstanceRootPaneUI

public SubstanceRootPaneUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.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(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 supers 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.

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

setMaximized

public void setMaximized()
Sets maximized bounds according to the display screen insets.


getTitlePane

public javax.swing.JComponent getTitlePane()
Returns the JComponent rendering the title pane. If this returns null, it implies there is no need to render window decorations. This method is for internal use only.

Returns:
Title pane.
See Also:
setTitlePane(javax.swing.JRootPane, javax.swing.JComponent)

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

setHeapStatusPanePermanentVisibility

public void setHeapStatusPanePermanentVisibility(boolean isVisible)
Makes the heap status panel appear / disappear permanently on the associated title pane and removes the corresponding check box menu items from the system menu.

Parameters:
isVisible - if true, the heap status panel will be permanently shown, if false, the heap status panel will be permanently hidden.