Class RadianceThemingCortex.WindowScope
- java.lang.Object
-
- org.pushingpixels.radiance.theming.api.RadianceThemingCortex.WindowScope
-
- Enclosing class:
- RadianceThemingCortex
public static final class RadianceThemingCortex.WindowScope extends java.lang.Object
APIs in this scope apply to individual applicationWindow
s.
-
-
Constructor Summary
Constructors Constructor Description WindowScope()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.swing.JButton
createTitlePaneControlButton(java.awt.Window window)
Returns a new instance of a button that has consistent visuals and preferred size to be used in application content that is extended into the title pane area withextendContentIntoTitlePane(Window, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.VerticalGravity)
API.static void
extendContentIntoTitlePane(java.awt.Window window, RadianceThemingSlices.HorizontalGravity controlButtonGroupHorizontalGravity, RadianceThemingSlices.VerticalGravity controlButtonGroupVerticalGravity)
Marks the specified window to have its content extend vertically into the title pane area.static RadianceThemingSlices.HorizontalGravity
getTitleControlButtonGroupHorizontalGravity(java.awt.Window window)
Returns the horizontal gravity for the control button group in the title pane of the specific window.static java.awt.Insets
getTitlePaneControlInsets(java.awt.Window window)
Queries the insets that should be reserved for the main control buttons (close / maximize / minimize) in application content that is extended into the title pane area withextendContentIntoTitlePane(Window, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.VerticalGravity)
API.static void
markLabelAsTitlePaneText(java.awt.Window window, javax.swing.JLabel label)
Marks the passed label to be drawn as title pane text (window title).static void
setPreferredTitlePaneHeight(java.awt.Window window, int preferredTitlePaneHeight)
Increase the preferred height of the title pane area in case the content you extend into that area withextendContentIntoTitlePane(Window, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.VerticalGravity)
API is taller than the main control buttons.static void
setWidgetVisible(java.awt.Window window, boolean visible, RadianceThemingSlices.WidgetType... radianceWidgets)
Sets the visibility of the specified widget type(s).
-
-
-
Method Detail
-
setWidgetVisible
public static void setWidgetVisible(java.awt.Window window, boolean visible, RadianceThemingSlices.WidgetType... radianceWidgets)
Sets the visibility of the specified widget type(s). This method should not be called from inside the initialization sequence of your window. If the specific widget needs to be visible when the window is shown, wrap the call withSwingUtilities.invokeLater(Runnable)
.- Parameters:
window
- Window. May not benull
.visible
- Visibility indication.radianceWidgets
- Widget types.
-
extendContentIntoTitlePane
public static void extendContentIntoTitlePane(java.awt.Window window, RadianceThemingSlices.HorizontalGravity controlButtonGroupHorizontalGravity, RadianceThemingSlices.VerticalGravity controlButtonGroupVerticalGravity)
Marks the specified window to have its content extend vertically into the title pane area. Use the following methods for finer control over such extended content:getTitlePaneControlInsets(Window)
to query the insets that should be reserved for the main control buttons - close / maximize / minimize.setPreferredTitlePaneHeight(Window, int)
to increase the preferred height of the title pane area in case the content you extend into that area is taller than the main control buttons.createTitlePaneControlButton(Window)
to get a button that has consistent visual appearance and preferred size with the main control buttons.
- Parameters:
window
- Window. May not benull
.controlButtonGroupHorizontalGravity
- Horizontal gravity for the title control buttons. Must be eitherRadianceThemingSlices.HorizontalGravity.LEADING
orRadianceThemingSlices.HorizontalGravity.TRAILING
.controlButtonGroupVerticalGravity
- Vertical gravity for the title control buttons. May not benull
.- See Also:
getTitlePaneControlInsets(Window)
,setPreferredTitlePaneHeight(Window, int)
,getTitleControlButtonGroupHorizontalGravity(Window)
,createTitlePaneControlButton(Window)
,markLabelAsTitlePaneText(Window, JLabel)
-
createTitlePaneControlButton
public static javax.swing.JButton createTitlePaneControlButton(java.awt.Window window)
Returns a new instance of a button that has consistent visuals and preferred size to be used in application content that is extended into the title pane area withextendContentIntoTitlePane(Window, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.VerticalGravity)
API. If the content of the button will need more space (horizontally and / or vertically), you can query the preferred size and then tweak it.- Parameters:
window
- Window. May not benull
.- Returns:
- A new instance of a button that has consistent visuals and preferred size to be used in application content that is extended into the title pane area.
- See Also:
extendContentIntoTitlePane(Window, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.VerticalGravity)
,getTitlePaneControlInsets(Window)
,setPreferredTitlePaneHeight(Window, int)
,markLabelAsTitlePaneText(Window, JLabel)
-
getTitlePaneControlInsets
public static java.awt.Insets getTitlePaneControlInsets(java.awt.Window window)
Queries the insets that should be reserved for the main control buttons (close / maximize / minimize) in application content that is extended into the title pane area withextendContentIntoTitlePane(Window, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.VerticalGravity)
API.Insets.left
andInsets.right
give the horizontal insets of the control buttons.Insets.top
andInsets.right
give the vertical insets within the matching horizontal insets.- Parameters:
window
- Window. May not benull
.- Returns:
- The insets that should be reserved for the main control buttons (close / maximize / minimize) in application content that is extended into the title pane area.
- See Also:
extendContentIntoTitlePane(Window, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.VerticalGravity)
,createTitlePaneControlButton(Window)
,setPreferredTitlePaneHeight(Window, int)
-
setPreferredTitlePaneHeight
public static void setPreferredTitlePaneHeight(java.awt.Window window, int preferredTitlePaneHeight)
Increase the preferred height of the title pane area in case the content you extend into that area withextendContentIntoTitlePane(Window, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.VerticalGravity)
API is taller than the main control buttons.- Parameters:
window
- Window. May not benull
.preferredTitlePaneHeight
- Preferred height of the title pane area. Must be a positive value.- See Also:
extendContentIntoTitlePane(Window, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.VerticalGravity)
,createTitlePaneControlButton(Window)
,getTitlePaneControlInsets(Window)
-
getTitleControlButtonGroupHorizontalGravity
public static RadianceThemingSlices.HorizontalGravity getTitleControlButtonGroupHorizontalGravity(java.awt.Window window)
Returns the horizontal gravity for the control button group in the title pane of the specific window.- Parameters:
window
- Window. May not benull
.- Returns:
- Horizontal gravity for the control button group in the title pane of the specific window.
- See Also:
RadianceThemingCortex.GlobalScope.configureTitleContentGravity(RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.TitleIconHorizontalGravity)
,extendContentIntoTitlePane(Window, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.VerticalGravity)
,RadianceThemingCortex.GlobalScope.getTitleTextHorizontalGravity()
,RadianceThemingCortex.GlobalScope.getTitleIconHorizontalGravity()
-
markLabelAsTitlePaneText
public static void markLabelAsTitlePaneText(java.awt.Window window, javax.swing.JLabel label)
Marks the passed label to be drawn as title pane text (window title).- Parameters:
window
- Window. May not benull
.label
- Label. May not benull
.- See Also:
extendContentIntoTitlePane(Window, RadianceThemingSlices.HorizontalGravity, RadianceThemingSlices.VerticalGravity)
,createTitlePaneControlButton(Window)
-
-