Class PartialLineBorder

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

    public class PartialLineBorder
    extends javax.swing.border.LineBorder
    implements PartialSide
    This is a better version of LineBorder which allows you to show line only at one side or several sides and supports rounded corner.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      PartialLineBorder​(java.awt.Color color)  
      PartialLineBorder​(java.awt.Color color, int thickness)  
      PartialLineBorder​(java.awt.Color color, int thickness, boolean roundedCorners)  
      PartialLineBorder​(java.awt.Color color, int thickness, boolean roundedCorners, int roundedCornerSize)  
      PartialLineBorder​(java.awt.Color color, int thickness, int side)  
    • 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)  
      int getRoundedCornerSize()  
      int getSides()  
      void paintBorder​(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)  
      void setRoundedCornerSize​(int roundedCornerSize)  
      void setSides​(int sides)  
      • Methods inherited from class javax.swing.border.LineBorder

        createBlackLineBorder, createGrayLineBorder, getLineColor, getRoundedCorners, getThickness, isBorderOpaque
      • 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

      • PartialLineBorder

        public PartialLineBorder​(java.awt.Color color)
      • PartialLineBorder

        public PartialLineBorder​(java.awt.Color color,
                                 int thickness)
      • PartialLineBorder

        public PartialLineBorder​(java.awt.Color color,
                                 int thickness,
                                 boolean roundedCorners)
      • PartialLineBorder

        public PartialLineBorder​(java.awt.Color color,
                                 int thickness,
                                 boolean roundedCorners,
                                 int roundedCornerSize)
      • PartialLineBorder

        public PartialLineBorder​(java.awt.Color color,
                                 int thickness,
                                 int side)
    • Method Detail

      • getSides

        public int getSides()
      • setSides

        public void setSides​(int sides)
      • getRoundedCornerSize

        public int getRoundedCornerSize()
      • setRoundedCornerSize

        public void setRoundedCornerSize​(int roundedCornerSize)
      • 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
        Overrides:
        paintBorder in class javax.swing.border.LineBorder
      • 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.LineBorder