Class Borders


  • public class Borders
    extends java.lang.Object
    This class containers a couple of border implementation and utility methods for instantiating them. It also contains a utility method for joining border line graphics together with adjacent lines so they blend in together: joinLinesWithFrame(..).
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Borders()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Border doubleLine()
      Creates a Border that is drawn as a solid color double line surrounding the wrapped component
      static Border doubleLine​(java.lang.String title)
      Creates a Border that is drawn as a solid color double line surrounding the wrapped component with a title string normally drawn at the top-left side
      static Border doubleLineBevel()
      Creates a Border that is drawn as a bevel color double line surrounding the wrapped component
      static Border doubleLineBevel​(java.lang.String title)
      Creates a Border that is drawn as a bevel color double line surrounding the wrapped component with a title string normally drawn at the top-left side
      static Border doubleLineReverseBevel()
      Creates a Border that is drawn as a reverse bevel color double line surrounding the wrapped component
      static Border doubleLineReverseBevel​(java.lang.String title)
      Creates a Border that is drawn as a reverse bevel color double line surrounding the wrapped component with a title string normally drawn at the top-left side
      static void joinLinesWithFrame​(TextGraphics graphics)
      This method will attempt to join line drawing characters with the outermost bottom and top rows and left and right columns.
      static Border singleLine()
      Creates a Border that is drawn as a solid color single line surrounding the wrapped component
      static Border singleLine​(java.lang.String title)
      Creates a Border that is drawn as a solid color single line surrounding the wrapped component with a title string normally drawn at the top-left side
      static Border singleLineBevel()
      Creates a Border that is drawn as a bevel color single line surrounding the wrapped component
      static Border singleLineBevel​(java.lang.String title)
      Creates a Border that is drawn as a bevel color single line surrounding the wrapped component with a title string normally drawn at the top-left side
      static Border singleLineReverseBevel()
      Creates a Border that is drawn as a reverse bevel color single line surrounding the wrapped component
      static Border singleLineReverseBevel​(java.lang.String title)
      Creates a Border that is drawn as a reverse bevel color single line surrounding the wrapped component with a title string normally drawn at the top-left side
      • Methods inherited from class java.lang.Object

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

      • Borders

        private Borders()
    • Method Detail

      • singleLine

        public static Border singleLine()
        Creates a Border that is drawn as a solid color single line surrounding the wrapped component
        Returns:
        New solid color single line Border
      • singleLine

        public static Border singleLine​(java.lang.String title)
        Creates a Border that is drawn as a solid color single line surrounding the wrapped component with a title string normally drawn at the top-left side
        Parameters:
        title - The title to draw on the border
        Returns:
        New solid color single line Border with a title
      • singleLineBevel

        public static Border singleLineBevel()
        Creates a Border that is drawn as a bevel color single line surrounding the wrapped component
        Returns:
        New bevel color single line Border
      • singleLineBevel

        public static Border singleLineBevel​(java.lang.String title)
        Creates a Border that is drawn as a bevel color single line surrounding the wrapped component with a title string normally drawn at the top-left side
        Parameters:
        title - The title to draw on the border
        Returns:
        New bevel color single line Border with a title
      • singleLineReverseBevel

        public static Border singleLineReverseBevel()
        Creates a Border that is drawn as a reverse bevel color single line surrounding the wrapped component
        Returns:
        New reverse bevel color single line Border
      • singleLineReverseBevel

        public static Border singleLineReverseBevel​(java.lang.String title)
        Creates a Border that is drawn as a reverse bevel color single line surrounding the wrapped component with a title string normally drawn at the top-left side
        Parameters:
        title - The title to draw on the border
        Returns:
        New reverse bevel color single line Border with a title
      • doubleLine

        public static Border doubleLine()
        Creates a Border that is drawn as a solid color double line surrounding the wrapped component
        Returns:
        New solid color double line Border
      • doubleLine

        public static Border doubleLine​(java.lang.String title)
        Creates a Border that is drawn as a solid color double line surrounding the wrapped component with a title string normally drawn at the top-left side
        Parameters:
        title - The title to draw on the border
        Returns:
        New solid color double line Border with a title
      • doubleLineBevel

        public static Border doubleLineBevel()
        Creates a Border that is drawn as a bevel color double line surrounding the wrapped component
        Returns:
        New bevel color double line Border
      • doubleLineBevel

        public static Border doubleLineBevel​(java.lang.String title)
        Creates a Border that is drawn as a bevel color double line surrounding the wrapped component with a title string normally drawn at the top-left side
        Parameters:
        title - The title to draw on the border
        Returns:
        New bevel color double line Border with a title
      • doubleLineReverseBevel

        public static Border doubleLineReverseBevel()
        Creates a Border that is drawn as a reverse bevel color double line surrounding the wrapped component
        Returns:
        New reverse bevel color double line Border
      • doubleLineReverseBevel

        public static Border doubleLineReverseBevel​(java.lang.String title)
        Creates a Border that is drawn as a reverse bevel color double line surrounding the wrapped component with a title string normally drawn at the top-left side
        Parameters:
        title - The title to draw on the border
        Returns:
        New reverse bevel color double line Border with a title
      • joinLinesWithFrame

        public static void joinLinesWithFrame​(TextGraphics graphics)
        This method will attempt to join line drawing characters with the outermost bottom and top rows and left and right columns. For example, if a vertical left border character is ║ and the character immediately to the right of it is ─, then the border character will be updated to ╟ to join the two together. Please note that this method will only join the outer border columns and rows.
        Parameters:
        graphics - Graphics to use when inspecting and joining characters