Package org.fife.ui.rsyntaxtextarea
Interface TokenPainter
- All Known Implementing Classes:
DefaultTokenPainter
,VisibleWhitespaceTokenPainter
interface TokenPainter
Renders tokens in an instance of
RSyntaxTextArea
. One instance
may render tokens "regularly," another may render visible whitespace, for
example.- Version:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionfloat
paint
(Token token, Graphics2D g, float x, float y, RSyntaxTextArea host, TabExpander e) Paints this token.float
paint
(Token token, Graphics2D g, float x, float y, RSyntaxTextArea host, TabExpander e, float clipStart) Paints this token.float
paint
(Token token, Graphics2D g, float x, float y, RSyntaxTextArea host, TabExpander e, float clipStart, boolean paintBG) Paints this token.float
paintSelected
(Token token, Graphics2D g, float x, float y, RSyntaxTextArea host, TabExpander e, boolean useSTC) Paints this token as it should appear in a selected region of text (assuming painting with a selection-foreground color is enabled in the parentRSyntaxTextArea
).float
paintSelected
(Token token, Graphics2D g, float x, float y, RSyntaxTextArea host, TabExpander e, float clipStart, boolean useSTC) Paints this token as it should appear in a selected region of text (assuming painting with a selection-foreground color is enabled in the parentRSyntaxTextArea
).
-
Method Details
-
paint
Paints this token.- Parameters:
token
- The token to render.g
- The graphics context in which to paint.x
- The x-coordinate at which to paint.y
- The y-coordinate at which to paint.host
- The text area this token is in.e
- How to expand tabs.- Returns:
- The x-coordinate representing the end of the painted text.
-
paint
float paint(Token token, Graphics2D g, float x, float y, RSyntaxTextArea host, TabExpander e, float clipStart) Paints this token.- Parameters:
token
- The token to render.g
- The graphics context in which to paint.x
- The x-coordinate at which to paint.y
- The y-coordinate at which to paint.host
- The text area this token is in.e
- How to expand tabs.clipStart
- The left boundary of the clip rectangle in which we're painting. This optimizes painting by allowing us to not paint when this token is "to the left" of the clip rectangle.- Returns:
- The x-coordinate representing the end of the painted text.
-
paint
float paint(Token token, Graphics2D g, float x, float y, RSyntaxTextArea host, TabExpander e, float clipStart, boolean paintBG) Paints this token.- Parameters:
token
- The token to render.g
- The graphics context in which to paint.x
- The x-coordinate at which to paint.y
- The y-coordinate at which to paint.host
- The text area this token is in.e
- How to expand tabs.clipStart
- The left boundary of the clip rectangle in which we're painting. This optimizes painting by allowing us to not paint when this token is "to the left" of the clip rectangle.paintBG
- Whether to paint the background.- Returns:
- The x-coordinate representing the end of the painted text.
-
paintSelected
float paintSelected(Token token, Graphics2D g, float x, float y, RSyntaxTextArea host, TabExpander e, boolean useSTC) Paints this token as it should appear in a selected region of text (assuming painting with a selection-foreground color is enabled in the parentRSyntaxTextArea
).- Parameters:
token
- The token to render.g
- The graphics context in which to paint.x
- The x-coordinate at which to paint.y
- The y-coordinate at which to paint.host
- The text area this token is in.e
- How to expand tabs.useSTC
- Whether to use the text area's "selected text color."- Returns:
- The x-coordinate representing the end of the painted text.
-
paintSelected
float paintSelected(Token token, Graphics2D g, float x, float y, RSyntaxTextArea host, TabExpander e, float clipStart, boolean useSTC) Paints this token as it should appear in a selected region of text (assuming painting with a selection-foreground color is enabled in the parentRSyntaxTextArea
).- Parameters:
token
- The token to render.g
- The graphics context in which to paint.x
- The x-coordinate at which to paint.y
- The y-coordinate at which to paint.host
- The text area this token is in.e
- How to expand tabs.clipStart
- The left boundary of the clip rectangle in which we're painting. This optimizes painting by allowing us to not paint when this token is "to the left" of the clip rectangle.useSTC
- Whether to use the text area's "selected text color."- Returns:
- The x-coordinate representing the end of the painted text.
-