Package jsyntaxpane

Class SyntaxStyle


  • public final class SyntaxStyle
    extends java.lang.Object
    This class represents the Style for a TokenType. This class is responsible for actually drawing a Token on the View.
    • Constructor Summary

      Constructors 
      Constructor Description
      SyntaxStyle()  
      SyntaxStyle​(java.awt.Color color, boolean bold, boolean italic)  
      SyntaxStyle​(java.awt.Color color, int fontStyle)  
      SyntaxStyle​(java.lang.String str)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int drawText​(javax.swing.text.Segment segment, int x, int y, java.awt.Graphics graphics, javax.swing.text.TabExpander e, int startOffset)
      Draw text.
      java.awt.Color getColor()  
      java.lang.String getColorString()  
      int getFontStyle()  
      boolean isBold()  
      java.lang.Boolean isItalic()  
      void setBold​(java.lang.Boolean bold)  
      void setColorString​(java.lang.String color)  
      void setItalic​(java.lang.Boolean italic)  
      • Methods inherited from class java.lang.Object

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

      • SyntaxStyle

        public SyntaxStyle()
      • SyntaxStyle

        public SyntaxStyle​(java.awt.Color color,
                           boolean bold,
                           boolean italic)
      • SyntaxStyle

        public SyntaxStyle​(java.awt.Color color,
                           int fontStyle)
      • SyntaxStyle

        public SyntaxStyle​(java.lang.String str)
    • Method Detail

      • isBold

        public boolean isBold()
      • setBold

        public void setBold​(java.lang.Boolean bold)
      • getColorString

        public java.lang.String getColorString()
      • setColorString

        public void setColorString​(java.lang.String color)
      • isItalic

        public java.lang.Boolean isItalic()
      • setItalic

        public void setItalic​(java.lang.Boolean italic)
      • getFontStyle

        public int getFontStyle()
      • getColor

        public java.awt.Color getColor()
      • drawText

        public int drawText​(javax.swing.text.Segment segment,
                            int x,
                            int y,
                            java.awt.Graphics graphics,
                            javax.swing.text.TabExpander e,
                            int startOffset)
        Draw text. This can directly call the Utilities.drawTabbedText. Sub-classes can override this method to provide any other decorations.
        Parameters:
        segment - - the source of the text
        x - - the X origin >= 0
        y - - the Y origin >= 0
        graphics - - the graphics context
        e - - how to expand the tabs. If this value is null, tabs will be expanded as a space character.
        startOffset - - starting offset of the text in the document >= 0
        Returns: