Class OptionsPanel.RoundedLineBorder

  • All Implemented Interfaces:
    javax.swing.border.Border
    Enclosing class:
    OptionsPanel

    public static class OptionsPanel.RoundedLineBorder
    extends java.lang.Object
    implements javax.swing.border.Border
    The border used for boxes when OptionsPanel.beginBorderedGroup(String, boolean). It has rounded corners, and an optional title label.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.awt.Color borderColor
      The color of the lines on a RoundedLineBorder.
      static int CORNER_WIDTH
      The roundedness of the corners of the border.
      static java.awt.Color labelColor
      The color of labels that appear as part of the border
    • Constructor Summary

      Constructors 
      Constructor Description
      RoundedLineBorder​(java.lang.String labelText, boolean headless)
      Constructs a new SimpleLineBorder.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void drawBorderForTopComponent​(java.awt.Component componentToDrawOn, java.awt.Component componentToDrawUnder, java.awt.Graphics graphics)
      For a headless line border, draws the border for the top component (placed directly above the component with the line border, e.g.
      java.awt.Insets getBorderInsets​(java.awt.Component c)  
      java.lang.String getLabel()
      Get the label displayed in the top-left of the border.
      boolean isBorderOpaque()  
      void paintBorder​(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)  
      OptionsPanel.RoundedLineBorder setInsets​(java.awt.Insets insets)
      Set the inserts to use.
      • Methods inherited from class java.lang.Object

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

      • borderColor

        public static final java.awt.Color borderColor
        The color of the lines on a RoundedLineBorder.
      • labelColor

        public static final java.awt.Color labelColor
        The color of labels that appear as part of the border
        Since:
        API 4.202000 (Geneious 2020.0.0)
      • CORNER_WIDTH

        public static final int CORNER_WIDTH
        The roundedness of the corners of the border.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RoundedLineBorder

        public RoundedLineBorder​(java.lang.String labelText,
                                 boolean headless)
        Constructs a new SimpleLineBorder.
        Parameters:
        labelText - The text for an optional label that appears in the top left of the border (pass in null to have no label)
        headless - Pass in true to not draw the top of the border (the sides will extend all the way to the top of the component). See drawBorderForTopComponent(java.awt.Component, java.awt.Component, java.awt.Graphics) to draw the top of the border. No label will be drawn in a headless border.
    • Method Detail

      • drawBorderForTopComponent

        public static void drawBorderForTopComponent​(java.awt.Component componentToDrawOn,
                                                     java.awt.Component componentToDrawUnder,
                                                     java.awt.Graphics graphics)
        For a headless line border, draws the border for the top component (placed directly above the component with the line border, e.g. NORTH in a border layout)
        Parameters:
        componentToDrawOn - the top component (placed directly above the component with the line border, e.g. NORTH in a border layout)
        componentToDrawUnder - a child component of componentToDrawOn which the border should be drawn underneath. May be null to indicate no component.
        graphics - the graphics to draw to.
      • setInsets

        public OptionsPanel.RoundedLineBorder setInsets​(java.awt.Insets insets)
        Set the inserts to use. The default insets are (5,7,5,7) or (20,7,5,7) if labelText!=null.
        Parameters:
        insets - the inserts to use.
        Returns:
        this for convenience. e.g. setBorder(new RoundedLineBorder(...).setInsets(new Insets(...)))
      • getLabel

        public java.lang.String getLabel()
        Get the label displayed in the top-left of the border.
        Returns:
        the label displayed in the top-left of the border.
      • paintBorder

        public void paintBorder​(java.awt.Component c,
                                java.awt.Graphics g,
                                int x,
                                int y,
                                int width,
                                int height)
        Specified by:
        paintBorder in interface javax.swing.border.Border
      • getBorderInsets

        public java.awt.Insets getBorderInsets​(java.awt.Component c)
        Specified by:
        getBorderInsets in interface javax.swing.border.Border
      • isBorderOpaque

        public boolean isBorderOpaque()
        Specified by:
        isBorderOpaque in interface javax.swing.border.Border