Package kiyut.swing.text.xml
Class XMLView
- java.lang.Object
-
- javax.swing.text.View
-
- javax.swing.text.PlainView
-
- kiyut.swing.text.xml.XMLView
-
- All Implemented Interfaces:
SwingConstants,TabExpander
public class XMLView extends PlainView
View that uses the lexical information to determine the style characteristics of the text that it renders. This simply colorizes the various tokens and assumes a constant font family and size.- Author:
- KIYUT
-
-
Field Summary
Fields Modifier and Type Field Description protected XMLContextcontextprotected XMLScannerlexer-
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
Constructors Constructor Description XMLView(XMLContext context, Element elem)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddamageLineRange(int line0, int line1, Shape a, Component host)Override to handle multi line nodeprotected floatdrawUnselectedText(Graphics2D g, float x, float y, int p0, int p1)intgetTabSize()-
Methods inherited from class javax.swing.text.PlainView
changedUpdate, drawLine, drawLine, drawSelectedText, drawSelectedText, drawUnselectedText, getLineBuffer, getPreferredSpan, insertUpdate, lineToRect, modelToView, nextTabStop, paint, removeUpdate, setSize, updateDamage, 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
-
-
-
-
Field Detail
-
context
protected XMLContext context
-
lexer
protected XMLScanner lexer
-
-
Constructor Detail
-
XMLView
public XMLView(XMLContext context, Element elem)
-
-
Method Detail
-
getTabSize
public int getTabSize()
- Overrides:
getTabSizein classPlainView
-
drawUnselectedText
protected float drawUnselectedText(Graphics2D g, float x, float y, int p0, int p1) throws BadLocationException
- Overrides:
drawUnselectedTextin classPlainView- Throws:
BadLocationException
-
damageLineRange
protected void damageLineRange(int line0, int line1, Shape a, Component host)Override to handle multi line node- Overrides:
damageLineRangein classPlainView
-
-