# Class CoordinateLayout

java.lang.Object
com.codename1.ui.layouts.Layout
com.codename1.ui.layouts.CoordinateLayout

public class CoordinateLayout extends Layout
Allows laying out components based on absolute positions/sizes that are adapted based on available space for the layout. The layout

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CoordinateLayout()`
  Allows creating a coordinate layouts that disables the scaling feature
  `CoordinateLayout(int width, int height)`
  This constructor accepts the relative width and height used to define the aspect ratio of the Container
  `CoordinateLayout(Dimension d)`
  This constructor accepts the relative width and height used to define the aspect ratio of the Container

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Dimension`
  `getPreferredSize(Container parent)`
  Returns the container preferred size
  `boolean`
  `isOverlapSupported()`
  This method returns true if the Layout allows Components to Overlap.
  `void`
  `layoutContainer(Container parent)`
  Layout the given parent container children

  ### Methods inherited from class Layout

  `addLayoutComponent, cloneConstraint, equals, getChildrenInTraversalOrder, getComponentConstraint, hashCode, isConstraintTracking, obscuresPotential, overridesTabIndices, removeLayoutComponent, updateTabIndices`
  Modifier and Type
  Method
  Description
  `void`
  `addLayoutComponent(Object value, Component comp, Container c)`
  Some layouts can optionally track the addition of elements with meta-data that allows the user to "hint" on object positioning.
  `Object`
  `cloneConstraint(Object constraint)`
  `boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `protected Component[]`
  `getChildrenInTraversalOrder(Container parent)`
  Gets the children of the parent container in the order that they should be traversed when tabbing through a form.
  `Object`
  `getComponentConstraint(Component comp)`
  Returns the optional component constraint
  `int`
  `hashCode()`
  Returns a hash code value for the object.
  `boolean`
  `isConstraintTracking()`
  If this method returns true, the addLayoutComponent method will be called when replacing a layout for every component within the container
  `boolean`
  `obscuresPotential(Container parent)`
  Some layout managers can obscure their child components in some cases this returns true if the basic underpinnings are in place for that.
  `boolean`
  `overridesTabIndices(Container parent)`
  If a layout specifies a different traversal order of its components than the component index, then it should override this method to return true, and it should also override `#getChildrenInTraversalOrder(com.codename1.ui.Container)` to set the tab indices of a container's children.
  `void`
  `removeLayoutComponent(Component comp)`
  Removes the component from the layout this operation is only useful if the layout maintains references to components within it
  `final int`
  `updateTabIndices(Container parent, int offset)`
  Updates the tab traversal order

  ### Methods inherited from class Object

  `clone, getClass, notify, notifyAll, toString, wait, wait, wait`
  Modifier and Type
  Method
  Description
  `protected Object`
  `clone()`
  `final Class`
  `getClass()`
  Returns the runtime class of an object.
  `final void`
  `notify()`
  Wakes up a single thread that is waiting on this object's monitor.
  `final void`
  `notifyAll()`
  Wakes up all threads that are waiting on this object's monitor.
  `String`
  `toString()`
  Returns a string representation of the object.
  `final void`
  `wait()`
  Causes current thread to wait until another thread invokes the method or the method for this object.
  `final void`
  `wait(long timeout)`
  Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.
  `final void`
  `wait(long timeout, int nanos)`
  Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.

- ## Constructor Details

  - ### CoordinateLayout

    public CoordinateLayout()
    Allows creating a coordinate layouts that disables the scaling feature

  - ### CoordinateLayout

    public CoordinateLayout(int width, int height)

    This constructor accepts the relative width and height used to define the aspect ratio of the Container

    ###### Parameters

    - `width`

    - `height`

  - ### CoordinateLayout

    public CoordinateLayout(Dimension d)

    This constructor accepts the relative width and height used to define the aspect ratio of the Container

    ###### Parameters

    - `d`: the width/height

- ## Method Details

  - ### layoutContainer

    public void layoutContainer(Container parent)

    Layout the given parent container children

    ###### Parameters

    - `parent`: the given parent container
    Specified by:
      `layoutContainer` in class `Layout`

  - ### getPreferredSize

    public Dimension getPreferredSize(Container parent)

    Returns the container preferred size

    ###### Parameters

    - `parent`: the parent container

    ###### Returns

    the container preferred size

    Specified by:
      `getPreferredSize` in class `Layout`

  - ### isOverlapSupported

    public boolean isOverlapSupported()

    This method returns true if the Layout allows Components to Overlap.

    ###### Returns

    true if Components may intersect in this layout

    Overrides:
      `isOverlapSupported` in class `Layout`