Module org.jcommon

Class WrapLayout

    • Constructor Detail

      • WrapLayout

        public WrapLayout()
        Constructs a new WrapLayout with a left alignment and a default 5-unit horizontal and vertical gap.
      • WrapLayout

        public WrapLayout​(int align,
                          int hgap,
                          int vgap)
        Creates a new flow layout manager with the indicated alignment and the indicated horizontal and vertical gaps.

        The value of the alignment argument must be one of FlowLayout.LEFT, FlowLayout.RIGHT, FlowLayout.CENTER, FlowLayout.LEADING or FlowLayout.TRAILING

        Parameters:
        align - the alignment value.
        hgap - the horizontal gap between components.
        vgap - the vertical gap between components.
    • Method Detail

      • preferredLayoutSize

        public Dimension preferredLayoutSize​(Container target)
        Returns the preferred dimensions for this layout given the visible components in the specified target container.
        Specified by:
        preferredLayoutSize in interface LayoutManager
        Overrides:
        preferredLayoutSize in class FlowLayout
        Parameters:
        target - the component which needs to be laid out
        Returns:
        the preferred dimensions to lay out the subcomponents of the specified container
      • minimumLayoutSize

        public Dimension minimumLayoutSize​(Container target)
        Returns the minimum dimensions needed to layout the visible components contained in the specified target container.
        Specified by:
        minimumLayoutSize in interface LayoutManager
        Overrides:
        minimumLayoutSize in class FlowLayout
        Parameters:
        target - the component which needs to be laid out
        Returns:
        the minimum dimensions to lay out the subcomponents of the specified container