de.caff.util.swing

## Class SwingHelper

- java.lang.Object
- - de.caff.util.swing.SwingHelper

-     public class SwingHelper
      extends java.lang.Object

  Helper class for getting things done in swing.
  Author:
    Rammi

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `(package private) static class` | `SwingHelper.RowHeaderRenderer`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_MIN_FONT_SIZE` The default value for a minimal font size when adjusting font sizes.
    `static int` | `DEFAULT_NUM_ROWS` Default number of text rows which are expected to be displayed with good visibility.
    `static Dict<java.awt.RenderingHints.Key,java.lang.Object>` | `DEFAULT_RENDER` A dictionary with rendering hints providing default settings for various properties.
    `static Dict<java.awt.RenderingHints.Key,java.lang.Object>` | `FAST_RENDER` A dictionary with rendering hints providing fast settings for various properties.
    `static Dict<java.awt.RenderingHints.Key,java.lang.Object>` | `NICE_RENDER` A dictionary with rendering hints providing nice settings for various properties.
    `static IntIndexable` | `STANDARD_ICON_SIZES` Standard icon sizes under various operating systems.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SwingHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `adjustFontSizes(int plusminus)` Adjust all font sizes used in the application.
    `static void` | `adjustFontSizes(int plusminus, java.awt.Component... updateRoots)` Adjust all font sizes used in the application.
    `static void` | `adjustFontSizes(int plusminus, java.awt.Component updateRoot)` Adjust all font sizes used in the application.
    `static void` | `adjustFontSizes(int plusminus, int allowedMinSize)` Adjust all font sizes used in the application.
    `static void` | `adjustFontSizes(int plusminus, int allowedMinSize, java.awt.Component... updateRoots)` Adjust all font sizes used in the application.
    `static void` | `adjustFontSizes(int plusminus, int allowedMinSize, java.awt.Component updateRoot)` Adjust all font sizes used in the application.
    `static javax.swing.JList<java.lang.String>` | `buildRowHeader(javax.swing.JTable table, java.util.Vector<java.lang.String> headers)` Build a row header view.
    `static javax.swing.JPanel` | `createSimpleMultiColumnPanel(int numColumns, Countable<? extends javax.swing.JComponent> components)` Create a panel to have a defined number of columns of automatic width.
    `static void` | `enableHiDpiSupport(java.awt.Window mainWindow, java.awt.Component... moreRoots)` Enable high DPI support for the given window.
    `static java.awt.geom.AffineTransform` | `fitTransform(java.awt.geom.Rectangle2D source, java.awt.geom.Rectangle2D target, double margin)` Get a transformation which fits a source rectangle into a target rectangle with uniform scaling.
    `static java.awt.geom.AffineTransform` | `fitTransform(java.awt.geom.Rectangle2D source, java.awt.geom.Rectangle2D target, double margin, boolean invertY)` Get a transformation which fits a source rectangle into a target rectangle with uniform scaling.
    `static java.awt.geom.AffineTransform` | `fitTransform(java.awt.geom.Rectangle2D source, java.awt.geom.Rectangle2D target, double margin, boolean invertY, boolean isotrop)` Get a transformation which fits a source rectangle into a target rectangle with uniform scaling.
    `static int` | `getAccumulatedFontSizeChanges()` Get the accumulated font size changes.
    `static java.awt.Rectangle` | `getDrawableViewport(java.awt.Component comp)` Get the inner rectangle of a component which is available for drawing.
    `static java.awt.Rectangle` | `getDrawableViewport(javax.swing.JComponent comp)` Get the inner rectangle of a Swing component which is available for drawing.
    `static int` | `getMinUiFontSize()` Get the minimal size used in the UI fonts.
    `static int` | `getModifiersExWithButton(java.awt.event.MouseEvent event)` Workaround for changed behavior of modifiers handling.
    `static java.awt.Rectangle` | `getScreenViewport(java.awt.GraphicsConfiguration graphicsConfiguration)` Get the part of the screen available for user application windows.
    `static int` | `getUsefulFontSize()` Get a useful font size for the default screen's default graphics configuration in order to display `DEFAULT_NUM_ROWS` text rows
    `static int` | `getUsefulFontSize(java.awt.GraphicsConfiguration config)` Get a useful font size for the given graphics configuration.
    `static int` | `getUsefulFontSize(java.awt.GraphicsConfiguration config, int nRows)` Get a useful font size for the given graphics configuration.
    `static int` | `getUsefulFontSize(int nRows)` Get a useful font size for the given graphics configuration.
    `static void` | `invokeMuchLater(int recursions, java.lang.Runnable task)` Invoke a GUI related task much later.
    `static void` | `invokeMuchLater(java.lang.Runnable task)` Invoke a GUI related task much later.
    `static javax.swing.Icon` | `loadIconResource(java.lang.String resourcePath)` Load a potentially scalable icon.
    `static void` | `prepareDefaultGraphics(java.awt.Graphics2D g2)` Prepare a graphics context to use default settings for rendering.
    `static void` | `prepareFastGraphics(java.awt.Graphics2D g2)` Prepare a graphics context to use the fastest settings for rendering.
    `static void` | `prepareGraphics(java.awt.Graphics2D g2, Dict<java.awt.RenderingHints.Key,?> hints)` Prepare the rendering hints of a graphics context.
    `static void` | `prepareNiceGraphics(java.awt.Graphics2D g2)` Prepare a graphics context to use high-quality rendering.
    `static int` | `setupDefaultHiDpi()` Setup default high DPI settings.
    `static int` | `setupDefaultHiDpi(java.awt.GraphicsConfiguration config)` Setup default high DPI settings.
    `static void` | `setupSimpleMultiColumnPanel(javax.swing.JPanel panelWithGridBagLayout, int numColumns, Countable<? extends javax.swing.JComponent> components)` Set up a panel to have a defined number of columns of automatic width.
    `static void` | `setupSimpleMultiColumnPanel(javax.swing.JPanel panelWithGridBagLayout, int numColumns, javax.swing.JComponent... components)` Set up a panel to have a defined number of columns of automatic width.
    `static void` | `setupSimpleTwoColumnPanel(javax.swing.JPanel panelWithGridBagLayout, java.lang.Iterable<Pair<javax.swing.JComponent>> rows)` Set up a panel to have two columns of automatic width.
    `static javax.swing.JFrame` | `showSimpleApplicationFrame(java.lang.String title, javax.swing.JComponent component, int width, int height)` Show a frame with a central component.
    `static javax.swing.JFrame` | `simpleApplicationFrame(java.lang.String title, javax.swing.JComponent component, int width, int height)` Create a frame with a central component.
    `static javax.swing.JPanel` | `simpleMultiColumnPanel(int numColumns, javax.swing.JComponent... components)` Create a panel to have a defined number of columns of automatic width.
    `static javax.swing.JPanel` | `simpleTwoColumnPanel(java.lang.Iterable<Pair<javax.swing.JComponent>> rows)` Set up a panel to have two columns of automatic width.
    `static javax.swing.JPanel` | `simpleTwoColumnPanel(javax.swing.JComponent... components)` Set up a panel to have two columns of automatic width.
    `static javax.swing.JPanel` | `simpleTwoColumnPanelFrom(Indexable<? extends javax.swing.JComponent> components)` Set up a panel to have two columns of automatic width from an indexable array of components.
    `static void` | `updateUI(java.awt.Component component)` Calls the updateUI() method on swing components recursively.
    `static java.awt.geom.AffineTransform` | `viewTransform(java.awt.geom.Rectangle2D source, javax.swing.JComponent target, double margin)` Get a transformation which fits a given source rectangle into a Swing component using uniform scaling.
    `static java.awt.geom.AffineTransform` | `viewTransform(java.awt.geom.Rectangle2D source, javax.swing.JComponent target, double margin, boolean invertY)` Get a transformation which fits a given source rectangle into a Swing component using uniform scaling.
    `static java.awt.geom.AffineTransform` | `viewTransform(java.awt.geom.Rectangle2D source, javax.swing.JComponent target, double margin, boolean invertY, boolean isotrop)` Get a transformation which fits a given source rectangle into a Swing component using uniform scaling.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_MIN_FONT_SIZE

          public static final int DEFAULT_MIN_FONT_SIZE

      The default value for a minimal font size when adjusting font sizes.
      See Also:
        Constant Field Values

    - #### STANDARD_ICON_SIZES

          public static final IntIndexable STANDARD_ICON_SIZES

      Standard icon sizes under various operating systems.

    - #### DEFAULT_NUM_ROWS

          public static final int DEFAULT_NUM_ROWS

      Default number of text rows which are expected to be displayed with good visibility. This is part of hidpi support.
      See Also:
        Constant Field Values

    - #### DEFAULT_RENDER

          public static final Dict<java.awt.RenderingHints.Key,java.lang.Object> DEFAULT_RENDER

      A dictionary with rendering hints providing default settings for various properties. It provides settings for most but not all properties. Contained are rendering hints for
      - `RenderingHints.KEY_RENDERING`
      - `RenderingHints.KEY_ANTIALIASING`
      - `RenderingHints.KEY_FRACTIONALMETRICS`
      - `RenderingHints.KEY_TEXT_ANTIALIASING`
      - `RenderingHints.KEY_INTERPOLATION`
      - `RenderingHints.KEY_ALPHA_INTERPOLATION`
      - `RenderingHints.KEY_COLOR_RENDERING`

    - #### NICE_RENDER

          public static final Dict<java.awt.RenderingHints.Key,java.lang.Object> NICE_RENDER

      A dictionary with rendering hints providing nice settings for various properties. It provides settings for most but not all properties. Contained are rendering hints for
      - `RenderingHints.KEY_RENDERING`
      - `RenderingHints.KEY_ANTIALIASING`
      - `RenderingHints.KEY_FRACTIONALMETRICS`
      - `RenderingHints.KEY_TEXT_ANTIALIASING`
      - `RenderingHints.KEY_INTERPOLATION`
      - `RenderingHints.KEY_ALPHA_INTERPOLATION`
      - `RenderingHints.KEY_COLOR_RENDERING`

    - #### FAST_RENDER

          public static final Dict<java.awt.RenderingHints.Key,java.lang.Object> FAST_RENDER

      A dictionary with rendering hints providing fast settings for various properties. It provides settings for most but not all properties. Contained are rendering hints for
      - `RenderingHints.KEY_RENDERING`
      - `RenderingHints.KEY_ANTIALIASING`
      - `RenderingHints.KEY_FRACTIONALMETRICS`
      - `RenderingHints.KEY_TEXT_ANTIALIASING`
      - `RenderingHints.KEY_INTERPOLATION`
      - `RenderingHints.KEY_ALPHA_INTERPOLATION`
      - `RenderingHints.KEY_COLOR_RENDERING`

  - ### Constructor Detail

    - #### SwingHelper

          public SwingHelper()

  - ### Method Detail

    - #### adjustFontSizes

          public static void adjustFontSizes(int plusminus)

      Adjust all font sizes used in the application. The given delta is just added to all font sizes in this application. This uses the default minimum size.
      Parameters:
        `plusminus` - how to adjust, if positive fonts used become larger, if negative smaller

    - #### adjustFontSizes

          public static void adjustFontSizes(int plusminus,
                                             int allowedMinSize)

      Adjust all font sizes used in the application. The given delta is just added to all font sizes in this application.
      Parameters:
        `plusminus` - how to adjust, if positive fonts used become larger, if negative smaller
        `allowedMinSize` - the minimal font size result when shrinking

    - #### adjustFontSizes

          public static void adjustFontSizes(int plusminus,
                                             @Nullable
                                             java.awt.Component updateRoot)

      Adjust all font sizes used in the application. The given delta is just added to all font sizes in this application. This uses the default minimum size.
      Parameters:
        `plusminus` - how to adjust, if positive fonts used become larger, if negative smaller
        `updateRoot` - because for some reason the components don't update automatically, here a root component may be added which will be explicitely updated using the `updateUI(java.awt.Component)` method

    - #### adjustFontSizes

          public static void adjustFontSizes(int plusminus,
                                             int allowedMinSize,
                                             @Nullable
                                             java.awt.Component updateRoot)

      Adjust all font sizes used in the application. The given delta is just added to all font sizes in this application.
      Parameters:
        `plusminus` - how to adjust, if positive fonts used become larger, if negative smaller
        `allowedMinSize` - the minimal font size result when shrinking
        `updateRoot` - because for some reason the components don't update automatically, here a root component may be added which will be explicitly updated using the `updateUI(java.awt.Component)` method

    - #### adjustFontSizes

          public static void adjustFontSizes(int plusminus,
                                             java.awt.Component... updateRoots)

      Adjust all font sizes used in the application. The given delta is just added to all font sizes in this application. This uses the default minimum size.
      Parameters:
        `plusminus` - how to adjust, if positive fonts used become larger, if negative smaller
        `updateRoots` - because for some reason the components don't update automatically, here root components may be added which will be explicitly updated using the `updateUI(java.awt.Component)` method

    - #### adjustFontSizes

          public static void adjustFontSizes(int plusminus,
                                             int allowedMinSize,
                                             java.awt.Component... updateRoots)

      Adjust all font sizes used in the application. The given delta is just added to all font sizes in this application.
      Parameters:
        `plusminus` - how to adjust, if positive fonts used become larger, if negative smaller
        `allowedMinSize` - the minimal font size result when shrinking
        `updateRoots` - because for some reason the components don't update automatically, here root components may be added which will be explicitly updated using the `updateUI(java.awt.Component)` method

    - #### getMinUiFontSize

          public static int getMinUiFontSize()

      Get the minimal size used in the UI fonts.
      Returns:
        minimal UI font size

    - #### updateUI

          public static void updateUI(java.awt.Component component)

      Calls the updateUI() method on swing components recursively.
      Parameters:
        `component` - root component

    - #### getAccumulatedFontSizeChanges

          public static int getAccumulatedFontSizeChanges()

      Get the accumulated font size changes.
      Returns:
        accumulated font size changes

    - #### enableHiDpiSupport

          public static void enableHiDpiSupport(@NotNull
                                                java.awt.Window mainWindow,
                                                @NotNull
                                                java.awt.Component... moreRoots)

      Enable high DPI support for the given window. This goes recursively over the component tree(s) and enables high DPI support.
      Parameters:
        `mainWindow` - application's main window
        `moreRoots` - more root components for recursive enablement

    - #### setupDefaultHiDpi

          public static int setupDefaultHiDpi()

      Setup default high DPI settings. This uses the default graphics configuration of the default screen device for setup.
      Returns:
        the font delta applied during setup

    - #### setupDefaultHiDpi

          public static int setupDefaultHiDpi(@NotNull
                                              java.awt.GraphicsConfiguration config)

      Setup default high DPI settings.
      Parameters:
        `config` - graphics configuration used for setup
      Returns:
        the font delta applied during setup

    - #### getUsefulFontSize

          public static int getUsefulFontSize()

      Get a useful font size for the default screen's default graphics configuration in order to display `DEFAULT_NUM_ROWS` text rows
      Returns:
        font size which would allow to display the given number of lines

    - #### getUsefulFontSize

          public static int getUsefulFontSize(int nRows)

      Get a useful font size for the given graphics configuration. This uses the default configuration of the default screen for calculation.
      Parameters:
        `nRows` - number of text rows expected to be visible on screen
      Returns:
        font size which would allow to display the given number of lines

    - #### getUsefulFontSize

          public static int getUsefulFontSize(@NotNull
                                              java.awt.GraphicsConfiguration config)

      Get a useful font size for the given graphics configuration. This uses `DEFAULT_NUM_ROWS` as number of visible rows.
      Parameters:
        `config` - graphics configuration
      Returns:
        font size which would allow to display the default number of text rows

    - #### getUsefulFontSize

          public static int getUsefulFontSize(@NotNull
                                              java.awt.GraphicsConfiguration config,
                                              int nRows)

      Get a useful font size for the given graphics configuration.
      Parameters:
        `config` - graphics configuration
        `nRows` - number of text rows expected to be visible on screen
      Returns:
        font size which would allow to display the given number of text rows

    - #### loadIconResource

          @Nullable
          public static javax.swing.Icon loadIconResource(@NotNull
                                                                    java.lang.String resourcePath)

      Load a potentially scalable icon.
      Parameters:
        `resourcePath` - internal resource path to image
      Returns:
        icon

    - #### getDrawableViewport

          @NotNull
          public static java.awt.Rectangle getDrawableViewport(@NotNull
                                                                        java.awt.Component comp)

      Get the inner rectangle of a component which is available for drawing. This takes care of possible insets in Swing components.
      Parameters:
        `comp` - component for which the draw rectangle is requested
      Returns:
        draw rectangle of component

    - #### getDrawableViewport

          @NotNull
          public static java.awt.Rectangle getDrawableViewport(@NotNull
                                                                        javax.swing.JComponent comp)

      Get the inner rectangle of a Swing component which is available for drawing. This takes care of possible insets.
      Parameters:
        `comp` - component for which the draw rectangle is requested
      Returns:
        draw rectangle of component

    - #### fitTransform

          @NotNull
          public static java.awt.geom.AffineTransform fitTransform(@NotNull
                                                                            java.awt.geom.Rectangle2D source,
                                                                            @NotNull
                                                                            java.awt.geom.Rectangle2D target,
                                                                            double margin)

      Get a transformation which fits a source rectangle into a target rectangle with uniform scaling.

      This is most useful for calculating view transformations for fitting a bounding rectangle into a screen rectangle.

      Parameters:
        `source` - source rectangle
        `target` - target rectangle
        `margin` - margin subtracted from all borders of target rectangle, use `0.0` for no margin
      Returns:
        fit transformation
      See Also:
        `viewTransform(Rectangle2D, JComponent, double)`

    - #### fitTransform

          @NotNull
          public static java.awt.geom.AffineTransform fitTransform(@NotNull
                                                                            java.awt.geom.Rectangle2D source,
                                                                            @NotNull
                                                                            java.awt.geom.Rectangle2D target,
                                                                            double margin,
                                                                            boolean invertY)

      Get a transformation which fits a source rectangle into a target rectangle with uniform scaling.

      This is most useful for calculating view transformations for fitting a bounding rectangle into a screen rectangle.

      Parameters:
        `source` - source rectangle
        `target` - target rectangle
        `margin` - margin subtracted from all borders of target rectangle, use `0.0` for no margin
        `invertY` - invert the Y axis?
      Returns:
        fit transformation
      See Also:
        `viewTransform(Rectangle2D, JComponent, double)`

    - #### fitTransform

          @NotNull
          public static java.awt.geom.AffineTransform fitTransform(@NotNull
                                                                            java.awt.geom.Rectangle2D source,
                                                                            @NotNull
                                                                            java.awt.geom.Rectangle2D target,
                                                                            double margin,
                                                                            boolean invertY,
                                                                            boolean isotrop)

      Get a transformation which fits a source rectangle into a target rectangle with uniform scaling.

      This is most useful for calculating view transformations for fitting a bounding rectangle into a screen rectangle.

      Parameters:
        `source` - source rectangle
        `target` - target rectangle
        `margin` - margin subtracted from all borders of target rectangle, use `0.0` for no margin
        `isotrop` - scale the same in both directions?
        `invertY` - invert the Y axis?
      Returns:
        fit transformation
      See Also:
        `viewTransform(Rectangle2D, JComponent, double)`

    - #### viewTransform

          @NotNull
          public static java.awt.geom.AffineTransform viewTransform(@NotNull
                                                                             java.awt.geom.Rectangle2D source,
                                                                             @NotNull
                                                                             javax.swing.JComponent target,
                                                                             double margin)

      Get a transformation which fits a given source rectangle into a Swing component using uniform scaling.

      This especially takes care of possible borders applied to `target`.

      Parameters:
        `source` - source rectangle
        `target` - target rectangle
        `margin` - margin subtracted from all borders of target rectangle, use `0.0` for no margin
      Returns:
        fit transformation
      See Also:
        `viewTransform(Rectangle2D, JComponent, double)`, `getDrawableViewport(JComponent)`

    - #### viewTransform

          @NotNull
          public static java.awt.geom.AffineTransform viewTransform(@NotNull
                                                                             java.awt.geom.Rectangle2D source,
                                                                             @NotNull
                                                                             javax.swing.JComponent target,
                                                                             double margin,
                                                                             boolean invertY)

      Get a transformation which fits a given source rectangle into a Swing component using uniform scaling.

      This especially takes care of possible borders applied to `target`.

      Parameters:
        `source` - source rectangle
        `target` - target rectangle
        `margin` - margin subtracted from all borders of target rectangle, use `0.0` for no margin
        `invertY` - invert the Y axis?
      Returns:
        fit transformation
      See Also:
        `viewTransform(Rectangle2D, JComponent, double)`, `getDrawableViewport(JComponent)`

    - #### viewTransform

          @NotNull
          public static java.awt.geom.AffineTransform viewTransform(@NotNull
                                                                             java.awt.geom.Rectangle2D source,
                                                                             @NotNull
                                                                             javax.swing.JComponent target,
                                                                             double margin,
                                                                             boolean invertY,
                                                                             boolean isotrop)

      Get a transformation which fits a given source rectangle into a Swing component using uniform scaling.

      This especially takes care of possible borders applied to `target`.

      Parameters:
        `source` - source rectangle
        `target` - target rectangle
        `margin` - margin subtracted from all borders of target rectangle, use `0.0` for no margin
        `invertY` - invert the Y axis?
        `isotrop` - scale the same in both directions?
      Returns:
        fit transformation
      See Also:
        `viewTransform(Rectangle2D, JComponent, double)`, `getDrawableViewport(JComponent)`

    - #### getModifiersExWithButton

          public static int getModifiersExWithButton(@NotNull
                                                     java.awt.event.MouseEvent event)

      Workaround for changed behavior of modifiers handling. `InputEvent.getModifiers()` contains the relevant buttons even in the release case, while `MouseEvent.getModifiersEx()` does not. This method includes the button in the modifiers in its down state even although this is is basically wrong. This allows old logic to still do its work.
      Parameters:
        `event` - mouse event
      Returns:
        result of `MouseEvent.getModifiersEx()` with the down flag for the button of interest

    - #### invokeMuchLater

          public static void invokeMuchLater(@NotNull
                                             java.lang.Runnable task)

      Invoke a GUI related task much later. This will use a recursion count of `8`.
      Parameters:
        `task` - task to perform much later
      See Also:
        `invokeMuchLater(int, Runnable)`

    - #### invokeMuchLater

          public static void invokeMuchLater(int recursions,
                                             @NotNull
                                             java.lang.Runnable task)

      Invoke a GUI related task much later. This will make the given number of reinvocations using `SwingUtilities.invokeLater(Runnable)` until the task is performed. Using `1` for `recursions` will make this method behave like
      Parameters:
        `recursions` - number of reinvocations until `task` is performed
        `task` - task to perform much later

    - #### getScreenViewport

          @NotNull
          public static java.awt.Rectangle getScreenViewport(@NotNull
                                                                      java.awt.GraphicsConfiguration graphicsConfiguration)

      Get the part of the screen available for user application windows.
      Parameters:
        `graphicsConfiguration` - graphics configuration of the screen of interest
      Returns:
        screen viewport

    - #### prepareGraphics

          public static void prepareGraphics(@NotNull
                                             java.awt.Graphics2D g2,
                                             @NotNull
                                             Dict<java.awt.RenderingHints.Key,?> hints)

      Prepare the rendering hints of a graphics context. This will set each rendering hint from `hints` for the given graphics.
      Parameters:
        `g2` - graphics context
        `hints` - rendering hints to set

    - #### prepareDefaultGraphics

          public static void prepareDefaultGraphics(@NotNull
                                                    java.awt.Graphics2D g2)

      Prepare a graphics context to use default settings for rendering.
      Parameters:
        `g2` - graphics context
      See Also:
        `prepareGraphics(Graphics2D, Dict)`, `prepareNiceGraphics(Graphics2D)`, `prepareFastGraphics(Graphics2D)`

    - #### prepareNiceGraphics

          public static void prepareNiceGraphics(@NotNull
                                                 java.awt.Graphics2D g2)

      Prepare a graphics context to use high-quality rendering. This may slow down painting.
      Parameters:
        `g2` - graphics context
      See Also:
        `prepareGraphics(Graphics2D, Dict)`, `prepareDefaultGraphics(Graphics2D)`, `prepareFastGraphics(Graphics2D)`

    - #### prepareFastGraphics

          public static void prepareFastGraphics(@NotNull
                                                 java.awt.Graphics2D g2)

      Prepare a graphics context to use the fastest settings for rendering. The resulting output may look ugly.
      Parameters:
        `g2` - graphics context
      See Also:
        `prepareGraphics(Graphics2D, Dict)`, `prepareDefaultGraphics(Graphics2D)`, `prepareNiceGraphics(Graphics2D)`

    - #### simpleTwoColumnPanel

          @NotNull
          public static javax.swing.JPanel simpleTwoColumnPanel(@NotNull
                                                                         javax.swing.JComponent... components)

      Set up a panel to have two columns of automatic width.

      This is useful for displaying name-value pairs in cases where a table is not sufficient.

      Parameters:
        `components` - components ordered left, right, left, right, ...
      Returns:
        panel with the given setup

    - #### simpleTwoColumnPanelFrom

          @NotNull
          public static javax.swing.JPanel simpleTwoColumnPanelFrom(@NotNull
                                                                             Indexable<? extends javax.swing.JComponent> components)

      Set up a panel to have two columns of automatic width from an indexable array of components.

      This is useful for displaying name-value pairs in cases where a table is not sufficient.

      Parameters:
        `components` - components ordered left, right, left, right, ...
      Returns:
        panel with the given setup

    - #### simpleTwoColumnPanel

          @NotNull
          public static javax.swing.JPanel simpleTwoColumnPanel(@NotNull
                                                                         java.lang.Iterable<Pair<javax.swing.JComponent>> rows)

      Set up a panel to have two columns of automatic width.

      This is useful for displaying name-value pairs in cases where a table is not sufficient.

      Parameters:
        `rows` - pairs of components for the rows of the panel
      Returns:
        panel with the given setup

    - #### setupSimpleTwoColumnPanel

          public static void setupSimpleTwoColumnPanel(@NotNull
                                                       javax.swing.JPanel panelWithGridBagLayout,
                                                       @NotNull
                                                       java.lang.Iterable<Pair<javax.swing.JComponent>> rows)

      Set up a panel to have two columns of automatic width.

      This is useful for displaying name-value pairs in cases where a table is not sufficient.

      Parameters:
        `panelWithGridBagLayout` - panel, required to have a `GridBagLayout`
        `rows` - pairs of components for the rows of the panel

    - #### simpleMultiColumnPanel

          @NotNull
          public static javax.swing.JPanel simpleMultiColumnPanel(int numColumns,
                                                                           @NotNull
                                                                           javax.swing.JComponent... components)

      Create a panel to have a defined number of columns of automatic width.
      Parameters:
        `numColumns` - number of columns
        `components` - components to add, the number has to be a multiple of `numColums`, use `null` to keep a cell empty
      Returns:
        panel with the given components organized in columns

    - #### setupSimpleMultiColumnPanel

          public static void setupSimpleMultiColumnPanel(@NotNull
                                                         javax.swing.JPanel panelWithGridBagLayout,
                                                         int numColumns,
                                                         @NotNull
                                                         javax.swing.JComponent... components)

      Set up a panel to have a defined number of columns of automatic width.
      Parameters:
        `panelWithGridBagLayout` - panel, required to have a `GridBagLayout`
        `numColumns` - number of columns
        `components` - components to add, the number has to be a multiple of `numColums`, use `null` to keep a cell empty

    - #### createSimpleMultiColumnPanel

          @NotNull
          public static javax.swing.JPanel createSimpleMultiColumnPanel(int numColumns,
                                                                                 @NotNull
                                                                                 Countable<? extends javax.swing.JComponent> components)

      Create a panel to have a defined number of columns of automatic width.
      Parameters:
        `numColumns` - number of columns, at least `1`
        `components` - components to add, the number has to be a multiple of `numColums`, use `null` to keep a cell empty
      Returns:
        panel with the given components organized in columns

    - #### setupSimpleMultiColumnPanel

          public static void setupSimpleMultiColumnPanel(@NotNull
                                                         javax.swing.JPanel panelWithGridBagLayout,
                                                         int numColumns,
                                                         @NotNull
                                                         Countable<? extends javax.swing.JComponent> components)

      Set up a panel to have a defined number of columns of automatic width.
      Parameters:
        `panelWithGridBagLayout` - panel, required to have a `GridBagLayout`
        `numColumns` - number of columns, at least `1`
        `components` - components to add, the number has to be a multiple of `numColums`, use `null` to keep a cell empty

    - #### simpleApplicationFrame

          @NotNull
          public static javax.swing.JFrame simpleApplicationFrame(@NotNull
                                                                           java.lang.String title,
                                                                           @NotNull
                                                                           javax.swing.JComponent component,
                                                                           int width,
                                                                           int height)

      Create a frame with a central component. This is thought for quick-shot visual programs. The frame is disposed on close.
      Parameters:
        `title` - frame title
        `component` - central component
        `width` - frame width (use `0` for packed)
        `height` - frame height (use `0` for packed
      Returns:
        the created frame

    - #### showSimpleApplicationFrame

          @NotNull
          public static javax.swing.JFrame showSimpleApplicationFrame(@NotNull
                                                                               java.lang.String title,
                                                                               @NotNull
                                                                               javax.swing.JComponent component,
                                                                               int width,
                                                                               int height)

      Show a frame with a central component. This is thought for quick-shot visual programs. The frame is disposed on close.
      Parameters:
        `title` - frame title
        `component` - central component
        `width` - frame width (use `0` for packed)
        `height` - frame height (use `0` for packed
      Returns:
        the created frame

    - #### buildRowHeader

          @NotNull
          public static javax.swing.JList<java.lang.String> buildRowHeader(@NotNull
                                                                                    javax.swing.JTable table,
                                                                                    @NotNull
                                                                                    java.util.Vector<java.lang.String> headers)

      Build a row header view.
      Parameters:
        `table` - table for which the row header is created
        `headers` - headers to set, should have the same number of rows as table
      Returns:
        a JList which can be set as `row header view component`