Class StrokedBorder

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

    public class StrokedBorder
    extends javax.swing.border.AbstractBorder
    A border that displays a dashed line around a component.
    Author:
    Chris Jennings
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      StrokedBorder()  
      StrokedBorder​(java.awt.Color strokeColor, float penSize, int cap, int join, float[] dashArray, float dashPhase)  
    • 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 getCap()  
      float[] getDashArray()  
      float getDashPhase()  
      int getJoin()  
      float getPenSize()  
      java.awt.Color getStrokeColor()  
      void paintBorder​(java.awt.Component c, java.awt.Graphics g1, int x, int y, int width, int height)  
      void setCap​(int cap)  
      void setDashArray​(float[] dashArray)
      Sets the dash array for the border; may be null for a solid line.
      void setDashPhase​(float dashPhase)  
      void setJoin​(int join)  
      void setPenSize​(float penSize)  
      void setStrokeColor​(java.awt.Color strokeColor)  
      • Methods inherited from class javax.swing.border.AbstractBorder

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

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

      • StrokedBorder

        public StrokedBorder()
      • StrokedBorder

        public StrokedBorder​(java.awt.Color strokeColor,
                             float penSize,
                             int cap,
                             int join,
                             float[] dashArray,
                             float dashPhase)
    • Method Detail

      • getDashArray

        public float[] getDashArray()
      • setDashArray

        public void setDashArray​(float[] dashArray)
        Sets the dash array for the border; may be null for a solid line.
        Parameters:
        dashArray -
      • getDashPhase

        public float getDashPhase()
      • setDashPhase

        public void setDashPhase​(float dashPhase)
      • getPenSize

        public float getPenSize()
      • setPenSize

        public void setPenSize​(float penSize)
      • getCap

        public int getCap()
      • setCap

        public void setCap​(int cap)
      • getJoin

        public int getJoin()
      • setJoin

        public void setJoin​(int join)
      • getStrokeColor

        public java.awt.Color getStrokeColor()
      • setStrokeColor

        public void setStrokeColor​(java.awt.Color strokeColor)
      • 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
      • 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