public class EditorView extends java.lang.Object implements TextDrawingCallback, Disposable, Dumpable, java.awt.event.HierarchyListener, VisibleAreaListener
Disposable.Parent
Constructor and Description |
---|
EditorView(EditorImpl editor) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Usually not invoked directly, see class javadoc.
|
void |
drawChars(java.awt.Graphics g,
char [] data,
int start,
int end,
int x,
int y,
java.awt.Color color,
FontInfo fontInfo)
Asks to draw symbols from
[start; end) range of given char array at given graphics buffer using given
font info and color. |
java.lang.String |
dumpState() |
int |
findNearestDirectionBoundary(int offset,
boolean lookForward)
Offset of nearest boundary (not equal to
offset ) on the same line is returned. |
int |
getAscent() |
int |
getBottomOverhang() |
int |
getCharHeight() |
int |
getDescent() |
int |
getLineHeight() |
int |
getMaxWidthInRange(int startOffset,
int endOffset) |
int |
getNominalLineHeight() |
float |
getPlainSpaceWidth() |
int |
getPreferredHeight() |
java.awt.Dimension |
getPreferredSize() |
int |
getPreferredWidth(int beginLine,
int endLine)
Returns preferred pixel width of the lines in range.
|
float |
getPrefixTextWidthInPixels() |
int |
getTabSize() |
int |
getTopOverhang() |
void |
hierarchyChanged(java.awt.event.HierarchyEvent e) |
void |
invalidateFoldRegionLayout(FoldRegion region) |
void |
invalidateRange(int startOffset,
int endOffset) |
boolean |
isAtBidiRunBoundary(VisualPosition visualPosition) |
boolean |
isRtlLocation(VisualPosition visualPosition) |
int |
logicalPositionToOffset(LogicalPosition pos) |
VisualPosition |
logicalToVisualPosition(LogicalPosition pos,
boolean beforeSoftWrap) |
LogicalPosition |
offsetToLogicalPosition(int offset) |
int |
offsetToVisualColumnInFoldRegion(FoldRegion region,
int offset,
boolean leanTowardsLargerOffsets) |
int |
offsetToVisualLine(int offset,
boolean beforeSoftWrap) |
VisualPosition |
offsetToVisualPosition(int offset,
boolean leanTowardsLargerOffsets,
boolean beforeSoftWrap) |
java.awt.geom.Point2D |
offsetToXY(int offset,
boolean leanTowardsLargerOffsets,
boolean beforeSoftWrap) |
void |
paint(java.awt.Graphics2D g) |
void |
reinitSettings() |
void |
repaintCarets() |
void |
reset()
Invoked when document might have changed, but no notifications were sent (for a hacky document in EditorTextFieldCellRenderer)
|
void |
setPrefix(java.lang.String prefixText,
TextAttributes attributes) |
void |
validateState() |
void |
visibleAreaChanged(VisibleAreaEvent e)
Called when the editor is scrolled or resized.
|
int |
visualColumnToOffsetInFoldRegion(FoldRegion region,
int visualColumn,
boolean leansRight) |
int |
visualLineToOffset(int visualLine) |
int |
visualLineToY(int line) |
int |
visualPositionToOffset(VisualPosition visualPosition) |
java.awt.geom.Point2D |
visualPositionToXY(VisualPosition pos) |
LogicalPosition |
visualToLogicalPosition(VisualPosition pos) |
VisualPosition |
xyToVisualPosition(java.awt.geom.Point2D p) |
int |
yToVisualLine(int y) |
public EditorView(EditorImpl editor)
public void dispose()
Disposable
dispose
in interface Disposable
public void hierarchyChanged(java.awt.event.HierarchyEvent e)
hierarchyChanged
in interface java.awt.event.HierarchyListener
public void visibleAreaChanged(VisibleAreaEvent e)
VisibleAreaListener
visibleAreaChanged
in interface VisibleAreaListener
e
- the event containing information about changes in the visible area of the editor.public int yToVisualLine(int y)
public int visualLineToY(int line)
public LogicalPosition offsetToLogicalPosition(int offset)
public int logicalPositionToOffset(LogicalPosition pos)
public VisualPosition logicalToVisualPosition(LogicalPosition pos, boolean beforeSoftWrap)
public LogicalPosition visualToLogicalPosition(VisualPosition pos)
public VisualPosition offsetToVisualPosition(int offset, boolean leanTowardsLargerOffsets, boolean beforeSoftWrap)
public int visualPositionToOffset(VisualPosition visualPosition)
public int offsetToVisualLine(int offset, boolean beforeSoftWrap)
public int visualLineToOffset(int visualLine)
public VisualPosition xyToVisualPosition(java.awt.geom.Point2D p)
public java.awt.geom.Point2D visualPositionToXY(VisualPosition pos)
public java.awt.geom.Point2D offsetToXY(int offset, boolean leanTowardsLargerOffsets, boolean beforeSoftWrap)
public void setPrefix(java.lang.String prefixText, TextAttributes attributes)
public float getPrefixTextWidthInPixels()
public void paint(java.awt.Graphics2D g)
public void repaintCarets()
public java.awt.Dimension getPreferredSize()
public int getPreferredWidth(int beginLine, int endLine)
This method is currently used only with "idea.true.smooth.scrolling" experimental option.
beginLine
- begin visual line (inclusive)endLine
- end visual line (exclusive), may be greater than the actual number of linespublic int getPreferredHeight()
public int getMaxWidthInRange(int startOffset, int endOffset)
public void reinitSettings()
public void invalidateRange(int startOffset, int endOffset)
public void reset()
public boolean isRtlLocation(VisualPosition visualPosition)
public boolean isAtBidiRunBoundary(VisualPosition visualPosition)
public int findNearestDirectionBoundary(int offset, boolean lookForward)
offset
) on the same line is returned. -1
is returned if
corresponding boundary is not found.public float getPlainSpaceWidth()
public int getNominalLineHeight()
public int getLineHeight()
public int getDescent()
public int getCharHeight()
public int getAscent()
public int getTopOverhang()
public int getBottomOverhang()
public int getTabSize()
public int offsetToVisualColumnInFoldRegion(FoldRegion region, int offset, boolean leanTowardsLargerOffsets)
public int visualColumnToOffsetInFoldRegion(FoldRegion region, int visualColumn, boolean leansRight)
public void invalidateFoldRegionLayout(FoldRegion region)
public void drawChars(java.awt.Graphics g, char [] data, int start, int end, int x, int y, java.awt.Color color, FontInfo fontInfo)
TextDrawingCallback
[start; end)
range of given char array at given graphics buffer using given
font info and color.drawChars
in interface TextDrawingCallback
g
- graphics buffer to usedata
- target symbols holderstart
- start offset within the symbols holder to use (inclusive)end
- end offset within the symbols holder to use (inclusive)x
- 'x'
coordinate to use as a start position at the given graphics buffery
- 'y'
coordinate to use as a start position at the given graphics buffercolor
- color to use during drawing target text at the given graphics bufferfontInfo
- font info to use during drawing target text at the given graphics bufferpublic void validateState()