Package jade.tools.gui
Class ACLSyntaxUtilities
- java.lang.Object
-
- jade.tools.gui.ACLSyntaxUtilities
-
public class ACLSyntaxUtilities extends Object
Class with several utility functions used by jEdit's syntax colorizing subsystem. The original file is written by Slava Pestov (www.gjt.org) and altered to fit ACL/SL.- Author:
- Chris van Aart - Acklin B.V., the Netherlands & Slava Pestov
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ACLSytntaxStyle[]getDefaultSyntaxStyles(JComponent theComp)Returns the default style table.static intpaintSyntaxLine(Segment line, ACLToken tokens, ACLSytntaxStyle[] styles, TabExpander expander, Graphics gfx, int x, int y)Paints the specified line onto the graphics context.static booleanregionMatches(boolean ignoreCase, Segment text, int offset, char[] match)Checks if a subregion of aSegmentis equal to a character array.static booleanregionMatches(boolean ignoreCase, Segment text, int offset, String match)Checks if a subregion of aSegmentis equal to a string.
-
-
-
Method Detail
-
getDefaultSyntaxStyles
public static ACLSytntaxStyle[] getDefaultSyntaxStyles(JComponent theComp)
Returns the default style table. This can be passed to thesetStyles()method ofSyntaxDocumentto use the default syntax styles.- Parameters:
theComp- Description of Parameter- Returns:
- The DefaultSyntaxStyles value
-
regionMatches
public static boolean regionMatches(boolean ignoreCase, Segment text, int offset, String match)Checks if a subregion 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:
- Description of the Returned Value
-
regionMatches
public static boolean regionMatches(boolean ignoreCase, Segment text, int offset, char[] match)Checks if a subregion of aSegmentis 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- Returns:
- Description of the Returned Value
-
paintSyntaxLine
public static int paintSyntaxLine(Segment line, ACLToken tokens, ACLSytntaxStyle[] 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 segmenttokens- The token list for the linestyles- The syntax style listexpander- 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
-
-