# Class LayoutUtil

java.lang.Object
com.codename1.ui.layouts.mig.LayoutUtil

public final class LayoutUtil extends Object
A utility class that has only static helper methods.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final boolean`
  `HAS_BEANS`
  `static final int`
  `HORIZONTAL`
  `static final int`
  `INF`
  A substitute value for aa really large value.
  `static final int`
  `MAX`
  `static final int`
  `MIN`
  `static final int`
  `PREF`
  `static final int`
  `VERTICAL`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static int`
  `getDesignTimeEmptySize()`
  The size of an empty row or columns in a grid during design time.
  `static int`
  `getGlobalDebugMillis()`
  If global debug should be on or off.
  `static Object`
  `getSerializedObject(Object caller)`
  Returns the serialized object that are associated with `caller`.
  `static int`
  `getSizeSafe(int[] sizes, int sizeType)`
  `static String`
  `getVersion()`
  Returns the current version of MiG Layout.
  `static boolean`
  `isDesignTime(ContainerWrapper cw)`
  Returns if design time is turned on for a Container in `ContainerWrapper`.
  `static boolean`
  `isLeftToRight(LC lc, ContainerWrapper container)`
  Returns if left-to-right orientation is used.
  `static void`
  `setDesignTime(ContainerWrapper cw, boolean b)`
  Sets if design time is turned on for a Container in `ContainerWrapper`.
  `static void`
  `setDesignTimeEmptySize(int pixels)`
  The size of an empty row or columns in a grid during design time.
  `static void`
  `setGlobalDebugMillis(int millis)`
  If global debug should be on or off.
  `static void`
  `setSerializedObject(Object caller, Object o)`
  Sets the serialized object and associates it with `caller`.

  ### Methods inherited from class Object

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

- ## Field Details

  - ### INF

    public static final int INF
    A substitute value for aa really large value. Integer.MAX_VALUE is not used since that means a lot of defensive code for potential overflow must exist in many places. This value is large enough for being unreasonable yet it is hard to overflow.
    See Also:
      - Constant Field Values

  - ### MIN

    public static final int MIN
    See Also:
      - Constant Field Values

  - ### PREF

    public static final int PREF
    See Also:
      - Constant Field Values

  - ### MAX

    public static final int MAX
    See Also:
      - Constant Field Values

  - ### HORIZONTAL

    public static final int HORIZONTAL
    See Also:
      - Constant Field Values

  - ### VERTICAL

    public static final int VERTICAL
    See Also:
      - Constant Field Values

  - ### HAS_BEANS

    public static final boolean HAS_BEANS

- ## Method Details

  - ### getVersion

    public static String getVersion()

    Returns the current version of MiG Layout.

    ###### Returns

    The current version of MiG Layout. E.g. "3.6.3" or "4.0"

  - ### getGlobalDebugMillis

    public static int getGlobalDebugMillis()

    If global debug should be on or off. If > 0 then debug is turned on for all MigLayout instances.

    ###### Returns

    The current debug milliseconds.

    ###### See also

    - LC#setDebugMillis(int)

  - ### setGlobalDebugMillis

    public static void setGlobalDebugMillis(int millis)

    If global debug should be on or off. If > 0 then debug is turned on for all MigLayout instances.

    Note! This is a passive value and will be read by panels when the needed, which is normally when they repaint/layout.

    ###### Parameters

    - `millis`: @param millis The new debug milliseconds. 0 turns of global debug and leaves debug up to every individual panel.

    ###### See also

    - LC#setDebugMillis(int)

  - ### setDesignTime

    public static void setDesignTime(ContainerWrapper cw, boolean b)

    Sets if design time is turned on for a Container in `ContainerWrapper`.

    ###### Parameters

    - `cw`: @param cw The container to set design time for. `null` is legal and can be used as a key to turn on/off design time "in general". Note though that design time "in general" is always on as long as there is at least one ContainerWrapper with design time.

    If this method has not ever been called it will default to what `Beans.isDesignTime()` returns. This means that if you call this method you indicate that you will take responsibility for the design time value.

    - `b`: `true` means design time on.

  - ### isDesignTime

    public static boolean isDesignTime(ContainerWrapper cw)

    Returns if design time is turned on for a Container in `ContainerWrapper`.

    ###### Parameters

    - `cw`: @param cw The container to set design time for. `null` is legal will return `true` if there is at least one `ContainerWrapper` (or `null`) that have design time turned on.

    ###### Returns

    If design time is set for `cw`.

  - ### getDesignTimeEmptySize

    public static int getDesignTimeEmptySize()

    The size of an empty row or columns in a grid during design time.

    ###### Returns

    The number of pixels. Default is 15.

  - ### setDesignTimeEmptySize

    public static void setDesignTimeEmptySize(int pixels)

    The size of an empty row or columns in a grid during design time.

    ###### Parameters

    - `pixels`: @param pixels The number of pixels. Default is 0 (it was 15 prior to v3.7.2, but since that meant different behaviour under design time by default it was changed to be 0, same as non-design time). IDE vendors can still set it to 15 to get the old behaviour.

  - ### getSizeSafe

    public static int getSizeSafe(int[] sizes, int sizeType)

  - ### isLeftToRight

    public static boolean isLeftToRight(LC lc, ContainerWrapper container)

    Returns if left-to-right orientation is used. If not set explicitly in the layout constraints the Locale of the `parent` is used.

    ###### Parameters

    - `lc`: The constraint if there is one. Can be `null`.

    - `container`: The parent that may be used to get the left-to-right if ffc does not specify this.

    ###### Returns

    If left-to-right orientation is currently used.

  - ### setSerializedObject

    public static void setSerializedObject(Object caller, Object o)

    Sets the serialized object and associates it with `caller`.

    ###### Parameters

    - `caller`: The object created `o`

    - `o`: The just serialized object.

  - ### getSerializedObject

    public static Object getSerializedObject(Object caller)

    Returns the serialized object that are associated with `caller`. It also removes it from the list.

    ###### Parameters

    - `caller`: The original creator of the object.

    ###### Returns

    The object.