LookAndFeelEnhancer (install4j API)
Description: declaration: package: com.install4j.api.laf, interface: LookAndFeelEnhancer

# 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 final Color`
  `DEFAULT_LIGHT_TITLE_COLOR`
  Default color for the title in alerts boxes.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default float`
  `computeFontScaleFactor(Font font)`
  Returns the scale factor of a font with respect to the default font.
  `default JCheckBox`
  `createTriStateCheckBox()`
  Returns a tri-state checkbox if a specific implementation can be supplied by the look and feel
  `default void`
  `disableExtraSelectionPainting(JTree tree)`
  Advises the look and feel UI not to perform any extra drawing for selected nodes in the specified tree.
  `default Font`
  `getAlertFont()`
  Returns the font for normal text in alert boxes.
  `default float`
  `getCustomScaleFactor()`
  Returns the custom scale factor for the look and feel.
  `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 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(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(Window window)`
  Prepare a window before it is displayable.

- ## Field Details

  - ### DEFAULT_LIGHT_TITLE_COLOR

    static final Color DEFAULT_LIGHT_TITLE_COLOR
    Default color for the title in alerts boxes. Returned by the default implementation of `getTitleColor()` in light mode.

- ## Method Details

  - ### 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(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 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 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 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(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(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 width of the tree. This is necessary for trees that handle the painting of the selection themselves.

  - ### getCustomScaleFactor

    default float getCustomScaleFactor()
    Returns the custom scale factor for the look and feel. This factor does not include HiDPI scale factors but only an extra scaling of UI element sizes.
    Returns:
      the custom scale factor

  - ### computeFontScaleFactor

    default float computeFontScaleFactor(Font font)
    Returns the scale factor of a font with respect to the default font. This can be used for siting UI components correctly.
    Parameters:
      `font` - the font
    Returns:
      the scale factor