Class Borders


  • public final class Borders
    extends java.lang.Object
    Provides constants and factory methods for Borders that use instances of ConstantSize to define the margins.

    Examples:

     Borders.DLU2_BORDER
     Borders.createEmptyBorder(Sizes.DLUY4, Sizes.DLUX2, Sizes.DLUY4, Sizes.DLUX2);
     Borders.createEmptyBorder("4dlu, 2dlu, 4dlu, 2dlu");
     
    Version:
    $Revision$
    Author:
    Karsten Lentzsch
    See Also:
    Border, Sizes
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Borders.EmptyBorder
      An empty border that uses 4 instances of ConstantSize to define the gaps on all sides.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static javax.swing.border.Border BUTTON_BAR_GAP_BORDER
      A standardized Border that describes the gap between a component and a button bar in its bottom.
      static javax.swing.border.Border DIALOG_BORDER
      A standardized Border that describes the border around a dialog content that has no tabs.
      static javax.swing.border.Border DLU14_BORDER
      A prepared Border with 14dlu on all sides.
      static javax.swing.border.Border DLU2_BORDER
      A prepared and reusable Border with 2dlu on all sides.
      static javax.swing.border.Border DLU4_BORDER
      A prepared and reusable Border with 4dlu on all sides.
      static javax.swing.border.Border DLU7_BORDER
      A prepared and reusable Border with 7dlu on all sides.
      static javax.swing.border.Border EMPTY_BORDER
      A prepared and reusable EmptyBorder without gaps.
      static javax.swing.border.Border TABBED_DIALOG_BORDER
      A standardized Border that describes the border around a dialog content that uses tabs.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.swing.border.Border createEmptyBorder​(ConstantSize top, ConstantSize left, ConstantSize bottom, ConstantSize right)
      Creates and returns an EmptyBorder with the specified gaps.
      static javax.swing.border.Border createEmptyBorder​(java.lang.String encodedSizes)
      Creates and returns a Border using sizes as specified by the given string.
      • Methods inherited from class java.lang.Object

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

      • EMPTY_BORDER

        public static final javax.swing.border.Border EMPTY_BORDER
        A prepared and reusable EmptyBorder without gaps.
      • DLU2_BORDER

        public static final javax.swing.border.Border DLU2_BORDER
        A prepared and reusable Border with 2dlu on all sides.
      • DLU4_BORDER

        public static final javax.swing.border.Border DLU4_BORDER
        A prepared and reusable Border with 4dlu on all sides.
      • DLU7_BORDER

        public static final javax.swing.border.Border DLU7_BORDER
        A prepared and reusable Border with 7dlu on all sides.
      • DLU14_BORDER

        public static final javax.swing.border.Border DLU14_BORDER
        A prepared Border with 14dlu on all sides.
      • BUTTON_BAR_GAP_BORDER

        public static final javax.swing.border.Border BUTTON_BAR_GAP_BORDER
        A standardized Border that describes the gap between a component and a button bar in its bottom.
      • DIALOG_BORDER

        public static final javax.swing.border.Border DIALOG_BORDER
        A standardized Border that describes the border around a dialog content that has no tabs.
        See Also:
        TABBED_DIALOG_BORDER
      • TABBED_DIALOG_BORDER

        public static final javax.swing.border.Border TABBED_DIALOG_BORDER
        A standardized Border that describes the border around a dialog content that uses tabs.
        See Also:
        DIALOG_BORDER
    • Method Detail

      • createEmptyBorder

        public static javax.swing.border.Border createEmptyBorder​(ConstantSize top,
                                                                  ConstantSize left,
                                                                  ConstantSize bottom,
                                                                  ConstantSize right)
        Creates and returns an EmptyBorder with the specified gaps.
        Parameters:
        top - the top gap
        left - the left-hand side gap
        bottom - the bottom gap
        right - the right-hand side gap
        Returns:
        an EmptyBorder with the specified gaps
        See Also:
        createEmptyBorder(String)
      • createEmptyBorder

        public static javax.swing.border.Border createEmptyBorder​(java.lang.String encodedSizes)
        Creates and returns a Border using sizes as specified by the given string. This string is a comma-separated encoding of 4 ConstantSizes.
        Parameters:
        encodedSizes - top, left, bottom, right gap encoded as String
        Returns:
        an EmptyBorder with the specified gaps
        See Also:
        createEmptyBorder(ConstantSize, ConstantSize, ConstantSize, ConstantSize)