Class DirectionLayout

  • All Implemented Interfaces:
    java.awt.LayoutManager, java.awt.LayoutManager2

    public class DirectionLayout
    extends java.lang.Object
    implements java.awt.LayoutManager2
    • Field Detail

      • EMPTY_INSETS

        private static final java.awt.Insets EMPTY_INSETS
      • componentInsets

        private java.util.HashMap componentInsets
      • componentSpacing

        private int componentSpacing
      • compressing

        private boolean compressing
      • layoutOrderList

        private java.util.ArrayList layoutOrderList
    • Constructor Detail

      • DirectionLayout

        public DirectionLayout()
      • DirectionLayout

        public DirectionLayout​(int componentSpacing)
      • DirectionLayout

        public DirectionLayout​(Direction direction)
      • DirectionLayout

        public DirectionLayout​(Direction direction,
                               int componentSpacing)
    • Method Detail

      • getComponentSpacing

        public int getComponentSpacing()
      • setComponentSpacing

        public void setComponentSpacing​(int componentSpacing)
      • addLayoutComponent

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

        public Direction getDirection()
      • setDirection

        public void setDirection​(Direction direction)
      • isVertical

        public boolean isVertical()
      • isCompressing

        public boolean isCompressing()
      • setCompressing

        public void setCompressing​(boolean compressing)
      • setLayoutOrderList

        public void setLayoutOrderList​(java.util.ArrayList layoutOrderList)
      • getSize

        private int getSize​(java.awt.Dimension d)
      • getBeforeSpacing

        private static int getBeforeSpacing​(java.awt.Insets insets)
      • getAfterSpacing

        private int getAfterSpacing​(java.awt.Component component,
                                    boolean isLast)
      • createSize

        private java.awt.Dimension createSize​(int size,
                                              int otherSize)
      • getSize

        private static java.awt.Dimension getSize​(java.awt.Dimension interiorSize,
                                                  java.awt.Container component)
      • getOtherSize

        private int getOtherSize​(java.awt.Dimension dim)
      • setSize

        private void setSize​(java.awt.Component component,
                             int size,
                             int otherSize)
      • layoutContainer

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

        public void setComponentInsets​(java.awt.Component c,
                                       java.awt.Insets i)
      • getVisibleChildren

        private java.awt.Component[] getVisibleChildren​(java.awt.Container parent)
      • getSpacing

        private int getSpacing​(java.awt.Component component,
                               boolean isLast)
      • getInsets

        private java.awt.Insets getInsets​(java.awt.Component component)
      • minimumLayoutSize

        public java.awt.Dimension minimumLayoutSize​(java.awt.Container parent)
        Specified by:
        minimumLayoutSize in interface java.awt.LayoutManager
      • 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 constraints)
        Specified by:
        addLayoutComponent in interface java.awt.LayoutManager2
      • getLayoutAlignmentX

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

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

        public void invalidateLayout​(java.awt.Container target)
        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