Class FramedLayout

java.lang.Object
com.blackrook.gui.layout.FramedLayout
All Implemented Interfaces:
GUILayout

public class FramedLayout extends Object implements GUILayout
A "framed" layout for GUIObjects similar to BorderLayout. This resizes the (up to) nine children of the object to which this layout is bound into a "frame" around the object with the FramedLayout.Attrib.CONTENT attribute.
Author:
Matthew Tropiano
  • Field Details

    • frameWidth

      protected float frameWidth
      Frame width in units.
    • topLeft

      protected GUIObject topLeft
      Top-left object lifted from resizeChild().
    • topCenter

      protected GUIObject topCenter
      Top-center object lifted from resizeChild().
    • topRight

      protected GUIObject topRight
      Top-right object lifted from resizeChild().
    • middleLeft

      protected GUIObject middleLeft
      Middle-left object lifted from resizeChild().
    • content

      protected GUIObject content
      Content object lifted from resizeChild().
    • middleRight

      protected GUIObject middleRight
      Middle-right object lifted from resizeChild().
    • bottomLeft

      protected GUIObject bottomLeft
      Bottom-left object lifted from resizeChild().
    • bottomCenter

      protected GUIObject bottomCenter
      Bottom-center object lifted from resizeChild().
    • bottomRight

      protected GUIObject bottomRight
      Bottom-right object lifted from resizeChild().
  • Constructor Details

    • FramedLayout

      public FramedLayout(float width)
      Creates a new FramedLayout.
      Parameters:
      width - the width/thickness of the frame edge in units.
  • Method Details

    • resizeChild

      public void resizeChild(GUIObject object, int index, int childTotal)
      Description copied from interface: GUILayout
      Called when a child object needs resizing. DO NOT RESIZE THE PARENT OBJECT IN THIS METHOD, AS IT MAY CAUSE AN INFINITE LOOP TO OCCUR.
      Specified by:
      resizeChild in interface GUILayout
      Parameters:
      object - the object to resize.
      index - the child index while traversing through the list of children.
      childTotal - the total number of children.
    • orientChildren

      protected void orientChildren()
      Once objects with the required attributes are found, this will resize and reposition them.