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.BasicRootPaneUI
Provides the Flat LaF UI delegate forJRootPane
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
FlatRootPaneUI.FlatRootLayout
static class
FlatRootPaneUI.FlatWindowBorder
Window border used for non-native window decorations.private static class
FlatRootPaneUI.FlatWindowTitleBorder
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.Color
borderColor
private java.awt.event.ComponentListener
macFullWindowContentListener
private java.beans.PropertyChangeListener
macWindowBackgroundListener
private java.lang.Object
nativeWindowBorderData
private java.awt.LayoutManager
oldLayout
protected javax.swing.JRootPane
rootPane
protected static java.lang.Integer
TITLE_PANE_FULL_WINDOW_CONTENT_LAYER
protected static java.lang.Integer
TITLE_PANE_LAYER
private static java.lang.Integer
TITLE_PANE_MOUSE_LAYER
protected FlatTitlePane
titlePane
private static java.lang.Integer
WINDOW_TOP_BORDER_LAYER
protected FlatWindowResizer
windowResizer
-
Constructor Summary
Constructors Constructor Description FlatRootPaneUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FlatRootPaneUI.FlatRootLayout
createRootLayout()
protected FlatTitlePane
createTitlePane()
static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent c)
protected FlatWindowResizer
createWindowResizer()
private java.lang.Integer
getLayerForTitlePane()
private java.awt.Window
getParentWindow(javax.swing.JRootPane c)
protected static FlatTitlePane
getTitlePane(javax.swing.JRootPane rootPane)
protected void
installBorder()
protected void
installClientDecorations()
protected void
installDefaults(javax.swing.JRootPane c)
protected void
installListeners(javax.swing.JRootPane root)
protected void
installNativeWindowBorder()
void
installUI(javax.swing.JComponent c)
protected static boolean
isFullWindowContent(javax.swing.JRootPane rootPane)
private boolean
isMacButtonsSpacingSupported()
protected static boolean
isMenuBarEmbedded(javax.swing.JRootPane rootPane)
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.private void
macInstallFullWindowContentSupport()
private void
macInstallWindowBackgroundListener(javax.swing.JRootPane c)
private void
macUninstallFullWindowContentSupport()
private void
macUninstallWindowBackgroundListener(javax.swing.JRootPane c)
void
propertyChange(java.beans.PropertyChangeEvent e)
protected void
setTitlePane(FlatTitlePane newTitlePane)
protected void
uninstallClientDecorations()
protected void
uninstallDefaults(javax.swing.JRootPane c)
protected void
uninstallListeners(javax.swing.JRootPane root)
protected void
uninstallNativeWindowBorder()
void
uninstallUI(javax.swing.JComponent c)
static void
updateNativeWindowBorder(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:
installUI
in classjavax.swing.plaf.basic.BasicRootPaneUI
-
installBorder
protected void installBorder()
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUI
in classjavax.swing.plaf.basic.BasicRootPaneUI
-
installDefaults
protected void installDefaults(javax.swing.JRootPane c)
- Overrides:
installDefaults
in classjavax.swing.plaf.basic.BasicRootPaneUI
-
uninstallDefaults
protected void uninstallDefaults(javax.swing.JRootPane c)
- Overrides:
uninstallDefaults
in classjavax.swing.plaf.basic.BasicRootPaneUI
-
installListeners
protected void installListeners(javax.swing.JRootPane root)
- Overrides:
installListeners
in classjavax.swing.plaf.basic.BasicRootPaneUI
-
uninstallListeners
protected void uninstallListeners(javax.swing.JRootPane root)
- Overrides:
uninstallListeners
in 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 isnull
by default.To fix this problem, set the root pane background to
null
if 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:
propertyChange
in interfacejava.beans.PropertyChangeListener
- Overrides:
propertyChange
in 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
-
-