|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.View
javax.swing.text.PlainView
de.hunsicker.jalopy.swing.syntax.SyntaxView
public final class SyntaxView
A Swing view implementation that colorizes lines of a SyntaxDocument using a TokenMarker. This class should not be used directly; a SyntaxEditorKit should be used instead.
Field Summary |
---|
Fields inherited from class javax.swing.text.PlainView |
---|
metrics |
Fields inherited from class javax.swing.text.View |
---|
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
---|---|
SyntaxView(javax.swing.text.Element elem)
Creates a new SyntaxView for painting the specified element. |
Method Summary | |
---|---|
void |
drawLine(int lineIndex,
java.awt.Graphics g,
int x,
int y)
Paints the specified line. |
protected java.awt.Color |
getDefaultColor()
Return default foreground colour |
java.awt.Rectangle |
lineToRect(java.awt.Shape a,
int aline)
redefined from PlainView private method to allow for redefinition of modelToView method |
java.awt.Shape |
modelToView(int pos,
java.awt.Shape a,
javax.swing.text.Position.Bias b)
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it. |
float |
nextTabStop(float x,
int tabOffset)
Returns the next tab stop position after a given reference position. |
int |
viewToModel(float fx,
float fy,
java.awt.Shape a,
javax.swing.text.Position.Bias[] bias)
Provides a mapping from the view coordinate space to the logical coordinate space of the model. |
Methods inherited from class javax.swing.text.PlainView |
---|
changedUpdate, damageLineRange, drawSelectedText, drawUnselectedText, getLineBuffer, getPreferredSpan, getTabSize, insertUpdate, paint, removeUpdate, setSize, updateDamage, updateMetrics |
Methods inherited from class javax.swing.text.View |
---|
append, 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, viewToModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SyntaxView(javax.swing.text.Element elem)
SyntaxView
for painting the specified element.
elem
- The elementMethod Detail |
---|
public void drawLine(int lineIndex, java.awt.Graphics g, int x, int y)
drawLine
in class javax.swing.text.PlainView
lineIndex
- The line numberg
- The graphics contextx
- The x co-ordinate where the line should be paintedy
- The y co-ordinate where the line should be paintedpublic java.awt.Rectangle lineToRect(java.awt.Shape a, int aline)
lineToRect
in class javax.swing.text.PlainView
a
- DOCUMENT ME!aline
- DOCUMENT ME!
public java.awt.Shape modelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b) throws javax.swing.text.BadLocationException
modelToView
in class javax.swing.text.PlainView
pos
- the position to convert >= 0a
- the allocated region to render intob
- DOCUMENT ME!
javax.swing.text.BadLocationException
- if the given position does not represent a valid
location in the associated documentView#modelToView
public float nextTabStop(float x, int tabOffset)
nextTabStop
in interface javax.swing.text.TabExpander
nextTabStop
in class javax.swing.text.PlainView
x
- the current position >= 0tabOffset
- the position within the text stream that the tab occurred at >=
0.
public int viewToModel(float fx, float fy, java.awt.Shape a, javax.swing.text.Position.Bias[] bias)
viewToModel
in class javax.swing.text.PlainView
fx
- the X coordinate >= 0fy
- the Y coordinate >= 0a
- the allocated region to render intobias
- DOCUMENT ME!
View#viewToModel
protected java.awt.Color getDefaultColor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |