Class CapsuleBorder

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.border.Border

    public class CapsuleBorder
    extends javax.swing.border.AbstractBorder
    Draws a border with a horizontal capsule shape, rounded on the ends and with an optional thin border along the top and/or bottom.
    Since:
    3.0
    Author:
    Chris Jennings
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      CapsuleBorder()  
      CapsuleBorder​(int top, int bottom, int capWidth)  
      CapsuleBorder​(java.awt.Paint borderPaint, java.awt.Paint capPaint)  
      CapsuleBorder​(java.awt.Paint borderPaint, java.awt.Paint capPaint, int top, int bottom, int capWidth)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Insets getBorderInsets​(java.awt.Component c)  
      java.awt.Insets getBorderInsets​(java.awt.Component c, java.awt.Insets insets)  
      java.awt.Paint getBorderPaint()  
      int getBottom()  
      java.awt.Paint getCapPaint()  
      int getCapWidth()  
      int getTop()  
      boolean isBorderOpaque()  
      void paintBorder​(java.awt.Component c, java.awt.Graphics g1, int x, int y, int width, int height)  
      void setBorderPaint​(java.awt.Paint borderPaint)  
      void setBottom​(int bottom)  
      void setCapPaint​(java.awt.Paint capPaint)  
      void setCapWidth​(int capWidth)  
      void setTop​(int top)  
      • Methods inherited from class javax.swing.border.AbstractBorder

        getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle
      • Methods inherited from class java.lang.Object

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

      • CapsuleBorder

        public CapsuleBorder()
      • CapsuleBorder

        public CapsuleBorder​(int top,
                             int bottom,
                             int capWidth)
      • CapsuleBorder

        public CapsuleBorder​(java.awt.Paint borderPaint,
                             java.awt.Paint capPaint)
      • CapsuleBorder

        public CapsuleBorder​(java.awt.Paint borderPaint,
                             java.awt.Paint capPaint,
                             int top,
                             int bottom,
                             int capWidth)
    • Method Detail

      • getBorderInsets

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

        public java.awt.Insets getBorderInsets​(java.awt.Component c,
                                               java.awt.Insets insets)
        Overrides:
        getBorderInsets in class javax.swing.border.AbstractBorder
      • isBorderOpaque

        public boolean isBorderOpaque()
        Specified by:
        isBorderOpaque in interface javax.swing.border.Border
        Overrides:
        isBorderOpaque in class javax.swing.border.AbstractBorder
      • paintBorder

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

        public int getCapWidth()
      • setCapWidth

        public void setCapWidth​(int capWidth)
      • getCapPaint

        public java.awt.Paint getCapPaint()
      • setCapPaint

        public void setCapPaint​(java.awt.Paint capPaint)
      • getBorderPaint

        public java.awt.Paint getBorderPaint()
      • setBorderPaint

        public void setBorderPaint​(java.awt.Paint borderPaint)
      • getTop

        public int getTop()
      • setTop

        public void setTop​(int top)
      • getBottom

        public int getBottom()
      • setBottom

        public void setBottom​(int bottom)