|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent com.jidesoft.editor.CodeEditorPainter
public class CodeEditorPainter
The text area repaint manager. It performs double buffering and paints lines of text.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
int |
_composedCaretX
|
TextLayout |
_composedTextLayout
|
protected CodeEditor |
_editor
|
protected FontMetrics |
_fm
|
protected Segment |
currentLine
|
protected int |
currentLineIndex
|
protected Token |
currentLineTokens
|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
CodeEditorPainter(CodeEditor editor)
Creates a new repaint manager. |
Method Summary | |
---|---|
protected int |
getCaretHeight()
|
protected int |
getCaretStartY(int visualLine)
|
CodeEditor |
getCodeEditor()
|
Font |
getFont()
|
FontMetrics |
getFontMetrics()
Returns the font metrics used by this component. |
int |
getLineHeight()
|
String |
getToolTipText(MouseEvent event)
|
void |
invalidateLine(int line)
Marks a view line as needing a repaint. |
void |
invalidateLineRange(int firstLine,
int lastLine)
Marks a range of lines as needing a repaint. |
void |
invalidateRange(int startOffset,
int endOffset)
|
void |
invalidateSelectedLines()
Repaints the lines containing the selection. |
boolean |
isManagingFocus()
Returns if this component can be traversed by pressing the Tab key. |
protected boolean |
isSpanSelected(FoldingSpan span,
int viewLine,
int column,
CaretPosition selectionStartVp,
CaretPosition selectionEndVp)
Check if the span is all selected. |
float |
nextTabStop(float x,
int tabOffset)
Implementation of TabExpander interface. |
int |
nextTabStop(int column)
|
void |
paint(Graphics g)
Repaints the text. |
protected void |
paintBracketHighlight(Graphics g,
int line,
int y)
|
protected void |
paintCaret(Graphics g,
int visualLine)
|
void |
paintColumnGuides(Graphics g,
Rectangle rect)
|
int |
paintFoldedText(Graphics g,
Font font,
String text,
int x,
int y,
FontMetrics fm)
|
protected void |
paintHighlight(Graphics g,
int line,
int viewLine,
CaretPosition selectionStartVp,
CaretPosition selectionEndVp,
int y)
|
protected void |
paintImeInput(Graphics2D gfx,
int screenLine,
int physicalLine,
int start,
int end,
int y)
|
protected void |
paintLine(Graphics g,
TokenMarker tokenMarker,
int line,
int viewLine,
CaretPosition selectionStartVp,
CaretPosition selectionEndVp,
int x,
int y,
com.jidesoft.editor.FoldingState state)
|
protected void |
paintLineHighlight(Graphics g,
int line,
int visualLine,
CaretPosition selectionStartVp,
CaretPosition selectionEndVp,
int y)
|
protected void |
paintLineSelection(Graphics g,
int visualLine,
CaretPosition selectionStartVp,
CaretPosition selectionEndVp,
int y)
|
protected void |
paintPlainLine(Graphics g,
int line,
int visualLine,
CaretPosition selectionStartVp,
CaretPosition selectionEndVp,
Font defaultFont,
Color defaultColor,
int x,
int y)
|
protected int |
paintSyntaxLine(Graphics g,
TokenMarker tokenMarker,
int line,
int viewLine,
int start,
int end,
CaretPosition selectionStartVp,
CaretPosition selectionEndVp,
Font defaultFont,
Color defaultColor,
int x,
int y,
boolean paintHighlight)
|
void |
setFont(Font font)
Sets the font for this component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int currentLineIndex
protected Token currentLineTokens
protected Segment currentLine
protected CodeEditor _editor
protected FontMetrics _fm
public TextLayout _composedTextLayout
public int _composedCaretX
Constructor Detail |
---|
public CodeEditorPainter(CodeEditor editor)
editor
- the code editor instanceMethod Detail |
---|
public final boolean isManagingFocus()
isManagingFocus
in class JComponent
public FontMetrics getFontMetrics()
public void setFont(Font font)
setFont
in class JComponent
font
- The fontpublic String getToolTipText(MouseEvent event)
getToolTipText
in class JComponent
public void paint(Graphics g)
paint
in class JComponent
g
- The graphics contextprotected void paintImeInput(Graphics2D gfx, int screenLine, int physicalLine, int start, int end, int y)
public final void invalidateLine(int line)
line
- the view line index to invalidatepublic final void invalidateRange(int startOffset, int endOffset)
startOffset
- start offsetendOffset
- end offsetpublic final void invalidateLineRange(int firstLine, int lastLine)
firstLine
- The first view line index to invalidatelastLine
- The last view line index to invalidatepublic final void invalidateSelectedLines()
public float nextTabStop(float x, int tabOffset)
nextTabStop
in interface TabExpander
x
- The x co-ordinatetabOffset
- Ignored
public int nextTabStop(int column)
public Font getFont()
getFont
in interface MenuContainer
getFont
in class Component
protected void paintLine(Graphics g, TokenMarker tokenMarker, int line, int viewLine, CaretPosition selectionStartVp, CaretPosition selectionEndVp, int x, int y, com.jidesoft.editor.FoldingState state)
protected boolean isSpanSelected(FoldingSpan span, int viewLine, int column, CaretPosition selectionStartVp, CaretPosition selectionEndVp)
span
- the spanviewLine
- the view line the span incolumn
- the view column the span start withselectionStartVp
- the view position of selection startselectionEndVp
- the view position of selection end
protected void paintPlainLine(Graphics g, int line, int visualLine, CaretPosition selectionStartVp, CaretPosition selectionEndVp, Font defaultFont, Color defaultColor, int x, int y)
protected int paintSyntaxLine(Graphics g, TokenMarker tokenMarker, int line, int viewLine, int start, int end, CaretPosition selectionStartVp, CaretPosition selectionEndVp, Font defaultFont, Color defaultColor, int x, int y, boolean paintHighlight)
protected void paintHighlight(Graphics g, int line, int viewLine, CaretPosition selectionStartVp, CaretPosition selectionEndVp, int y)
protected void paintLineHighlight(Graphics g, int line, int visualLine, CaretPosition selectionStartVp, CaretPosition selectionEndVp, int y)
protected void paintLineSelection(Graphics g, int visualLine, CaretPosition selectionStartVp, CaretPosition selectionEndVp, int y)
protected void paintBracketHighlight(Graphics g, int line, int y)
protected void paintCaret(Graphics g, int visualLine)
protected int getCaretStartY(int visualLine)
protected int getCaretHeight()
public int getLineHeight()
public CodeEditor getCodeEditor()
public int paintFoldedText(Graphics g, Font font, String text, int x, int y, FontMetrics fm)
public void paintColumnGuides(Graphics g, Rectangle rect)
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |