Package com.formdev.flatlaf.ui
Class FlatRootPaneUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.RootPaneUI
-
- javax.swing.plaf.basic.BasicRootPaneUI
-
- com.formdev.flatlaf.ui.FlatRootPaneUI
-
- All Implemented Interfaces:
java.beans.PropertyChangeListener,java.util.EventListener
public class FlatRootPaneUI extends javax.swing.plaf.basic.BasicRootPaneUIProvides the Flat LaF UI delegate forJRootPane.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classFlatRootPaneUI.FlatRootLayoutstatic classFlatRootPaneUI.FlatWindowBorderWindow border used for non-native window decorations.private static classFlatRootPaneUI.FlatWindowTitleBorder
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.ColorborderColorprivate java.awt.event.ComponentListenermacFullWindowContentListenerprivate java.beans.PropertyChangeListenermacWindowBackgroundListenerprivate java.lang.ObjectnativeWindowBorderDataprivate java.awt.LayoutManageroldLayoutprotected javax.swing.JRootPanerootPaneprotected static java.lang.IntegerTITLE_PANE_FULL_WINDOW_CONTENT_LAYERprotected static java.lang.IntegerTITLE_PANE_LAYERprivate static java.lang.IntegerTITLE_PANE_MOUSE_LAYERprotected FlatTitlePanetitlePaneprivate static java.lang.IntegerWINDOW_TOP_BORDER_LAYERprotected FlatWindowResizerwindowResizer
-
Constructor Summary
Constructors Constructor Description FlatRootPaneUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FlatRootPaneUI.FlatRootLayoutcreateRootLayout()protected FlatTitlePanecreateTitlePane()static javax.swing.plaf.ComponentUIcreateUI(javax.swing.JComponent c)protected FlatWindowResizercreateWindowResizer()private java.lang.IntegergetLayerForTitlePane()private java.awt.WindowgetParentWindow(javax.swing.JRootPane c)protected static FlatTitlePanegetTitlePane(javax.swing.JRootPane rootPane)protected voidinstallBorder()protected voidinstallClientDecorations()protected voidinstallDefaults(javax.swing.JRootPane c)protected voidinstallListeners(javax.swing.JRootPane root)protected voidinstallNativeWindowBorder()voidinstallUI(javax.swing.JComponent c)protected static booleanisFullWindowContent(javax.swing.JRootPane rootPane)private booleanisMacButtonsSpacingSupported()protected static booleanisMenuBarEmbedded(javax.swing.JRootPane rootPane)private voidmacClearBackgroundForTranslucentWindow(javax.swing.JRootPane c)When setting window background to translucent color (alpha < 255), Swing paints that window translucent on Windows and Linux, but not on macOS.private voidmacInstallFullWindowContentSupport()private voidmacInstallWindowBackgroundListener(javax.swing.JRootPane c)private voidmacUninstallFullWindowContentSupport()private voidmacUninstallWindowBackgroundListener(javax.swing.JRootPane c)voidpropertyChange(java.beans.PropertyChangeEvent e)protected voidsetTitlePane(FlatTitlePane newTitlePane)protected voiduninstallClientDecorations()protected voiduninstallDefaults(javax.swing.JRootPane c)protected voiduninstallListeners(javax.swing.JRootPane root)protected voiduninstallNativeWindowBorder()voiduninstallUI(javax.swing.JComponent c)static voidupdateNativeWindowBorder(javax.swing.JRootPane rootPane)-
Methods inherited from class javax.swing.plaf.basic.BasicRootPaneUI
installComponents, installKeyboardActions, uninstallComponents, uninstallKeyboardActions
-
-
-
-
Field Detail
-
borderColor
protected final java.awt.Color borderColor
-
rootPane
protected javax.swing.JRootPane rootPane
-
titlePane
protected FlatTitlePane titlePane
-
windowResizer
protected FlatWindowResizer windowResizer
-
nativeWindowBorderData
private java.lang.Object nativeWindowBorderData
-
oldLayout
private java.awt.LayoutManager oldLayout
-
macFullWindowContentListener
private java.awt.event.ComponentListener macFullWindowContentListener
-
macWindowBackgroundListener
private java.beans.PropertyChangeListener macWindowBackgroundListener
-
TITLE_PANE_LAYER
protected static final java.lang.Integer TITLE_PANE_LAYER
-
TITLE_PANE_MOUSE_LAYER
private static final java.lang.Integer TITLE_PANE_MOUSE_LAYER
-
WINDOW_TOP_BORDER_LAYER
private static final java.lang.Integer WINDOW_TOP_BORDER_LAYER
-
TITLE_PANE_FULL_WINDOW_CONTENT_LAYER
protected static final java.lang.Integer TITLE_PANE_FULL_WINDOW_CONTENT_LAYER
- Since:
- 3.4
-
-
Method Detail
-
createUI
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
-
installUI
public void installUI(javax.swing.JComponent c)
- Overrides:
installUIin classjavax.swing.plaf.basic.BasicRootPaneUI
-
installBorder
protected void installBorder()
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUIin classjavax.swing.plaf.basic.BasicRootPaneUI
-
installDefaults
protected void installDefaults(javax.swing.JRootPane c)
- Overrides:
installDefaultsin classjavax.swing.plaf.basic.BasicRootPaneUI
-
uninstallDefaults
protected void uninstallDefaults(javax.swing.JRootPane c)
- Overrides:
uninstallDefaultsin classjavax.swing.plaf.basic.BasicRootPaneUI
-
installListeners
protected void installListeners(javax.swing.JRootPane root)
- Overrides:
installListenersin classjavax.swing.plaf.basic.BasicRootPaneUI
-
uninstallListeners
protected void uninstallListeners(javax.swing.JRootPane root)
- Overrides:
uninstallListenersin classjavax.swing.plaf.basic.BasicRootPaneUI
-
installNativeWindowBorder
protected void installNativeWindowBorder()
- Since:
- 1.1.2
-
uninstallNativeWindowBorder
protected void uninstallNativeWindowBorder()
- Since:
- 1.1.2
-
updateNativeWindowBorder
public static void updateNativeWindowBorder(javax.swing.JRootPane rootPane)
- Since:
- 1.1.2
-
installClientDecorations
protected void installClientDecorations()
-
uninstallClientDecorations
protected void uninstallClientDecorations()
-
createRootLayout
protected FlatRootPaneUI.FlatRootLayout createRootLayout()
-
createWindowResizer
protected FlatWindowResizer createWindowResizer()
-
createTitlePane
protected FlatTitlePane createTitlePane()
-
getLayerForTitlePane
private java.lang.Integer getLayerForTitlePane()
-
setTitlePane
protected void setTitlePane(FlatTitlePane newTitlePane)
-
macInstallFullWindowContentSupport
private void macInstallFullWindowContentSupport()
-
macUninstallFullWindowContentSupport
private void macUninstallFullWindowContentSupport()
-
isMacButtonsSpacingSupported
private boolean isMacButtonsSpacingSupported()
-
macInstallWindowBackgroundListener
private void macInstallWindowBackgroundListener(javax.swing.JRootPane c)
-
macUninstallWindowBackgroundListener
private void macUninstallWindowBackgroundListener(javax.swing.JRootPane c)
-
macClearBackgroundForTranslucentWindow
private void macClearBackgroundForTranslucentWindow(javax.swing.JRootPane c)
When setting window background to translucent color (alpha < 255), Swing paints that window translucent on Windows and Linux, but not on macOS. The reason for this is that FlatLaf sets the background color of the root pane, and Swing behaves a bit differently on macOS than on other platforms in that case. Other L&Fs do not set root pane background, which isnullby default.To fix this problem, set the root pane background to
nullif windows uses a translucent background.
-
getParentWindow
private java.awt.Window getParentWindow(javax.swing.JRootPane c)
-
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener- Overrides:
propertyChangein classjavax.swing.plaf.basic.BasicRootPaneUI
-
isFullWindowContent
protected static boolean isFullWindowContent(javax.swing.JRootPane rootPane)
- Since:
- 3.4
-
isMenuBarEmbedded
protected static boolean isMenuBarEmbedded(javax.swing.JRootPane rootPane)
-
getTitlePane
protected static FlatTitlePane getTitlePane(javax.swing.JRootPane rootPane)
- Since:
- 2.4
-
-