Class SyntaxUtilities
- java.lang.Object
-
- net.sf.gridarta.textedit.textarea.SyntaxUtilities
-
public class SyntaxUtilities extends java.lang.ObjectClass with several utility functions used by jEdit's syntax colorizing subsystem.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static @NotNull SyntaxStylesgetDefaultSyntaxStyles()Returns the default styles.static intpaintSyntaxLine(@NotNull javax.swing.text.Segment line, @NotNull java.lang.Iterable<Token> tokens, @NotNull SyntaxStyles styles, @NotNull javax.swing.text.TabExpander expander, @NotNull java.awt.Graphics gfx, int x, int y)Paints the specified line onto the graphics context.static booleanregionMatches(boolean ignoreCase, javax.swing.text.Segment text, int offset, @NotNull java.lang.CharSequence match)Checks if a sub-region of aSegmentis equal to a string.
-
-
-
Method Detail
-
regionMatches
public static boolean regionMatches(boolean ignoreCase, javax.swing.text.Segment text, int offset, @NotNull @NotNull java.lang.CharSequence match)Checks if a sub-region of aSegmentis 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- Returns:
- whether the sub-region matches
-
getDefaultSyntaxStyles
@NotNull public static @NotNull SyntaxStyles getDefaultSyntaxStyles()
Returns the default styles. This can be passed toTextAreaPainter.setStyles(SyntaxStyles)to use the default syntax styles.- Returns:
- the default styles
-
paintSyntaxLine
public static int paintSyntaxLine(@NotNull @NotNull javax.swing.text.Segment line, @NotNull @NotNull java.lang.Iterable<Token> tokens, @NotNull @NotNull SyntaxStyles styles, @NotNull @NotNull javax.swing.text.TabExpander expander, @NotNull @NotNull java.awt.Graphics gfx, int x, int 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 segmenttokens- the token list for the linestyles- the syntax stylesexpander- the tab expander used to determine tab stops; may be nullgfx- the graphics contextx- the x co-ordinatey- the y co-ordinate- Returns:
- the x co-ordinate, plus the width of the painted string
-
-