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 classSubstanceRootPaneUI.SubstanceRootLayoutA 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 GraphicsConfigurationcurrentRootPaneGCThe graphics configuration that contains the top-left corner of the window (fix for defect 213).protected JRootPanerootJRootPaneproviding the look and feel for.protected WindowsubstanceCurrentWindowThe current window.protected HierarchyListenersubstanceHierarchyListenerHierarchy listener to keep track of the associated top-level window.protected PropertyChangeListenersubstancePropertyChangeListenerprotected ComponentListenersubstanceWindowComponentListenerComponent listener to keep track of the primary graphics configuration (for recomputing the maximized bounds) - fix for defect 213.protected WindowListenersubstanceWindowListenerWindow listener that stops all Substance thread when the last frame is disposed.static ComponentListenerWINDOW_ROUNDER
-
Constructor Summary
Constructors Constructor Description SubstanceRootPaneUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LayoutManagercreateLayoutManager()Returns 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 JRootPanegetRootPane()Returns theJRootPanewe're providing the look and feel for.JComponentgetTitlePane()Returns theJComponentrendering the title pane.static booleanhasCustomSkinOnAtLeastOneRootPane()voidinstallBorder(JRootPane root)Installs the appropriateBorderonto theJRootPane.protected voidinstallDefaults(JRootPane c)protected voidinstallListeners(JRootPane root)voidinstallUI(JComponent c)Invokes supers implementation ofinstallUIto install the necessary state onto the passed inJRootPaneto render the metal look and feel implementation ofRootPaneUI.voidpropertyChange(PropertyChangeEvent e)voidsetMaximized()Sets maximized bounds according to the display screen insets.protected voiduninstallListeners(JRootPane root)voiduninstallUI(JComponent c)Invokes 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, uninstallKeyboardActions
-
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, paint
-
-
-
-
Field Detail
-
root
protected JRootPane root
JRootPaneproviding 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 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
public void uninstallUI(JComponent c)
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
public void installBorder(JRootPane root)
Installs the appropriateBorderonto theJRootPane.- Parameters:
root- Root pane.
-
installDefaults
protected void installDefaults(JRootPane c)
- Overrides:
installDefaultsin classBasicRootPaneUI
-
update
public void update(Graphics g, JComponent c)
- Overrides:
updatein classComponentUI
-
installListeners
protected void installListeners(JRootPane root)
- Overrides:
installListenersin classBasicRootPaneUI
-
uninstallListeners
protected void uninstallListeners(JRootPane root)
- Overrides:
uninstallListenersin classBasicRootPaneUI
-
createTitlePane
protected JComponent createTitlePane(JRootPane root)
Returns theJComponentto render the window decoration style.- Parameters:
root- Root pane.- Returns:
- The title pane component.
-
createLayoutManager
protected LayoutManager 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
public JComponent 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
protected JRootPane getRootPane()
Returns theJRootPanewe're providing the look and feel for.- Returns:
- The associated root pane.
-
propertyChange
public void propertyChange(PropertyChangeEvent e)
- Specified by:
propertyChangein interfacePropertyChangeListener- Overrides:
propertyChangein classBasicRootPaneUI
-
hasCustomSkinOnAtLeastOneRootPane
public static boolean hasCustomSkinOnAtLeastOneRootPane()
-
-