Class OutlineHighlightPainter

  • All Implemented Interfaces:
    javax.swing.text.Highlighter.HighlightPainter

    class OutlineHighlightPainter
    extends javax.swing.text.DefaultHighlighter.DefaultHighlightPainter
    Highlight painter that draws an outline around the text. This is used to draw bounds around function/method parameters.
    Version:
    1.0
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.awt.Color color
      DefaultHighlightPainter doesn't allow changing color, so we must cache ours here.
    • Constructor Summary

      Constructors 
      Constructor Description
      OutlineHighlightPainter​(java.awt.Color color)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Color getColor()
      Returns the color to paint bounding boxes with.
      java.awt.Shape paintLayer​(java.awt.Graphics g, int p0, int p1, java.awt.Shape viewBounds, javax.swing.text.JTextComponent c, javax.swing.text.View view)  
      void setColor​(java.awt.Color color)
      Sets the color to paint the bounding boxes with.
      • Methods inherited from class javax.swing.text.DefaultHighlighter.DefaultHighlightPainter

        paint
      • Methods inherited from class java.lang.Object

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

      • color

        private java.awt.Color color
        DefaultHighlightPainter doesn't allow changing color, so we must cache ours here.
    • Constructor Detail

      • OutlineHighlightPainter

        OutlineHighlightPainter​(java.awt.Color color)
        Constructor.
        Parameters:
        color - The color to draw the bounding boxes with. This cannot be null.
    • Method Detail

      • getColor

        public java.awt.Color getColor()
        Returns the color to paint bounding boxes with.
        Overrides:
        getColor in class javax.swing.text.DefaultHighlighter.DefaultHighlightPainter
        Returns:
        The color.
        See Also:
        setColor(Color)
      • paintLayer

        public java.awt.Shape paintLayer​(java.awt.Graphics g,
                                         int p0,
                                         int p1,
                                         java.awt.Shape viewBounds,
                                         javax.swing.text.JTextComponent c,
                                         javax.swing.text.View view)
        Overrides:
        paintLayer in class javax.swing.text.DefaultHighlighter.DefaultHighlightPainter
      • setColor

        public void setColor​(java.awt.Color color)
        Sets the color to paint the bounding boxes with.
        Parameters:
        color - The new color. This cannot be null.
        See Also:
        getColor()