Gridarta Editor
net.sf.gridarta.textedit.textarea.SyntaxUtilities Class Reference

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

+ Collaboration diagram for net.sf.gridarta.textedit.textarea.SyntaxUtilities:

Static Public Member Functions

static SyntaxStyles getDefaultSyntaxStyles ()
 Returns the default styles. More...
 
static int paintSyntaxLine (final Segment line, final Iterable< Token > tokens, final SyntaxStyles styles, final TabExpander expander, final Graphics gfx, final int x, final int y)
 Paints the specified line onto the graphics context. More...
 
static boolean regionMatches (final boolean ignoreCase, final Segment text, final int offset, final CharSequence match)
 Checks if a sub-region of a. More...
 

Private Member Functions

 SyntaxUtilities ()
 Private constructor to prevent instantiation. More...
 

Detailed Description

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

Author
Slava Pestov
Andreas Kirschbaum

Definition at line 26 of file SyntaxUtilities.java.

Constructor & Destructor Documentation

◆ SyntaxUtilities()

net.sf.gridarta.textedit.textarea.SyntaxUtilities.SyntaxUtilities ( )
private

Private constructor to prevent instantiation.

Definition at line 31 of file SyntaxUtilities.java.

Member Function Documentation

◆ getDefaultSyntaxStyles()

◆ paintSyntaxLine()

static int net.sf.gridarta.textedit.textarea.SyntaxUtilities.paintSyntaxLine ( final Segment  line,
final Iterable< Token tokens,
final SyntaxStyles  styles,
final TabExpander  expander,
final Graphics  gfx,
final int  x,
final int  y 
)
static

Paints the specified line onto the graphics context.

Note that this method modifies the offset and count values of the segment.

Parameters
linethe line segment
tokensthe token list for the line
stylesthe syntax styles
expanderthe tab expander used to determine tab stops. May be null
gfxthe graphics context
xthe x co-ordinate
ythe y co-ordinate
Returns
the x co-ordinate, plus the width of the painted string

Definition at line 99 of file SyntaxUtilities.java.

References net.sf.gridarta.textedit.textarea.SyntaxStyles.getStyle(), net.sf.gridarta.textedit.textarea.Token.NULL, and net.sf.gridarta.textedit.textarea.SyntaxStyle.setGraphicsFlags().

Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.paintSyntaxLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ regionMatches()

static boolean net.sf.gridarta.textedit.textarea.SyntaxUtilities.regionMatches ( final boolean  ignoreCase,
final Segment  text,
final int  offset,
final CharSequence  match 
)
static

Checks if a sub-region of a.

Segment

is equal to a string.

Parameters
ignoreCasetrue if case should be ignored, false otherwise
textthe segment
offsetthe offset into the segment
matchthe string to match
Returns
whether the sub-region matches

Definition at line 42 of file SyntaxUtilities.java.

Referenced by net.sf.gridarta.textedit.textarea.tokenmarker.HTMLTokenMarker.markTokensImpl(), net.sf.gridarta.textedit.textarea.tokenmarker.PythonTokenMarker.markTokensImpl(), and net.sf.gridarta.textedit.textarea.tokenmarker.LuaTokenMarker.markTokensImpl().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: