Class RadianceThemingCortex.WindowScope
java.lang.Object
org.pushingpixels.radiance.theming.api.RadianceThemingCortex.WindowScope
- Enclosing class:
RadianceThemingCortex
APIs in this scope apply to individual application
Window
s.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JButton
createTitlePaneControlButton
(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
(Window window, RadianceThemingSlices.HorizontalGravity controlButtonGroupHorizontalGravity, RadianceThemingSlices.VerticalGravity controlButtonGroupVerticalGravity) Marks the specified window to have its content extend vertically into the title pane area.Returns the horizontal gravity for the control button group in the title pane of the specific window.static Insets
getTitlePaneControlInsets
(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
(Window window, JLabel label) Marks the passed label to be drawn as title pane text (window title).static void
setPreferredTitlePaneHeight
(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
(Window window, boolean visible, RadianceThemingSlices.WidgetType... radianceWidgets) Sets the visibility of the specified widget type(s).
-
Constructor Details
-
WindowScope
public WindowScope()
-
-
Method Details
-
setWidgetVisible
public static void setWidgetVisible(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(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:
-
createTitlePaneControlButton
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:
-
getTitlePaneControlInsets
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:
-
setPreferredTitlePaneHeight
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:
-
getTitleControlButtonGroupHorizontalGravity
public static RadianceThemingSlices.HorizontalGravity getTitleControlButtonGroupHorizontalGravity(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:
-
markLabelAsTitlePaneText
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:
-