|
|||||||||
| 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
kawigi.editor.GenericView
kawigi.editor.VBView
public class VBView
Implementation of a Visual Basic implementation of a View that hilights syntax attributes.
| Field Summary | |
|---|---|
protected static java.util.Hashtable<java.lang.String,java.awt.Color> |
colorHash
A map from token to its color. |
| Fields inherited from class kawigi.editor.GenericView |
|---|
classColor, commentColor, directiveColor, highlightKey1, highlightKey2, keywordColor, lineIndex, operatorColor, parseIndex, stringColor, tagColor, typeColor |
| 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 | |
|---|---|
VBView(javax.swing.text.Element e)
Creates an instance of VBView and passes along the Element. |
|
| Method Summary | |
|---|---|
protected int |
drawSelectedText(java.awt.Graphics g,
int x,
int y,
int p0,
int p1)
Overridden from PlainView - this method gets called to render every element of selected text, so that I could change how it's displayed if I want. |
protected int |
drawTabbedText(java.lang.String s,
int x,
int y,
java.awt.Graphics g,
int startOffset,
boolean selected)
Renders the text segment onto the given Grapnics context. |
protected int |
drawUnselectedText(java.awt.Graphics g,
int x,
int y,
int p0,
int p1)
Overridden from PlainView - this method gets called to render every element of unselected text. |
protected void |
findIntervals(java.util.ArrayList<Interval> list,
java.lang.String text,
java.lang.String[] startEnd,
boolean block)
Helper function to help with getIntervals. |
protected Interval |
findName(java.lang.String text,
int index,
int startline,
int endline,
int endindex,
java.lang.String[] startEnd,
boolean block)
Searches for a String identifier for a block in the text after the block start token. |
protected java.awt.Color |
getColor(java.lang.String word)
Returns the color to use on the given token. |
java.util.ArrayList<Interval> |
getIntervals()
Returns an ArrayList of Interval objects
representing code block intervals in the document. |
static void |
initColors()
Initializes the keywords/tokens and their colors. |
| Methods inherited from class kawigi.editor.GenericView |
|---|
getColors, getTabSize, paint, readKeywords, resetTabStop, updateDamage |
| Methods inherited from class javax.swing.text.PlainView |
|---|
changedUpdate, damageLineRange, drawLine, getLineBuffer, getPreferredSpan, insertUpdate, lineToRect, modelToView, nextTabStop, removeUpdate, setSize, updateMetrics, viewToModel |
| 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 |
| Field Detail |
|---|
protected static java.util.Hashtable<java.lang.String,java.awt.Color> colorHash
| Constructor Detail |
|---|
public VBView(javax.swing.text.Element e)
| Method Detail |
|---|
public static void initColors()
protected int drawUnselectedText(java.awt.Graphics g,
int x,
int y,
int p0,
int p1)
throws javax.swing.text.BadLocationException
drawUnselectedText in class javax.swing.text.PlainViewjavax.swing.text.BadLocationException
protected int drawSelectedText(java.awt.Graphics g,
int x,
int y,
int p0,
int p1)
throws javax.swing.text.BadLocationException
drawSelectedText in class javax.swing.text.PlainViewjavax.swing.text.BadLocationException
protected int drawTabbedText(java.lang.String s,
int x,
int y,
java.awt.Graphics g,
int startOffset,
boolean selected)
protected java.awt.Color getColor(java.lang.String word)
public java.util.ArrayList<Interval> getIntervals()
ArrayList of Interval objects
representing code block intervals in the document.
This version is specifically for finding blocks in the Visual Basic
language.
getIntervals in class GenericView
protected void findIntervals(java.util.ArrayList<Interval> list,
java.lang.String text,
java.lang.String[] startEnd,
boolean block)
getIntervals.
Puts the intervals into the list in an in-order traversal of blocks
between startEnd[0] and startEnd[1]. This is modified from the
C-syntax-based one in GenericView to work better with VB's string and
comment syntax.
findIntervals in class GenericView
protected Interval findName(java.lang.String text,
int index,
int startline,
int endline,
int endindex,
java.lang.String[] startEnd,
boolean block)
findName in class GenericView
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||