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
UI for root panes in Substance look and feel.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
A custom layout manager that is responsible for the layout of layeredPane, glassPane, menuBar and titlePane, if one has been installed. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected GraphicsConfiguration
The graphics configuration that contains the top-left corner of the window (fix for defect 213).protected JRootPane
JRootPane
providing the look and feel for.protected Window
The current window.protected HierarchyListener
Hierarchy listener to keep track of the associated top-level window.protected PropertyChangeListener
protected ComponentListener
Component listener to keep track of the primary graphics configuration (for recomputing the maximized bounds) - fix for defect 213.protected WindowListener
Window listener that stops all Substance thread when the last frame is disposed.static ComponentListener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LayoutManager
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
Returns theJRootPane
we're providing the look and feel for.Returns theJComponent
rendering the title pane.static boolean
void
installBorder
(JRootPane root) Installs the appropriateBorder
onto theJRootPane
.protected void
protected void
installListeners
(JRootPane root) void
Invokes supers implementation ofinstallUI
to install the necessary state onto the passed inJRootPane
to render the metal look and feel implementation ofRootPaneUI
.void
void
Sets maximized bounds according to the display screen insets.protected void
uninstallListeners
(JRootPane root) void
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 Details
-
root
JRootPane
providing the look and feel for. -
substanceWindowListener
Window listener that stops all Substance thread when the last frame is disposed. -
substanceCurrentWindow
The current window. -
substanceHierarchyListener
Hierarchy listener to keep track of the associated top-level window. -
substanceWindowComponentListener
Component listener to keep track of the primary graphics configuration (for recomputing the maximized bounds) - fix for defect 213. -
currentRootPaneGC
The graphics configuration that contains the top-left corner of the window (fix for defect 213). -
substancePropertyChangeListener
-
WINDOW_ROUNDER
-
-
Constructor Details
-
SubstanceRootPaneUI
public SubstanceRootPaneUI()
-
-
Method Details
-
createUI
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
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
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
Installs the appropriateBorder
onto theJRootPane
.- Parameters:
root
- Root pane.
-
installDefaults
- Overrides:
installDefaults
in classBasicRootPaneUI
-
update
- Overrides:
update
in classComponentUI
-
installListeners
- Overrides:
installListeners
in classBasicRootPaneUI
-
uninstallListeners
- Overrides:
uninstallListeners
in classBasicRootPaneUI
-
createTitlePane
Returns theJComponent
to render the window decoration style.- Parameters:
root
- Root pane.- Returns:
- The title pane component.
-
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
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:
-
getRootPane
Returns theJRootPane
we're providing the look and feel for.- Returns:
- The associated root pane.
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classBasicRootPaneUI
-
hasCustomSkinOnAtLeastOneRootPane
public static boolean hasCustomSkinOnAtLeastOneRootPane()
-