Class FlatWindowsNativeWindowBorder
java.lang.Object
com.formdev.flatlaf.ui.FlatWindowsNativeWindowBorder
- All Implemented Interfaces:
FlatNativeWindowBorder.Provider
Native window border support for Windows 10 when using custom decorations.
If the application wants to use custom decorations, the Windows 10 title bar is hidden (including minimize, maximize and close buttons), but not the resize borders (including drop shadow). Windows 10 window snapping functionality will remain unaffected: https://support.microsoft.com/en-us/windows/snap-your-windows-885a9b1e-a983-a3b1-16cd-c531795e6241
- Since:
- 1.1
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Colorprivate booleanprivate intprivate booleanprivate Timerprivate static FlatWindowsNativeWindowBorderprivate final EventListenerListprivate final Map<Window, FlatWindowsNativeWindowBorder.WndProc> Fields inherited from interface FlatNativeWindowBorder.Provider
SW_MAXIMIZE, SW_MINIMIZE, SW_RESTORE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprivate static RectanglecloneRectange(Rectangle rect) private void(package private) voidBecause there may be sent many WM_DWMCOLORIZATIONCOLORCHANGED messages, slightly delay event firing and fire it only once (on the AWT thread).int(package private) static FlatNativeWindowBorder.ProviderbooleanhasCustomDecoration(Window window) private voidbooleanprivate static intregistryGetIntValue(String key, String valueName, int defaultValue) voidvoidsetHasCustomDecoration(Window window, boolean hasCustomDecoration) Tell the window whether the application wants to use custom decorations.booleanshowWindow(Window window, int cmd) private voidprivate voidvoidupdateTitleBarInfo(Window window, int titleBarHeight, Predicate<Point> captionHitTestCallback, Rectangle appIconBounds, Rectangle minimizeButtonBounds, Rectangle maximizeButtonBounds, Rectangle closeButtonBounds)
-
Field Details
-
windowsMap
-
listenerList
-
fireStateChangedTimer
-
colorizationUpToDate
private boolean colorizationUpToDate -
colorizationColorAffectsBorders
private boolean colorizationColorAffectsBorders -
colorizationColor
-
colorizationColorBalance
private int colorizationColorBalance -
instance
-
-
Constructor Details
-
FlatWindowsNativeWindowBorder
private FlatWindowsNativeWindowBorder()
-
-
Method Details
-
getInstance
-
hasCustomDecoration
- Specified by:
hasCustomDecorationin interfaceFlatNativeWindowBorder.Provider
-
setHasCustomDecoration
Tell the window whether the application wants to use custom decorations. Iftrue, the Windows 10 title bar is hidden (including minimize, maximize and close buttons), but not the resize borders (including drop shadow).- Specified by:
setHasCustomDecorationin interfaceFlatNativeWindowBorder.Provider
-
install
-
uninstall
-
updateTitleBarInfo
public void updateTitleBarInfo(Window window, int titleBarHeight, Predicate<Point> captionHitTestCallback, Rectangle appIconBounds, Rectangle minimizeButtonBounds, Rectangle maximizeButtonBounds, Rectangle closeButtonBounds) - Specified by:
updateTitleBarInfoin interfaceFlatNativeWindowBorder.Provider
-
cloneRectange
-
showWindow
- Specified by:
showWindowin interfaceFlatNativeWindowBorder.Provider
-
isColorizationColorAffectsBorders
public boolean isColorizationColorAffectsBorders()- Specified by:
isColorizationColorAffectsBordersin interfaceFlatNativeWindowBorder.Provider
-
getColorizationColor
- Specified by:
getColorizationColorin interfaceFlatNativeWindowBorder.Provider
-
getColorizationColorBalance
public int getColorizationColorBalance()- Specified by:
getColorizationColorBalancein interfaceFlatNativeWindowBorder.Provider
-
updateColorization
private void updateColorization() -
registryGetIntValue
-
addChangeListener
- Specified by:
addChangeListenerin interfaceFlatNativeWindowBorder.Provider
-
removeChangeListener
- Specified by:
removeChangeListenerin interfaceFlatNativeWindowBorder.Provider
-
fireStateChanged
private void fireStateChanged() -
fireStateChangedLaterOnce
void fireStateChangedLaterOnce()Because there may be sent many WM_DWMCOLORIZATIONCOLORCHANGED messages, slightly delay event firing and fire it only once (on the AWT thread).
-