Package org.pushingpixels.substance.api
Class SubstanceCortex.WindowScope
- java.lang.Object
-
- org.pushingpixels.substance.api.SubstanceCortex.WindowScope
-
- Enclosing class:
- SubstanceCortex
public static final class SubstanceCortex.WindowScope extends java.lang.ObjectAPIs in this scope apply to individual applicationWindows.
-
-
Constructor Summary
Constructors Constructor Description WindowScope()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.swing.JButtoncreateTitlePaneControlButton(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, SubstanceSlices.HorizontalGravity, SubstanceSlices.VerticalGravity)API.static voidextendContentIntoTitlePane(java.awt.Window window, SubstanceSlices.HorizontalGravity controlButtonGroupHorizontalGravity, SubstanceSlices.VerticalGravity controlButtonGroupVerticalGravity)Marks the specified window to have its content extend vertically into the title pane area.static SubstanceSlices.HorizontalGravitygetTitleControlButtonGroupHorizontalGravity(java.awt.Window window)Returns the horizontal gravity for the control button group in the title pane of the specific window.static java.awt.InsetsgetTitlePaneControlInsets(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, SubstanceSlices.HorizontalGravity, SubstanceSlices.VerticalGravity)API.static voidmarkLabelAsTitlePaneText(java.awt.Window window, javax.swing.JLabel label)Marks the passed label to be drawn as title pane text (window title).static voidsetPreferredTitlePaneHeight(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, SubstanceSlices.HorizontalGravity, SubstanceSlices.VerticalGravity)API is taller than the main control buttons.static voidsetWidgetVisible(java.awt.Window window, boolean visible, SubstanceSlices.SubstanceWidgetType... substanceWidgets)Sets the visibility of the specified widget type(s).
-
-
-
Method Detail
-
setWidgetVisible
public static void setWidgetVisible(java.awt.Window window, boolean visible, SubstanceSlices.SubstanceWidgetType... substanceWidgets)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.substanceWidgets- Widget types.
-
extendContentIntoTitlePane
public static void extendContentIntoTitlePane(java.awt.Window window, SubstanceSlices.HorizontalGravity controlButtonGroupHorizontalGravity, SubstanceSlices.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 eitherSubstanceSlices.HorizontalGravity.LEADINGorSubstanceSlices.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, SubstanceSlices.HorizontalGravity, SubstanceSlices.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, SubstanceSlices.HorizontalGravity, SubstanceSlices.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, SubstanceSlices.HorizontalGravity, SubstanceSlices.VerticalGravity)API.Insets.leftandInsets.rightgive the horizontal insets of the control buttons.Insets.topandInsets.rightgive 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, SubstanceSlices.HorizontalGravity, SubstanceSlices.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, SubstanceSlices.HorizontalGravity, SubstanceSlices.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, SubstanceSlices.HorizontalGravity, SubstanceSlices.VerticalGravity),createTitlePaneControlButton(Window),getTitlePaneControlInsets(Window)
-
getTitleControlButtonGroupHorizontalGravity
public static SubstanceSlices.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:
SubstanceCortex.GlobalScope.configureTitleContentGravity(SubstanceSlices.HorizontalGravity, SubstanceSlices.HorizontalGravity, SubstanceSlices.TitleIconHorizontalGravity),extendContentIntoTitlePane(Window, org.pushingpixels.substance.api.SubstanceSlices.HorizontalGravity, org.pushingpixels.substance.api.SubstanceSlices.VerticalGravity),SubstanceCortex.GlobalScope.getTitleTextHorizontalGravity(),SubstanceCortex.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, SubstanceSlices.HorizontalGravity, SubstanceSlices.VerticalGravity),createTitlePaneControlButton(Window)
-
-