Package jsyntaxpane

Class SyntaxStyles

java.lang.Object
jsyntaxpane.SyntaxStyles

public class SyntaxStyles extends Object
The Styles to use for each TokenType. The defaults are created here, and then the resource META-INF/services/syntaxstyles.properties is read and merged. You can also pass a properties instance and merge your prefered styles into the default styles. Text is drawn by forwarding the drawText request to the SyntaxStyle for the that matches the given TokenType
  • Field Details

    • STYLE_PATTERN

      public static final Pattern STYLE_PATTERN
  • Method Details

    • mergeStyles

      public void mergeStyles(Properties styles)
      You can call the mergeStyles method with a Properties file to customize the existing styles. Any existing styles will be overwritten by the styles you provide.
      Parameters:
      styles -
    • getInstance

      public static SyntaxStyles getInstance()
      Returns the Default Singleton
      Returns:
    • read

      public static SyntaxStyles read(Configuration config)
    • put

      public void put(TokenType type, SyntaxStyle style)
    • getStyle

      public SyntaxStyle getStyle(TokenType type)
      Return the style for the given TokenType
      Parameters:
      type -
      Returns:
    • drawText

      public int drawText(Segment segment, int x, int y, Graphics graphics, TabExpander e, Token token)
      Draw the given Token. This will simply find the proper SyntaxStyle for the TokenType and then asks the proper Style to draw the text of the Token.
      Parameters:
      segment -
      x -
      y -
      graphics -
      e -
      token -
      Returns: