Package org.gjt.sp.jedit.syntax
Class Chunk
- java.lang.Object
-
- org.gjt.sp.jedit.syntax.Token
-
- org.gjt.sp.jedit.syntax.Chunk
-
public class Chunk extends Token
A syntax token with extra information required for painting it on screen.- Since:
- jEdit 4.1pre1
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static float
offsetToX(Chunk chunks, int offset)
Converts an offset in a chunk list into an x co-ordinate.static float
paintChunkBackgrounds(Chunk chunks, java.awt.Graphics2D gfx, float x, float y, int lineHeight)
Paints the background highlights of a chunk list.static float
paintChunkList(Chunk chunks, java.awt.Graphics2D gfx, float x, float y, boolean glyphVector)
Paints a chunk list.static void
propertiesChanged(IPropertyManager props)
Reload internal configuration based on the given properties.static int
xToOffset(Chunk chunks, float x, boolean round)
Converts an x co-ordinate in a chunk list into an offset.-
Methods inherited from class org.gjt.sp.jedit.syntax.Token
stringToToken, tokenToString, toString
-
-
-
-
Method Detail
-
paintChunkList
public static float paintChunkList(Chunk chunks, java.awt.Graphics2D gfx, float x, float y, boolean glyphVector)
Paints a chunk list.- Parameters:
chunks
- The chunk listgfx
- The graphics contextx
- The x co-ordinatey
- The y co-ordinateglyphVector
- true if we want to use glyphVector, false if we want to use drawString- Returns:
- The width of the painted text
- Since:
- jEdit 4.2pre1
-
paintChunkBackgrounds
public static float paintChunkBackgrounds(Chunk chunks, java.awt.Graphics2D gfx, float x, float y, int lineHeight)
Paints the background highlights of a chunk list.- Parameters:
chunks
- The chunk listgfx
- The graphics contextx
- The x co-ordinatey
- The y co-ordinate- Returns:
- The width of the painted backgrounds
- Since:
- jEdit 4.2pre1
-
offsetToX
public static float offsetToX(Chunk chunks, int offset)
Converts an offset in a chunk list into an x co-ordinate.- Parameters:
chunks
- The chunk listoffset
- The offset- Since:
- jEdit 4.1pre1
-
xToOffset
public static int xToOffset(Chunk chunks, float x, boolean round)
Converts an x co-ordinate in a chunk list into an offset.- Parameters:
chunks
- The chunk listx
- The x co-ordinateround
- Round up to next letter if past the middle of a letter?- Returns:
- The offset within the line, or -1 if the x co-ordinate is too far to the right
- Since:
- jEdit 4.1pre1
-
propertiesChanged
public static void propertiesChanged(IPropertyManager props)
Reload internal configuration based on the given properties.- Parameters:
props
- Configuration properties.- Since:
- jEdit 4.4pre1
-
-