Class FixedCenterLayout

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

    public class FixedCenterLayout
    extends java.lang.Object
    implements java.awt.LayoutManager2, java.io.Serializable
    Fixed Center layout.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.awt.Component center  
      protected java.awt.Component east  
      protected int hgap  
      protected java.awt.Component west  
    • Constructor Summary

      Constructors 
      Constructor Description
      FixedCenterLayout()
      Constructs a new layout with no gap between components.
      FixedCenterLayout​(int hgap)
      Constructs a layout with the specified gaps between components.
    • Method Summary

      Modifier and Type Method Description
      void addLayoutComponent​(java.awt.Component comp, java.lang.Object constraints)
      Adds the specified component to the layout.
      void addLayoutComponent​(java.lang.String name, java.awt.Component comp)
      We are forced to support it by LayoutManager.
      int getHgap()
      Returns the horizontal gap between components.
      float getLayoutAlignmentX​(java.awt.Container parent)
      Returns the alignment along the x axis.
      float getLayoutAlignmentY​(java.awt.Container parent)
      Returns the alignment along the y axis.
      void invalidateLayout​(java.awt.Container target)
      Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
      void layoutContainer​(java.awt.Container target)
      Lays out the target argument using this layout.
      java.awt.Dimension maximumLayoutSize​(java.awt.Container target)
      Determines the maximum size of the target.
      java.awt.Dimension minimumLayoutSize​(java.awt.Container target)
      Determines the minimum size of the target.
      java.awt.Dimension preferredLayoutSize​(java.awt.Container target)
      Determines the preferred size of the target.
      void removeLayoutComponent​(java.awt.Component component)
      Removes the specified component from this layout.
      void setHgap​(int hgap)
      Sets the horizontal gap between components.
      java.lang.String toString()
      Returns a string representation of the state of this layout.
      • Methods inherited from class java.lang.Object

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

      • hgap

        protected int hgap
      • west

        protected java.awt.Component west
      • east

        protected java.awt.Component east
      • center

        protected java.awt.Component center
    • Constructor Detail

      • FixedCenterLayout

        public FixedCenterLayout()
        Constructs a new layout with no gap between components.
      • FixedCenterLayout

        public FixedCenterLayout​(int hgap)
        Constructs a layout with the specified gaps between components.
        Parameters:
        hgap - number
    • Method Detail

      • getHgap

        public int getHgap()
        Returns the horizontal gap between components.
        Returns:
        numnber
      • setHgap

        public void setHgap​(int hgap)
        Sets the horizontal gap between components.
        Parameters:
        hgap - number
      • addLayoutComponent

        public void addLayoutComponent​(java.awt.Component comp,
                                       java.lang.Object constraints)
        Adds the specified component to the layout.
        Specified by:
        addLayoutComponent in interface java.awt.LayoutManager2
        Parameters:
        comp - component
        constraints - object
      • addLayoutComponent

        public void addLayoutComponent​(java.lang.String name,
                                       java.awt.Component comp)
        We are forced to support it by LayoutManager.
        Specified by:
        addLayoutComponent in interface java.awt.LayoutManager
        Parameters:
        name - string
        comp - component
      • removeLayoutComponent

        public void removeLayoutComponent​(java.awt.Component component)
        Removes the specified component from this layout.
        Specified by:
        removeLayoutComponent in interface java.awt.LayoutManager
        Parameters:
        component - component
      • minimumLayoutSize

        public java.awt.Dimension minimumLayoutSize​(java.awt.Container target)
        Determines the minimum size of the target.
        Specified by:
        minimumLayoutSize in interface java.awt.LayoutManager
        Parameters:
        target - container
        Returns:
        dimension
      • preferredLayoutSize

        public java.awt.Dimension preferredLayoutSize​(java.awt.Container target)
        Determines the preferred size of the target.
        Specified by:
        preferredLayoutSize in interface java.awt.LayoutManager
        Parameters:
        target - container
        Returns:
        dimension
      • maximumLayoutSize

        public java.awt.Dimension maximumLayoutSize​(java.awt.Container target)
        Determines the maximum size of the target.
        Specified by:
        maximumLayoutSize in interface java.awt.LayoutManager2
        Parameters:
        target - container
        Returns:
        dimension
      • getLayoutAlignmentX

        public float getLayoutAlignmentX​(java.awt.Container parent)
        Returns the alignment along the x axis.
        Specified by:
        getLayoutAlignmentX in interface java.awt.LayoutManager2
        Parameters:
        parent - container
        Returns:
        float
      • getLayoutAlignmentY

        public float getLayoutAlignmentY​(java.awt.Container parent)
        Returns the alignment along the y axis.
        Specified by:
        getLayoutAlignmentY in interface java.awt.LayoutManager2
        Parameters:
        parent - container
        Returns:
        float
      • invalidateLayout

        public void invalidateLayout​(java.awt.Container target)
        Invalidates the layout, indicating that if the layout manager has cached information it should be discarded.
        Specified by:
        invalidateLayout in interface java.awt.LayoutManager2
        Parameters:
        target - container
      • layoutContainer

        public void layoutContainer​(java.awt.Container target)
        Lays out the target argument using this layout.
        Specified by:
        layoutContainer in interface java.awt.LayoutManager
        Parameters:
        target - container
      • toString

        public java.lang.String toString()
        Returns a string representation of the state of this layout.
        Overrides:
        toString in class java.lang.Object
        Returns:
        string