|
Gridarta Editor
|
The text area repaint manager. More...
Inheritance diagram for net.sf.gridarta.textedit.textarea.TextAreaPainter:
Collaboration diagram for net.sf.gridarta.textedit.textarea.TextAreaPainter:Public Member Functions | |
| int | getCurrentLineIndex () |
| Returns the currently painted line. More... | |
| List< Token > | getCurrentLineTokens () |
| Returns the tokens of the currently painted line. More... | |
| int | getDefaultCharWidth () |
| This works only for fonts with fixed line height. More... | |
| int | getDefaultLineHeight () |
| This works only for fonts with fixed line height. More... | |
| int | getFirstLine () |
| Returns the line displayed at the text area's origin. More... | |
| FontMetrics | getFontMetrics () |
| Returns the font metrics used by this component. More... | |
| int | getHorizontalOffset () |
| Returns the horizontal offset of drawn lines. More... | |
| Dimension | getMinimumSize () |
| Dimension | getPreferredSize () |
| SyntaxStyles | getStyles () |
| Returns the syntax styles used to paint colorized text. More... | |
| int | getVisibleLines () |
| void | invalidateLine (final int line) |
| Marks a line as needing a repaint. More... | |
| void | invalidateLineRange (final int firstLine, final int lastLine) |
| Marks a range of lines as needing a repaint. More... | |
| void | invalidateSelectedLines () |
| Repaints the lines containing the selection. More... | |
| boolean | isBlockCaretEnabled () |
| Returns whether the caret should be drawn as a block. More... | |
| boolean | isBracketHighlightEnabled () |
| Returns whether bracket highlighting is enabled. More... | |
| int | lineToY (final int line) |
| Converts a line index to a y co-ordinate. More... | |
| float | nextTabStop (final float x, final int tabOffset) |
| int | offsetToX (final int line, final int offset) |
| Converts an offset in a line into an x co-ordinate. More... | |
| int | offsetToX2 (final int line, final int offset) |
| Converts an offset in a line into an x co-ordinate. More... | |
| void | paint (@NotNull final Graphics g) |
| Repaints the text. More... | |
| void | recalculateVisibleLines () |
| Recalculates the number of visible lines. More... | |
| void | setCurrentLineIndex (final int lineIndex) |
| Sets the currently painted line. More... | |
| void | setCurrentLineTokens (@Nullable final List< Token > tokens) |
| Sets the tokens of the currently painted line. More... | |
| boolean | setFirstLine (final int firstLine) |
| final void | setFont (@NotNull final Font font) |
| boolean | setHorizontalOffset (final int horizontalOffset) |
| void | setStyles (@NotNull final SyntaxStyles styles) |
| Sets the syntax styles used to paint colorized text. More... | |
| TextAreaPainter (@NotNull final JEditTextArea textArea, @NotNull final TextAreaSelection selection, @NotNull final TextAreaCaret caret, @NotNull final TextAreaDefaults defaults, @NotNull final TextAreaBrackets brackets, @NotNull final TextAreaConfig config, final boolean paintInvalid) | |
| Creates a new repaint manager. More... | |
| int | xToOffset (final int line, final int x) |
| Converts an x co-ordinate to an offset within a line. More... | |
| int | xyToOffset (final int x, final int y) |
| Converts a point to an offset, from the start of the text. More... | |
| int | yToLine (final int y) |
| Converts a y co-ordinate to a line index. More... | |
Private Member Functions | |
| Dimension | newDimension (final int columns, final int rows) |
| Returns a Dimension measured in default character sizes. More... | |
| void | paintBracketHighlight (@NotNull final Graphics gfx, final int line, final int y) |
| Paints the bracket highlight. More... | |
| void | paintCaret (@NotNull final Graphics gfx, final int line, final int y) |
| Paints the caret highlight. More... | |
| void | paintHighlight (@NotNull final Graphics gfx, final int line, final int y) |
| Adds highlights for a line: selections, custom highlights from client code, brackets, caret. More... | |
| void | paintLine (@NotNull final Graphics gfx, @Nullable final TokenMarker tokenMarker, final int line, final int x) |
| Paints one line. More... | |
| void | paintLineHighlight (@NotNull final Graphics gfx, final int line, final int y) |
| Paints the selection highlight. More... | |
| void | paintPlainLine (@NotNull final Graphics gfx, final int line, @NotNull final Font defaultFont, @NotNull final Color defaultColor, final int x, final int y) |
| Paint a line without token highlighting. More... | |
| void | paintSyntaxLine (@NotNull final Graphics gfx, @NotNull final TokenMarker tokenMarker, final int line, @NotNull final Font defaultFont, @NotNull final Color defaultColor, final int x, final int y) |
| Paint a line with token highlighting. More... | |
| void | updateLineInfo () |
| Make sure defaultCharWidth and defaultLineHeight are up-to-date. More... | |
Private Attributes | |
| final boolean | blockCaret |
| Whether the caret should be wide even in insert mode. More... | |
| final boolean | bracketHighlight |
| Whether bracket highlighting is enabled. More... | |
| final Color | bracketHighlightColor |
| The color for bracket highlighting. More... | |
| final TextAreaBrackets | brackets |
| The brackets to paint. More... | |
| final TextAreaCaret | caret |
| final Color | caretColor |
| The caret color. More... | |
| final int | cols |
| The number of columns. More... | |
| final TextAreaConfig | config |
| The TextAreaConfig options to use. More... | |
| final Segment | currentLine = new Segment() |
| Holds the currently painted line. More... | |
| int | currentLineIndex = -1 |
| The currently painted line. More... | |
| List< Token > | currentLineTokens |
| The tokens of the currently painted line. More... | |
| int | defaultCharWidth |
| The character width of defaultFont. More... | |
| Font | defaultFont |
| The Font from which defaultLineHeight and defaultCharWidth have been calculated. More... | |
| int | defaultLineHeight |
| The line height of defaultFont. More... | |
| final Color | eolMarkerColor |
| The color for painting eol markers. More... | |
| final boolean | eolMarkers |
| Whether end of line markers should be painted. More... | |
| int | firstLine |
| FontMetrics | fontMetrics |
| The font metrics for this instance. More... | |
| final FontRenderContext | fontRenderContext = new FontRenderContext(null, false, false) |
| The font render context for this instance. More... | |
| int | horizontalOffset |
| final boolean | lineHighlight |
| Whether line highlighting is enabled. More... | |
| final Color | lineHighlightColor |
| The color for line highlighting. More... | |
| final Segment | lineSegment = new Segment() |
| final boolean | paintInvalid |
| Whether invalid lines should be painted as red tildes. More... | |
| final int | rows |
| The number of rows. More... | |
| final TextAreaSelection | selection |
| final Color | selectionColor |
| The selection color. More... | |
| SyntaxStyles | styles |
| The syntax styles used to paint colorized text. More... | |
| int | tabSize |
| The tab size in pixels. More... | |
| final JEditTextArea | textArea |
| The associated text area that is painted. More... | |
| int | visibleLines |
Static Private Attributes | |
| static final Category | LOG = Logger.getLogger(TextAreaPainter.class) |
| The Logger for printing log messages. More... | |
| static final long | serialVersionUID = 1L |
| The serial version UID. More... | |
The text area repaint manager.
It performs double buffering and paints lines of text.
Definition at line 42 of file TextAreaPainter.java.
| net.sf.gridarta.textedit.textarea.TextAreaPainter.TextAreaPainter | ( | @NotNull final JEditTextArea | textArea, |
| @NotNull final TextAreaSelection | selection, | ||
| @NotNull final TextAreaCaret | caret, | ||
| @NotNull final TextAreaDefaults | defaults, | ||
| @NotNull final TextAreaBrackets | brackets, | ||
| @NotNull final TextAreaConfig | config, | ||
| final boolean | paintInvalid | ||
| ) |
Creates a new repaint manager.
This should be not be called directly.
| textArea | the associated text area that is painted |
| defaults | the text attributes to use |
| brackets | the brackets to paint |
| config | the text area configuration options to use |
| paintInvalid | whether invalid lines should be painted as red tildes |
Definition at line 233 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.brackets, net.sf.gridarta.textedit.textarea.TextAreaPainter.caret, net.sf.gridarta.textedit.textarea.TextAreaPainter.config, net.sf.gridarta.textedit.textarea.TextAreaPainter.getFontMetrics(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintInvalid, net.sf.gridarta.textedit.textarea.TextAreaPainter.selection, and net.sf.gridarta.textedit.textarea.TextAreaPainter.textArea.
Here is the call graph for this function:| int net.sf.gridarta.textedit.textarea.TextAreaPainter.getCurrentLineIndex | ( | ) |
Returns the currently painted line.
Definition at line 659 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.currentLineIndex.
| List<Token> net.sf.gridarta.textedit.textarea.TextAreaPainter.getCurrentLineTokens | ( | ) |
Returns the tokens of the currently painted line.
Definition at line 676 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX2(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.xToOffset().
Here is the caller graph for this function:| int net.sf.gridarta.textedit.textarea.TextAreaPainter.getDefaultCharWidth | ( | ) |
This works only for fonts with fixed line height.
It's sort of hack to avoid the use of deprecated methods.
Definition at line 299 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.defaultCharWidth, and net.sf.gridarta.textedit.textarea.TextAreaPainter.updateLineInfo().
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.updateScrollBars().
Here is the call graph for this function:
Here is the caller graph for this function:| int net.sf.gridarta.textedit.textarea.TextAreaPainter.getDefaultLineHeight | ( | ) |
This works only for fonts with fixed line height.
It's sort of hack to avoid the use of deprecated methods.
Definition at line 289 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.defaultLineHeight, and net.sf.gridarta.textedit.textarea.TextAreaPainter.updateLineInfo().
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.recalculateVisibleLines().
Here is the call graph for this function:
Here is the caller graph for this function:| int net.sf.gridarta.textedit.textarea.TextAreaPainter.getFirstLine | ( | ) |
Returns the line displayed at the text area's origin.
Definition at line 714 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.firstLine.
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.documentChanged(), net.sf.gridarta.textedit.textarea.JEditTextArea.getFirstLine(), net.sf.gridarta.textedit.textarea.JEditTextArea.scrollTo(), and net.sf.gridarta.textedit.textarea.JEditTextArea.updateScrollBars().
Here is the caller graph for this function:| FontMetrics net.sf.gridarta.textedit.textarea.TextAreaPainter.getFontMetrics | ( | ) |
Returns the font metrics used by this component.
Definition at line 347 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.fontMetrics.
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.scrollTo(), net.sf.gridarta.textedit.textarea.TextAreaPainter.setFont(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.TextAreaPainter().
Here is the caller graph for this function:| int net.sf.gridarta.textedit.textarea.TextAreaPainter.getHorizontalOffset | ( | ) |
Returns the horizontal offset of drawn lines.
Definition at line 738 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.horizontalOffset.
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.scrollTo(), and net.sf.gridarta.textedit.textarea.JEditTextArea.updateScrollBars().
Here is the caller graph for this function:| Dimension net.sf.gridarta.textedit.textarea.TextAreaPainter.getMinimumSize | ( | ) |
Definition at line 435 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.newDimension().
Here is the call graph for this function:| Dimension net.sf.gridarta.textedit.textarea.TextAreaPainter.getPreferredSize | ( | ) |
Definition at line 428 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.newDimension().
Here is the call graph for this function:| SyntaxStyles net.sf.gridarta.textedit.textarea.TextAreaPainter.getStyles | ( | ) |
Returns the syntax styles used to paint colorized text.
Definition at line 310 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.styles.
| int net.sf.gridarta.textedit.textarea.TextAreaPainter.getVisibleLines | ( | ) |
Definition at line 707 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.visibleLines.
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.getVisibleLines().
Here is the caller graph for this function:| void net.sf.gridarta.textedit.textarea.TextAreaPainter.invalidateLine | ( | final int | line | ) |
Marks a line as needing a repaint.
| line | the line to invalidate |
Definition at line 400 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.lineToY().
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.documentChanged(), and net.sf.gridarta.textedit.textarea.JEditTextArea.select().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.textedit.textarea.TextAreaPainter.invalidateLineRange | ( | final int | firstLine, |
| final int | lastLine | ||
| ) |
Marks a range of lines as needing a repaint.
| firstLine | the first line to invalidate |
| lastLine | the last line to invalidate |
Definition at line 409 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.lineToY().
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.documentChanged(), net.sf.gridarta.textedit.textarea.TextAreaPainter.invalidateSelectedLines(), and net.sf.gridarta.textedit.textarea.JEditTextArea.select().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.textedit.textarea.TextAreaPainter.invalidateSelectedLines | ( | ) |
Repaints the lines containing the selection.
Definition at line 416 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaSelection.getSelectionEndLine(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getSelectionStartLine(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.invalidateLineRange().
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.blinkCaret(), net.sf.gridarta.textedit.textarea.JEditTextArea.setCaretVisible(), net.sf.gridarta.textedit.textarea.JEditTextArea.setOverwriteEnabled(), and net.sf.gridarta.textedit.textarea.JEditTextArea.setSelectionRectangular().
Here is the call graph for this function:
Here is the caller graph for this function:| boolean net.sf.gridarta.textedit.textarea.TextAreaPainter.isBlockCaretEnabled | ( | ) |
Returns whether the caret should be drawn as a block.
Definition at line 338 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.blockCaret.
| boolean net.sf.gridarta.textedit.textarea.TextAreaPainter.isBracketHighlightEnabled | ( | ) |
Returns whether bracket highlighting is enabled.
When bracket highlighting is enabled, the bracket matching the one before the caret (if any) is highlighted.
Definition at line 330 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.bracketHighlight.
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.select().
Here is the caller graph for this function:| int net.sf.gridarta.textedit.textarea.TextAreaPainter.lineToY | ( | final int | line | ) |
Converts a line index to a y co-ordinate.
| line | the line |
Definition at line 731 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.invalidateLine(), net.sf.gridarta.textedit.textarea.TextAreaPainter.invalidateLineRange(), net.sf.gridarta.textedit.textarea.JEditTextArea.lineToY(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.paintLine().
Here is the caller graph for this function:
|
private |
Returns a Dimension measured in default character sizes.
| columns | the width in characters |
| rows | the height in rows |
Definition at line 447 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.getMinimumSize(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.getPreferredSize().
Here is the caller graph for this function:| float net.sf.gridarta.textedit.textarea.TextAreaPainter.nextTabStop | ( | final float | x, |
| final int | tabOffset | ||
| ) |
Definition at line 421 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.tabSize.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.xToOffset().
Here is the caller graph for this function:| int net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX | ( | final int | line, |
| final int | offset | ||
| ) |
Converts an offset in a line into an x co-ordinate.
This is a slow version that can be used any time.
| line | the line |
| offset | the offset, from the start of the line |
Definition at line 814 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX2(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.setCurrentLineTokens().
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.offsetToX().
Here is the call graph for this function:
Here is the caller graph for this function:| int net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX2 | ( | final int | line, |
| final int | offset | ||
| ) |
Converts an offset in a line into an x co-ordinate.
This is a fast version that should only be used if no changes were made to the text since the last repaint.
| line | the line |
| offset | the offset, from the start of the line |
Definition at line 758 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.fontMetrics, net.sf.gridarta.textedit.textarea.TextAreaPainter.getCurrentLineTokens(), net.sf.gridarta.textedit.textarea.SyntaxStyle.getFontMetrics(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineText(), net.sf.gridarta.textedit.textarea.SyntaxStyles.getStyle(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getTokenMarker(), net.sf.gridarta.textedit.textarea.TextAreaPainter.horizontalOffset, net.sf.gridarta.textedit.textarea.tokenmarker.TokenMarker.markTokens(), net.sf.gridarta.textedit.textarea.Token.NULL, and net.sf.gridarta.textedit.textarea.TextAreaPainter.setCurrentLineTokens().
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX(), net.sf.gridarta.textedit.textarea.JEditTextArea.offsetToX2(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintBracketHighlight(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintCaret(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintLineHighlight(), and net.sf.gridarta.textedit.textarea.JEditTextArea.scrollTo().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.textedit.textarea.TextAreaPainter.paint | ( | @NotNull final Graphics | g | ) |
Repaints the text.
| g | the graphics context |
Definition at line 363 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaSelection.getDocument(), net.sf.gridarta.textedit.textarea.SyntaxDocument.getTokenMarker(), net.sf.gridarta.textedit.textarea.tokenmarker.TokenMarker.isNextLineRequested(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.paintLine().
Here is the call graph for this function:
|
private |
Paints the bracket highlight.
| gfx | the graphics to paint to |
| line | the line index |
| y | the y-offset for painting |
Definition at line 609 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaBrackets.getBracketPosition(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX2().
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.paintHighlight().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Paints the caret highlight.
| gfx | the graphics to paint to |
| line | the line index |
| y | the y-offset for painting |
Definition at line 630 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaSelection.getCaretPosition(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineStartOffset(), net.sf.gridarta.textedit.textarea.TextAreaCaret.isCaretVisible(), net.sf.gridarta.textedit.textarea.TextAreaConfig.isOverwrite(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX2().
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.paintHighlight().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Adds highlights for a line: selections, custom highlights from client code, brackets, caret.
| gfx | the graphics to paint to |
| line | the line index |
| y | the y-offset for painting |
Definition at line 538 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaBrackets.getBracketLine(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getCaretLine(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getSelectionEndLine(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getSelectionStartLine(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintBracketHighlight(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintCaret(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.paintLineHighlight().
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.paintLine(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintPlainLine(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.paintSyntaxLine().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Paints one line.
| gfx | the graphics to paint to |
| tokenMarker | the token marker to use |
| line | the line index |
| x | the x-offset for painting |
Definition at line 458 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineCount(), net.sf.gridarta.textedit.textarea.SyntaxStyles.getStyle(), net.sf.gridarta.textedit.textarea.Token.INVALID, net.sf.gridarta.textedit.textarea.TextAreaPainter.lineToY(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintHighlight(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintPlainLine(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintSyntaxLine(), and net.sf.gridarta.textedit.textarea.SyntaxStyle.setGraphicsFlags().
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.paint().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Paints the selection highlight.
| gfx | the graphics to paint to |
| line | the line index |
| y | the y-offset for painting |
Definition at line 558 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineLength(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineStartOffset(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getSelectionEnd(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getSelectionEndLine(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getSelectionStart(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getSelectionStartLine(), net.sf.gridarta.textedit.textarea.TextAreaSelection.isSelectionRectangular(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX2().
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.paintHighlight().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Paint a line without token highlighting.
| gfx | the graphics to paint to |
| line | the line index |
| defaultFont | the font to use |
| defaultColor | the color to use |
| x | the x-offset for painting |
| y | the y-offset for painting |
Definition at line 487 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineText(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.paintHighlight().
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.paintLine().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Paint a line with token highlighting.
| gfx | the graphics to paint to |
| tokenMarker | the token marker to use |
| line | the line index |
| defaultFont | the font to use |
| defaultColor | the color to use |
| x | the x-offset for painting |
| y | the y-offset for painting |
Definition at line 513 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineText(), net.sf.gridarta.textedit.textarea.TextAreaPainter.paintHighlight(), and net.sf.gridarta.textedit.textarea.SyntaxUtilities.paintSyntaxLine().
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.paintLine().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.textedit.textarea.TextAreaPainter.recalculateVisibleLines | ( | ) |
Recalculates the number of visible lines.
This should not be called directly.
Definition at line 692 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.getDefaultLineHeight(), and net.sf.gridarta.textedit.textarea.JEditTextArea.updateScrollBars().
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.ComponentHandler.componentResized(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.setFont().
Here is the call graph for this function:
Here is the caller graph for this function:| void net.sf.gridarta.textedit.textarea.TextAreaPainter.setCurrentLineIndex | ( | final int | lineIndex | ) |
Sets the currently painted line.
| lineIndex | the line index |
Definition at line 667 of file TextAreaPainter.java.
| void net.sf.gridarta.textedit.textarea.TextAreaPainter.setCurrentLineTokens | ( | @Nullable final List< Token > | tokens | ) |
Sets the tokens of the currently painted line.
| tokens | the tokens |
Definition at line 684 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX(), net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX2(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.xToOffset().
Here is the caller graph for this function:| boolean net.sf.gridarta.textedit.textarea.TextAreaPainter.setFirstLine | ( | final int | firstLine | ) |
Definition at line 718 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.firstLine.
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.setFirstLine(), and net.sf.gridarta.textedit.textarea.JEditTextArea.setOrigin().
Here is the caller graph for this function:| final void net.sf.gridarta.textedit.textarea.TextAreaPainter.setFont | ( | @NotNull final Font | font | ) |
Definition at line 352 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.getFontMetrics(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.recalculateVisibleLines().
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.setFont().
Here is the call graph for this function:
Here is the caller graph for this function:| boolean net.sf.gridarta.textedit.textarea.TextAreaPainter.setHorizontalOffset | ( | final int | horizontalOffset | ) |
Definition at line 742 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.horizontalOffset.
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.setHorizontalOffset(), and net.sf.gridarta.textedit.textarea.JEditTextArea.setOrigin().
Here is the caller graph for this function:| void net.sf.gridarta.textedit.textarea.TextAreaPainter.setStyles | ( | @NotNull final SyntaxStyles | styles | ) |
Sets the syntax styles used to paint colorized text.
| styles | the syntax styles |
Definition at line 319 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.styles.
|
private |
Make sure defaultCharWidth and defaultLineHeight are up-to-date.
Definition at line 273 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.getDefaultCharWidth(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.getDefaultLineHeight().
Here is the caller graph for this function:| int net.sf.gridarta.textedit.textarea.TextAreaPainter.xToOffset | ( | final int | line, |
| final int | x | ||
| ) |
Converts an x co-ordinate to an offset within a line.
| line | the line |
| x | the x co-ordinate |
Definition at line 835 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.fontMetrics, net.sf.gridarta.textedit.textarea.TextAreaPainter.getCurrentLineTokens(), net.sf.gridarta.textedit.textarea.SyntaxStyle.getFontMetrics(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineText(), net.sf.gridarta.textedit.textarea.SyntaxStyles.getStyle(), net.sf.gridarta.textedit.textarea.TextAreaSelection.getTokenMarker(), net.sf.gridarta.textedit.textarea.TextAreaPainter.horizontalOffset, net.sf.gridarta.textedit.textarea.tokenmarker.TokenMarker.markTokens(), net.sf.gridarta.textedit.textarea.TextAreaPainter.nextTabStop(), net.sf.gridarta.textedit.textarea.Token.NULL, and net.sf.gridarta.textedit.textarea.TextAreaPainter.setCurrentLineTokens().
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.xToOffset(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.xyToOffset().
Here is the call graph for this function:
Here is the caller graph for this function:| int net.sf.gridarta.textedit.textarea.TextAreaPainter.xyToOffset | ( | final int | x, |
| final int | y | ||
| ) |
Converts a point to an offset, from the start of the text.
| x | the x co-ordinate of the point |
| y | the y co-ordinate of the point |
Definition at line 928 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineStartOffset(), net.sf.gridarta.textedit.textarea.TextAreaPainter.xToOffset(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.yToLine().
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.DragHandler.mouseDragged().
Here is the call graph for this function:
Here is the caller graph for this function:| int net.sf.gridarta.textedit.textarea.TextAreaPainter.yToLine | ( | final int | y | ) |
Converts a y co-ordinate to a line index.
| y | the y co-ordinate |
Definition at line 824 of file TextAreaPainter.java.
References net.sf.gridarta.textedit.textarea.TextAreaPainter.firstLine, net.sf.gridarta.textedit.textarea.TextAreaPainter.fontMetrics, and net.sf.gridarta.textedit.textarea.TextAreaSelection.getLineCount().
Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.MouseHandler.mousePressed(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.xyToOffset().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Whether the caret should be wide even in insert mode.
Definition at line 87 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.isBlockCaretEnabled().
|
private |
Whether bracket highlighting is enabled.
Definition at line 140 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.isBracketHighlightEnabled().
|
private |
The color for bracket highlighting.
Definition at line 134 of file TextAreaPainter.java.
|
private |
The brackets to paint.
Definition at line 75 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.TextAreaPainter().
|
private |
Definition at line 69 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.TextAreaPainter().
|
private |
The caret color.
Definition at line 110 of file TextAreaPainter.java.
|
private |
The number of columns.
Use to calculate the component's width.
Definition at line 98 of file TextAreaPainter.java.
|
private |
The TextAreaConfig options to use.
Definition at line 81 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.TextAreaPainter().
|
private |
Holds the currently painted line.
Definition at line 177 of file TextAreaPainter.java.
|
private |
The currently painted line.
Definition at line 165 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.getCurrentLineIndex().
|
private |
The tokens of the currently painted line.
Definition at line 171 of file TextAreaPainter.java.
|
private |
The character width of defaultFont.
Unset if
.
Definition at line 213 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.getDefaultCharWidth().
|
private |
The Font from which defaultLineHeight and defaultCharWidth have been calculated.
Set to
it not yet calculated.
Definition at line 199 of file TextAreaPainter.java.
|
private |
The line height of defaultFont.
Unset if
.
Definition at line 206 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.getDefaultLineHeight().
|
private |
The color for painting eol markers.
Definition at line 153 of file TextAreaPainter.java.
|
private |
Whether end of line markers should be painted.
Definition at line 159 of file TextAreaPainter.java.
|
private |
Definition at line 217 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.getFirstLine(), net.sf.gridarta.textedit.textarea.TextAreaPainter.setFirstLine(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.yToLine().
|
private |
The font metrics for this instance.
Definition at line 190 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.getFontMetrics(), net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX2(), net.sf.gridarta.textedit.textarea.TextAreaPainter.xToOffset(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.yToLine().
|
private |
The font render context for this instance.
Definition at line 57 of file TextAreaPainter.java.
|
private |
Definition at line 219 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.getHorizontalOffset(), net.sf.gridarta.textedit.textarea.TextAreaPainter.offsetToX2(), net.sf.gridarta.textedit.textarea.TextAreaPainter.setHorizontalOffset(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.xToOffset().
|
private |
Whether line highlighting is enabled.
Definition at line 128 of file TextAreaPainter.java.
|
private |
The color for line highlighting.
Definition at line 122 of file TextAreaPainter.java.
|
private |
Definition at line 222 of file TextAreaPainter.java.
|
staticprivate |
The Logger for printing log messages.
Definition at line 47 of file TextAreaPainter.java.
|
private |
Whether invalid lines should be painted as red tildes.
Definition at line 146 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.TextAreaPainter().
|
private |
The number of rows.
Use to calculate the component's height.
Definition at line 104 of file TextAreaPainter.java.
|
private |
Definition at line 66 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.TextAreaPainter().
|
private |
The selection color.
Definition at line 116 of file TextAreaPainter.java.
|
staticprivate |
The serial version UID.
Definition at line 52 of file TextAreaPainter.java.
|
private |
The syntax styles used to paint colorized text.
Definition at line 92 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.getStyles(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.setStyles().
|
private |
The tab size in pixels.
Definition at line 183 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.nextTabStop().
|
private |
The associated text area that is painted.
Definition at line 63 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.TextAreaPainter().
|
private |
Definition at line 215 of file TextAreaPainter.java.
Referenced by net.sf.gridarta.textedit.textarea.TextAreaPainter.getVisibleLines().