Class SubstanceRootPaneUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.RootPaneUI
-
- javax.swing.plaf.basic.BasicRootPaneUI
-
- org.pushingpixels.substance.internal.ui.SubstanceRootPaneUI
-
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
public class SubstanceRootPaneUI extends BasicRootPaneUI
UI for root panes in Substance look and feel.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
SubstanceRootPaneUI.SubstanceRootLayout
A custom layout manager that is responsible for the layout of layeredPane, glassPane, menuBar and titlePane, if one has been installed.
-
Field Summary
Fields Modifier and Type Field Description protected GraphicsConfiguration
currentRootPaneGC
The graphics configuration that contains the top-left corner of the window (fix for defect 213).protected JRootPane
root
JRootPane
providing the look and feel for.protected Window
substanceCurrentWindow
The current window.protected HierarchyListener
substanceHierarchyListener
Hierarchy listener to keep track of the associated top-level window.protected PropertyChangeListener
substancePropertyChangeListener
protected ComponentListener
substanceWindowComponentListener
Component listener to keep track of the primary graphics configuration (for recomputing the maximized bounds) - fix for defect 213.protected WindowListener
substanceWindowListener
Window listener that stops all Substance thread when the last frame is disposed.static ComponentListener
WINDOW_ROUNDER
-
Constructor Summary
Constructors Constructor Description SubstanceRootPaneUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LayoutManager
createLayoutManager()
Returns aLayoutManager
that will be set on theJRootPane
.protected JComponent
createTitlePane(JRootPane root)
Returns theJComponent
to render the window decoration style.static ComponentUI
createUI(JComponent comp)
Creates a UI for aJRootPane
.protected JRootPane
getRootPane()
Returns theJRootPane
we're providing the look and feel for.JComponent
getTitlePane()
Returns theJComponent
rendering the title pane.static boolean
hasCustomSkinOnAtLeastOneRootPane()
void
installBorder(JRootPane root)
Installs the appropriateBorder
onto theJRootPane
.protected void
installDefaults(JRootPane c)
protected void
installListeners(JRootPane root)
void
installUI(JComponent c)
Invokes supers implementation ofinstallUI
to install the necessary state onto the passed inJRootPane
to render the metal look and feel implementation ofRootPaneUI
.void
propertyChange(PropertyChangeEvent e)
void
setMaximized()
Sets maximized bounds according to the display screen insets.protected void
uninstallListeners(JRootPane root)
void
uninstallUI(JComponent c)
Invokes supers implementation to uninstall any of its state.void
update(Graphics g, JComponent c)
-
Methods inherited from class javax.swing.plaf.basic.BasicRootPaneUI
installComponents, installKeyboardActions, uninstallComponents, uninstallDefaults, uninstallKeyboardActions
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint
-
-
-
-
Field Detail
-
root
protected JRootPane root
JRootPane
providing the look and feel for.
-
substanceWindowListener
protected WindowListener substanceWindowListener
Window listener that stops all Substance thread when the last frame is disposed.
-
substanceCurrentWindow
protected Window substanceCurrentWindow
The current window.
-
substanceHierarchyListener
protected HierarchyListener substanceHierarchyListener
Hierarchy listener to keep track of the associated top-level window.
-
substanceWindowComponentListener
protected ComponentListener substanceWindowComponentListener
Component listener to keep track of the primary graphics configuration (for recomputing the maximized bounds) - fix for defect 213.
-
currentRootPaneGC
protected GraphicsConfiguration currentRootPaneGC
The graphics configuration that contains the top-left corner of the window (fix for defect 213).
-
substancePropertyChangeListener
protected PropertyChangeListener substancePropertyChangeListener
-
WINDOW_ROUNDER
public static ComponentListener WINDOW_ROUNDER
-
-
Method Detail
-
createUI
public static ComponentUI createUI(JComponent comp)
Creates a UI for aJRootPane
.- Parameters:
comp
- the JRootPane the RootPaneUI will be created for- Returns:
- the RootPaneUI implementation for the passed in JRootPane
-
installUI
public void installUI(JComponent c)
Invokes supers implementation ofinstallUI
to install the necessary state onto the passed inJRootPane
to render the metal look and feel implementation ofRootPaneUI
. If thewindowDecorationStyle
property of theJRootPane
is other thanJRootPane.NONE
, this will add a customComponent
to render the widgets toJRootPane
, as well as installing a customBorder
andLayoutManager
on theJRootPane
.- Overrides:
installUI
in classBasicRootPaneUI
- Parameters:
c
- the JRootPane to install state onto
-
uninstallUI
public void uninstallUI(JComponent c)
Invokes supers implementation to uninstall any of its state. This will also reset theLayoutManager
of theJRootPane
. If aComponent
has been added to theJRootPane
to render the window decoration style, this method will remove it. Similarly, this will revert the Border and LayoutManager of theJRootPane
to what it was beforeinstallUI
was invoked.- Overrides:
uninstallUI
in classBasicRootPaneUI
- Parameters:
c
- the JRootPane to uninstall state from
-
installBorder
public void installBorder(JRootPane root)
Installs the appropriateBorder
onto theJRootPane
.- Parameters:
root
- Root pane.
-
installDefaults
protected void installDefaults(JRootPane c)
- Overrides:
installDefaults
in classBasicRootPaneUI
-
update
public void update(Graphics g, JComponent c)
- Overrides:
update
in classComponentUI
-
installListeners
protected void installListeners(JRootPane root)
- Overrides:
installListeners
in classBasicRootPaneUI
-
uninstallListeners
protected void uninstallListeners(JRootPane root)
- Overrides:
uninstallListeners
in classBasicRootPaneUI
-
createTitlePane
protected JComponent createTitlePane(JRootPane root)
Returns theJComponent
to render the window decoration style.- Parameters:
root
- Root pane.- Returns:
- The title pane component.
-
createLayoutManager
protected LayoutManager createLayoutManager()
Returns aLayoutManager
that will be set on theJRootPane
.- Returns:
- Layout manager.
-
setMaximized
public void setMaximized()
Sets maximized bounds according to the display screen insets.
-
getTitlePane
public JComponent getTitlePane()
Returns theJComponent
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)
-
getRootPane
protected JRootPane getRootPane()
Returns theJRootPane
we're providing the look and feel for.- Returns:
- The associated root pane.
-
propertyChange
public void propertyChange(PropertyChangeEvent e)
- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classBasicRootPaneUI
-
hasCustomSkinOnAtLeastOneRootPane
public static boolean hasCustomSkinOnAtLeastOneRootPane()
-
-