Interface LookAndFeelEnhancer

  • All Known Subinterfaces:
    LookAndFeelHandler

    public interface LookAndFeelEnhancer
    The look and feel enhancer helps screens, form components and styles with specific aspects of creating the UI.

    At runtime the current look and feel enhancer can be obtained from UiUtil.getLookAndFeelEnhancer().

    For developing your own look and feel, see LookAndFeelHandler.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.awt.Color DEFAULT_LIGHT_TITLE_COLOR
      Default color for the title in alerts boxes.
    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default javax.swing.JCheckBox createTriStateCheckBox()
      Returns a tri-state checkbox if a specific implementation can be supplied by the look and feel
      default void disableExtraSelectionPainting​(javax.swing.JTree tree)
      Advises the look and feel UI not to perform any extra drawing for selected nodes in the specified tree.
      default java.awt.Font getAlertFont()
      Returns the font for normal text in alert boxes.
      default int getFileChooserLowerAccessoryInset()
      Some look and feels provide a file chooser dialog where the lower accessory should have an inset on the left side.
      default java.awt.Color getTitleColor()
      Returns the color for the title in alerts boxes.
      default boolean isDark()
      Returns if the look and feel displays a dark mode.
      default boolean isDarkModeSwitchingSupported()
      Returns if the look and feel supports switching between light and dark mode via UiUtil.setDarkUi(boolean).
      default boolean isPreventTransparency​(javax.swing.JComponent component)
      Returns if a component should not be made transparent with a call to JComponent.setOpaque(boolean) when it is contained in a parent container with a non-default background color.
      default boolean isWideTreeSelection()
      Returns if tree selections extend across the entire width of the tree as opposed to just the label.
      default void prepareWindow​(java.awt.Window window)
      Prepare a window before it is displayable.
    • Field Detail

      • DEFAULT_LIGHT_TITLE_COLOR

        static final java.awt.Color DEFAULT_LIGHT_TITLE_COLOR
        Default color for the title in alerts boxes. Returned by the default implementation of getTitleColor() in light mode.
    • Method Detail

      • isDark

        default boolean isDark()
        Returns if the look and feel displays a dark mode.

        The default value is false.

        See Also:
        UiUtil.isDarkUi()
      • isDarkModeSwitchingSupported

        default boolean isDarkModeSwitchingSupported()
        Returns if the look and feel supports switching between light and dark mode via UiUtil.setDarkUi(boolean).

        The default value is false

      • isWideTreeSelection

        default boolean isWideTreeSelection()
        Returns if tree selections extend across the entire width of the tree as opposed to just the label.

        The default value is false.

      • isPreventTransparency

        default boolean isPreventTransparency​(javax.swing.JComponent component)
        Returns if a component should not be made transparent with a call to JComponent.setOpaque(boolean) when it is contained in a parent container with a non-default background color. just the label.

        The default value is false.

      • createTriStateCheckBox

        @NotNull
        default javax.swing.JCheckBox createTriStateCheckBox()
        Returns a tri-state checkbox if a specific implementation can be supplied by the look and feel

        If overridden, it must return an instance that implements IndeterminateStateComponent. Note that when AbstractButton.setSelected(boolean) is called, the indeterminate state must be set to false.

        The default value uses an implementation that permanently activates the armed state for the indeterminate value.

      • getTitleColor

        default java.awt.Color getTitleColor()
        Returns the color for the title in alerts boxes.

        The default value is the label font in dark mode and DEFAULT_LIGHT_TITLE_COLOR in light mode.

        Not applicable macOS where native alerts are used.

      • getAlertFont

        @NotNull
        default java.awt.Font getAlertFont()
        Returns the font for normal text in alert boxes.

        The default value is the label font.

        Not applicable macOS where native alerts are used.

      • getFileChooserLowerAccessoryInset

        default int getFileChooserLowerAccessoryInset()
        Some look and feels provide a file chooser dialog where the lower accessory should have an inset on the left side.

        The default value is 5.

        Not applicable on Windows and macOS where native file chooser dialogs are used.

      • prepareWindow

        default void prepareWindow​(java.awt.Window window)
        Prepare a window before it is displayable. If a custom look and feel sets its own window decoration, it can make windows undecorated like this:
        
         if (window instanceof Frame) {
             ((Frame)window).setUndecorated(true);
         } else if (window instanceof Dialog) {
             ((Dialog)window).setUndecorated(true);
         }
         

        The default implementation is empty.

      • disableExtraSelectionPainting

        default void disableExtraSelectionPainting​(javax.swing.JTree tree)
        Advises the look and feel UI not to perform any extra drawing for selected nodes in the specified tree. For example, some look and feels paint a wide selection across the entire with of the tree. This is necessary for trees that handle the painting of the selection themselves.