public class ATERenderingView extends PlainView
| Modifier and Type | Class and Description |
|---|---|
class |
ATERenderingView.DisplayDelegateOperation
Class that knows how to render a portion of text given
an array of tokens fetched from a delegate object.
|
class |
ATERenderingView.DisplayOperation
Default class that knows how to render a portion of text
|
class |
ATERenderingView.ModelToViewOperation |
static interface |
ATERenderingView.TextOperation |
class |
ATERenderingView.ViewToModel |
| Modifier and Type | Field and Description |
|---|---|
static Color |
BACKGROUND_HIGHLIGHT_COLOR |
static Font |
DEFAULT_FONT |
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXISBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST| Constructor and Description |
|---|
ATERenderingView(Element elem,
ATEPanel textEditor) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyAttribute(Graphics g,
AttributeSet attribute)
This method applies an AttributeSet to a Graphics context
|
void |
close() |
protected void |
drawLine(int lineIndex,
Graphics g,
int x,
int y)
Renders a line of text, suppressing whitespace at the end
and expanding any tabs.
|
protected int |
drawSelectedText(Graphics g,
int x,
int y,
int p0,
int p1)
Renders the given range in the model as selected text.
|
protected int |
drawUnselectedText(Graphics g,
int x,
int y,
int p0,
int p1)
Renders the given range in the model as normal unselected
text.
|
protected Font |
getFontForAttribute(AttributeSet attribute)
Return the font given the specified attributes
|
Shape |
modelToView(int pos,
Shape a,
Position.Bias b)
Provides a mapping from the document model coordinate space
to the coordinate space of the view mapped to it.
|
void |
paint(Graphics g,
Shape a) |
protected int |
renderText(ATERenderingView.TextOperation action,
Graphics g,
int x,
int y,
int p0,
int p1)
This method renders the text using the token information to set up the display attribute
of each token.
|
protected void |
restore(Graphics g) |
protected void |
save(Graphics g) |
void |
setDelegate(ATERenderingViewDelegate delegate) |
int |
viewToModel(float fx,
float fy,
Shape a,
Position.Bias[] biasReturn)
Provides a mapping from the view coordinate space to the logical
coordinate space of the model.
|
changedUpdate, damageLineRange, getLineBuffer, getPreferredSpan, getTabSize, insertUpdate, lineToRect, nextTabStop, removeUpdate, setSize, updateDamage, updateMetricsappend, breakView, createFragment, forwardUpdate, forwardUpdateToView, getAlignment, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getResizeWeight, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, replace, setParent, updateChildren, updateLayout, viewToModelpublic static final Color BACKGROUND_HIGHLIGHT_COLOR
public static Font DEFAULT_FONT
public void setDelegate(ATERenderingViewDelegate delegate)
public void close()
protected void drawLine(int lineIndex,
Graphics g,
int x,
int y)
drawUnselectedText and
drawSelectedText so that the way selected and
unselected text are rendered can be customized.drawLine in class PlainViewlineIndex - the line to draw >= 0g - the Graphics contextx - the starting X position >= 0y - the starting Y position >= 0drawUnselectedText(java.awt.Graphics, int, int, int, int),
drawSelectedText(java.awt.Graphics, int, int, int, int)public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
modelToView in class PlainViewBadLocationExceptionpublic int viewToModel(float fx,
float fy,
Shape a,
Position.Bias[] biasReturn)
viewToModel in class PlainViewprotected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException
drawUnselectedText in class PlainViewg - the graphics contextx - the starting X coordinate >= 0y - the starting Y coordinate >= 0p0 - the beginning position in the model >= 0p1 - the ending position in the model >= 0BadLocationException - if the range is invalidprotected int drawSelectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException
drawSelectedText in class PlainViewg - the graphics contextx - the starting X coordinate >= 0y - the starting Y coordinate >= 0p0 - the beginning position in the model >= 0p1 - the ending position in the model >= 0BadLocationException - if the range is invalidprotected int renderText(ATERenderingView.TextOperation action, Graphics g, int x, int y, int p0, int p1) throws BadLocationException
BadLocationExceptionprotected void applyAttribute(Graphics g, AttributeSet attribute)
g - The graphic contextattribute - The attribute to applyprotected Font getFontForAttribute(AttributeSet attribute)
attribute - The font attributesprotected void save(Graphics g)
protected void restore(Graphics g)
Copyright © 2013. All rights reserved.