Class AbsoluteLayout

java.lang.Object
com.googlecode.lanterna.gui2.AbsoluteLayout
All Implemented Interfaces:
LayoutManager

public class AbsoluteLayout extends Object implements LayoutManager
Layout manager that places components where they are manually specified to be and sizes them to the size they are manually assigned to. When using the AbsoluteLayout, please use setPosition(..) and setSize(..) manually on each component to choose where to place them. Components that have not had their position and size explicitly set will not be visible.
  • Constructor Details

    • AbsoluteLayout

      public AbsoluteLayout()
  • Method Details

    • getPreferredSize

      public TerminalSize getPreferredSize(List<Component> components)
      Description copied from interface: LayoutManager
      This method returns the dimensions it would prefer to have to be able to layout all components while giving all of them as much space as they are asking for.
      Specified by:
      getPreferredSize in interface LayoutManager
      Parameters:
      components - List of components
      Returns:
      Size the layout manager would like to have
    • doLayout

      public void doLayout(TerminalSize area, List<Component> components)
      Description copied from interface: LayoutManager
      Given a size constraint, update the location and size of each component in the component list by laying them out in the available area. This method will call setPosition(..) and setSize(..) on the Components.
      Specified by:
      doLayout in interface LayoutManager
      Parameters:
      area - Size available to this layout manager to lay out the components on
      components - List of components to lay out
    • hasChanged

      public boolean hasChanged()
      Description copied from interface: LayoutManager
      Returns true if the internal state of this LayoutManager has changed since the last call to doLayout. This will tell the container that it needs to call doLayout again.
      Specified by:
      hasChanged in interface LayoutManager
      Returns:
      true if this layout manager's internal state has changed since the last call to doLayout