Class LineLayout

java.lang.Object
mgui.interfaces.layouts.LineLayout
All Implemented Interfaces:
java.awt.LayoutManager, java.awt.LayoutManager2, java.io.Serializable
Direct Known Subclasses:
CategoryLayout

public class LineLayout
extends java.lang.Object
implements java.awt.LayoutManager2, java.io.Serializable
Layout which provides a basic functionality for rendering components on horizontal lines. Uses LineLayoutConstraints to specify line height, gap height, and preferred width.
Since:
1.0
Version:
1.0
Author:
Andrew Reid
See Also:
Serialized Form
  • Field Details

    • lineHeight

      public int lineHeight
    • lineGap

      public int lineGap
    • lineWidth

      public int lineWidth
    • preferredSize

      public java.awt.Dimension preferredSize
    • minimumSize

      public java.awt.Dimension minimumSize
    • maximumSize

      public java.awt.Dimension maximumSize
    • constraints

      public java.util.ArrayList<LineLayoutConstraints> constraints
    • components

      public java.util.ArrayList<java.awt.Component> components
    • flexible_component

      protected java.awt.Component flexible_component
  • Constructor Details

    • LineLayout

      public LineLayout()
    • LineLayout

      public LineLayout​(int height, int gap, int width)
      Construct a new LineLayout with the given dimensions
      Parameters:
      height -
      gap -
      width -
  • Method Details

    • addLayoutComponent

      public void addLayoutComponent​(java.lang.String str, java.awt.Component comp)
      Specified by:
      addLayoutComponent in interface java.awt.LayoutManager
    • setFlexibleComponent

      public void setFlexibleComponent​(java.awt.Component c)
      Sets the flexible component for this layout; this component is stretched vertically when the layout is larger than is total line + gap height, to fill the extra space. A value of null unsets the flexible component.
      Parameters:
      c -
    • layoutContainer

      public void layoutContainer​(java.awt.Container parent)
      Specified by:
      layoutContainer in interface java.awt.LayoutManager
    • minimumLayoutSize

      public java.awt.Dimension minimumLayoutSize​(java.awt.Container arg0)
      Specified by:
      minimumLayoutSize in interface java.awt.LayoutManager
    • setPreferredSize

      public void setPreferredSize​(java.awt.Dimension size)
    • preferredLayoutSize

      public java.awt.Dimension preferredLayoutSize​(java.awt.Container parent)
      Specified by:
      preferredLayoutSize in interface java.awt.LayoutManager
    • removeLayoutComponent

      public void removeLayoutComponent​(java.awt.Component comp)
      Specified by:
      removeLayoutComponent in interface java.awt.LayoutManager
    • addLayoutComponent

      public void addLayoutComponent​(java.awt.Component comp, java.lang.Object cons)
      Specified by:
      addLayoutComponent in interface java.awt.LayoutManager2
    • getLayoutAlignmentX

      public float getLayoutAlignmentX​(java.awt.Container parent)
      Specified by:
      getLayoutAlignmentX in interface java.awt.LayoutManager2
    • getLayoutAlignmentY

      public float getLayoutAlignmentY​(java.awt.Container parent)
      Specified by:
      getLayoutAlignmentY in interface java.awt.LayoutManager2
    • invalidateLayout

      public void invalidateLayout​(java.awt.Container parent)
      Specified by:
      invalidateLayout in interface java.awt.LayoutManager2
    • maximumLayoutSize

      public java.awt.Dimension maximumLayoutSize​(java.awt.Container parent)
      Specified by:
      maximumLayoutSize in interface java.awt.LayoutManager2