Class AlignLayout

  • All Implemented Interfaces:
    java.awt.LayoutManager, java.io.Serializable

    public class AlignLayout
    extends ENHGridLayout
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      AlignLayout()
      Creates an aligner layout with 2 columns, a variable number of rows, and a gap of 5 pixels.
      AlignLayout​(int cols, int hgap, int vgap)
      Creates an aligner layout with the specified number of columns and gaps.
    • Method Summary

      Modifier and Type Method Description
      int getLabelVerticalAlignment​(java.awt.Component child)
      Gets the vertical position of a label relative to its control.
      boolean getResizeHeight​(java.awt.Component child)
      Gets the component's RezizeHeight value.
      boolean getResizeWidth​(java.awt.Component child)
      Gets the component's RezizeWidth value.
      protected boolean isLabel​(int col)  
      protected void setBounds​(int pos, int row, int col, java.awt.Component comp, int x, int y, int col_width, int row_height)  
      void setLabelVerticalAlignment​(java.awt.Component child, int align)
      Sets the vertical position of a label relative to its control.
      void setResizeHeight​(java.awt.Component child, boolean v)
      Sets whether the control should be resized vertically to the height of the largest component in its row (default: false).
      void setResizeWidth​(java.awt.Component child, boolean v)
      Sets whether the control should be resized horizontally to its parent's right edge if it is in the last column (default: false).
      • Methods inherited from class java.awt.GridLayout

        addLayoutComponent, getColumns, getHgap, getRows, getVgap, removeLayoutComponent, setColumns, setHgap, setRows, setVgap, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • alignment

        protected java.util.Hashtable alignment
      • resize_width

        protected java.util.Hashtable resize_width
      • resize_height

        protected java.util.Hashtable resize_height
    • Constructor Detail

      • AlignLayout

        public AlignLayout()
        Creates an aligner layout with 2 columns, a variable number of rows, and a gap of 5 pixels.
      • AlignLayout

        public AlignLayout​(int cols,
                           int hgap,
                           int vgap)
        Creates an aligner layout with the specified number of columns and gaps.
        Parameters:
        cols - the number of columns (should be a multiple of 2)
        hgap - the horizontal gap variable
        vgap - the vertical gap variable
        Throws:
        java.lang.IllegalArgumentException - If the rows and columns are invalid.
    • Method Detail

      • getLabelVerticalAlignment

        public int getLabelVerticalAlignment​(java.awt.Component child)
        Gets the vertical position of a label relative to its control.
        Parameters:
        child - component
        Returns:
        number
      • setLabelVerticalAlignment

        public void setLabelVerticalAlignment​(java.awt.Component child,
                                              int align)
        Sets the vertical position of a label relative to its control.
        Parameters:
        child - component
        align - TOP, MIDDLE (default), or BOTTOM.
        Throws:
        java.lang.IllegalArgumentException - If an invalid value is set
      • getResizeWidth

        public boolean getResizeWidth​(java.awt.Component child)
        Gets the component's RezizeWidth value.
        Parameters:
        child - component
        Returns:
        flag
      • setResizeWidth

        public void setResizeWidth​(java.awt.Component child,
                                   boolean v)
        Sets whether the control should be resized horizontally to its parent's right edge if it is in the last column (default: false).
        Parameters:
        child - component
        v - flag
      • getResizeHeight

        public boolean getResizeHeight​(java.awt.Component child)
        Gets the component's RezizeHeight value.
        Parameters:
        child - component
        Returns:
        flag
      • setResizeHeight

        public void setResizeHeight​(java.awt.Component child,
                                    boolean v)
        Sets whether the control should be resized vertically to the height of the largest component in its row (default: false). This value is ignored for labels (the components in odd columns).
        Parameters:
        child - component
        v - flag
      • isLabel

        protected boolean isLabel​(int col)
      • setBounds

        protected void setBounds​(int pos,
                                 int row,
                                 int col,
                                 java.awt.Component comp,
                                 int x,
                                 int y,
                                 int col_width,
                                 int row_height)
        Overrides:
        setBounds in class ENHGridLayout