Package mars.venus.editor.jeditsyntax
Class SyntaxUtilities
java.lang.Object
mars.venus.editor.jeditsyntax.SyntaxUtilities
Class with several utility functions used by jEdit's syntax colorizing
subsystem.
- Version:
- $Id: SyntaxUtilities.java,v 1.9 1999/12/13 03:40:30 sp Exp $
- Author:
- Slava Pestov
-
Method Summary
Modifier and TypeMethodDescriptionstatic SyntaxStyle[]
getCurrentSyntaxStyles
(Settings settings) Returns the CURRENT style table.static SyntaxStyle
Returns the default style table.static float
paintSyntaxLine
(Segment line, Token tokens, SyntaxStyle[] styles, TabExpander expander, Graphics graphics, float x, float 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 aSegment
is equal to a character array.static boolean
regionMatches
(boolean ignoreCase, Segment text, int offset, String match) Checks if a subregion of aSegment
is equal to a string.
-
Method Details
-
regionMatches
Checks if a subregion of aSegment
is equal to a string.- Parameters:
ignoreCase
- True if case should be ignored, false otherwisetext
- The segmentoffset
- The offset into the segmentmatch
- The string to match
-
regionMatches
Checks if a subregion of aSegment
is equal to a character array.- Parameters:
ignoreCase
- True if case should be ignored, false otherwisetext
- The segmentoffset
- The offset into the segmentmatch
- The character array to match
-
getDefaultSyntaxStyle
Returns the default style table. This can be passed to thesetStyles()
method ofSyntaxDocument
to use the default syntax styles. -
getCurrentSyntaxStyles
Returns the CURRENT style table. This can be passed to thesetStyles()
method ofSyntaxDocument
to use the current syntax styles. If changes have been made via the Settings menu, the current settings will not be the same as the default settings. -
paintSyntaxLine
public static float paintSyntaxLine(Segment line, Token tokens, SyntaxStyle[] styles, TabExpander expander, Graphics graphics, float x, float y) Paints the specified line onto the graphics context. Note that this method modifies 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.graphics
- The graphics context.x
- The x coordinate.y
- The y coordinate.- Returns:
- The x coordinate, plus the width of the painted string.
-