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 classA 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 GraphicsConfigurationThe graphics configuration that contains the top-left corner of the window (fix for defect 213).protected JRootPaneJRootPaneproviding the look and feel for.protected WindowThe current window.protected HierarchyListenerHierarchy listener to keep track of the associated top-level window.protected PropertyChangeListenerprotected ComponentListenerComponent listener to keep track of the primary graphics configuration (for recomputing the maximized bounds) - fix for defect 213.protected WindowListenerWindow listener that stops all Substance thread when the last frame is disposed.static ComponentListener -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected LayoutManagerReturns aLayoutManagerthat will be set on theJRootPane.protected JComponentcreateTitlePane(JRootPane root) Returns theJComponentto render the window decoration style.static ComponentUIcreateUI(JComponent comp) Creates a UI for aJRootPane.protected JRootPaneReturns theJRootPanewe're providing the look and feel for.Returns theJComponentrendering the title pane.static booleanvoidinstallBorder(JRootPane root) Installs the appropriateBorderonto theJRootPane.protected voidprotected voidinstallListeners(JRootPane root) voidInvokes supers implementation ofinstallUIto install the necessary state onto the passed inJRootPaneto render the metal look and feel implementation ofRootPaneUI.voidvoidSets maximized bounds according to the display screen insets.protected voiduninstallListeners(JRootPane root) voidInvokes supers implementation to uninstall any of its state.voidupdate(Graphics g, JComponent c) Methods inherited from class javax.swing.plaf.basic.BasicRootPaneUI
installComponents, installKeyboardActions, uninstallComponents, uninstallDefaults, uninstallKeyboardActionsMethods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint
-
Field Details
-
root
JRootPaneproviding 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 ofinstallUIto install the necessary state onto the passed inJRootPaneto render the metal look and feel implementation ofRootPaneUI. If thewindowDecorationStyleproperty of theJRootPaneis other thanJRootPane.NONE, this will add a customComponentto render the widgets toJRootPane, as well as installing a customBorderandLayoutManageron theJRootPane.- Overrides:
installUIin classBasicRootPaneUI- Parameters:
c- the JRootPane to install state onto
-
uninstallUI
Invokes supers implementation to uninstall any of its state. This will also reset theLayoutManagerof theJRootPane. If aComponenthas been added to theJRootPaneto render the window decoration style, this method will remove it. Similarly, this will revert the Border and LayoutManager of theJRootPaneto what it was beforeinstallUIwas invoked.- Overrides:
uninstallUIin classBasicRootPaneUI- Parameters:
c- the JRootPane to uninstall state from
-
installBorder
Installs the appropriateBorderonto theJRootPane.- Parameters:
root- Root pane.
-
installDefaults
- Overrides:
installDefaultsin classBasicRootPaneUI
-
update
- Overrides:
updatein classComponentUI
-
installListeners
- Overrides:
installListenersin classBasicRootPaneUI
-
uninstallListeners
- Overrides:
uninstallListenersin classBasicRootPaneUI
-
createTitlePane
Returns theJComponentto render the window decoration style.- Parameters:
root- Root pane.- Returns:
- The title pane component.
-
createLayoutManager
Returns aLayoutManagerthat will be set on theJRootPane.- Returns:
- Layout manager.
-
setMaximized
public void setMaximized()Sets maximized bounds according to the display screen insets. -
getTitlePane
Returns theJComponentrendering 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
Returns theJRootPanewe're providing the look and feel for.- Returns:
- The associated root pane.
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classBasicRootPaneUI
-
hasCustomSkinOnAtLeastOneRootPane
public static boolean hasCustomSkinOnAtLeastOneRootPane()
-