processing.app.syntax

## Class SyntaxUtilities

- Object
- - SyntaxUtilities

-     public class SyntaxUtilities
      extends Object

  Class with several utility functions used by jEdit's syntax colorizing subsystem.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `paintSyntaxLine(Segment line, Token tokens, SyntaxStyle[] styles, TabExpander expander, Graphics gfx, int x, int y)` Paints the specified line onto the graphics context.
    `static boolean` | `regionMatches(boolean ignoreCase, Segment text, int offset, char[] match)` Checks if a subregion of a `Segment` is equal to a character array.
    `static boolean` | `regionMatches(boolean ignoreCase, Segment text, int offset, String match)` Checks if a subregion of a `Segment` is equal to a string.

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### regionMatches

          public static boolean regionMatches(boolean ignoreCase,
                              Segment text,
                              int offset,
                              String match)

      Checks if a subregion of a `Segment` is equal to a string.
      Parameters:
        `ignoreCase` - True if case should be ignored, false otherwise
        `text` - The segment
        `offset` - The offset into the segment
        `match` - The string to match

    - #### regionMatches

          public static boolean regionMatches(boolean ignoreCase,
                              Segment text,
                              int offset,
                              char[] match)

      Checks if a subregion of a `Segment` is equal to a character array.
      Parameters:
        `ignoreCase` - True if case should be ignored, false otherwise
        `text` - The segment
        `offset` - The offset into the segment
        `match` - The character array to match

    - #### paintSyntaxLine

          public static int paintSyntaxLine(Segment line,
                            Token tokens,
                            SyntaxStyle[] styles,
                            TabExpander expander,
                            Graphics gfx,
                            int x,
                            int y)

      Paints the specified line onto the graphics context. Note that this method munges the offset and count values of the segment.
      Parameters:
        `line` - The line segment
        `tokens` - The token list for the line
        `styles` - The syntax style list
        `expander` - The tab expander used to determine tab stops. May be null
        `gfx` - The graphics context
        `x` - The x co-ordinate
        `y` - The y co-ordinate
      Returns:
        The x co-ordinate, plus the width of the painted string