org.jvnet.substance.text
Class SubstanceFieldView

java.lang.Object
  extended by javax.swing.text.View
      extended by javax.swing.text.PlainView
          extended by javax.swing.text.FieldView
              extended by org.jvnet.substance.text.SubstanceFieldView
All Implemented Interfaces:
javax.swing.SwingConstants, javax.swing.text.TabExpander

public class SubstanceFieldView
extends javax.swing.text.FieldView

Custom field view for painting text components with SubstanceTextPainter-based approach.

Author:
Kirill Grouchnikov

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
SubstanceFieldView(javax.swing.text.Element elem)
          Creates a new view.
 
Method Summary
protected  int drawSelectedText(java.awt.Graphics g, int x, int y, int p0, int p1)
           
protected  int drawUnselectedText(java.awt.Graphics g, int x, int y, int p0, int p1)
           
 
Methods inherited from class javax.swing.text.FieldView
adjustAllocation, getFontMetrics, getPreferredSpan, getResizeWeight, insertUpdate, modelToView, paint, removeUpdate, viewToModel
 
Methods inherited from class javax.swing.text.PlainView
changedUpdate, damageLineRange, drawLine, getLineBuffer, getTabSize, lineToRect, nextTabStop, 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, 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

SubstanceFieldView

public SubstanceFieldView(javax.swing.text.Element elem)
Creates a new view.

Parameters:
elem - Text element.
Method Detail

drawSelectedText

protected int drawSelectedText(java.awt.Graphics g,
                               int x,
                               int y,
                               int p0,
                               int p1)
                        throws javax.swing.text.BadLocationException
Overrides:
drawSelectedText in class javax.swing.text.PlainView
Throws:
javax.swing.text.BadLocationException

drawUnselectedText

protected int drawUnselectedText(java.awt.Graphics g,
                                 int x,
                                 int y,
                                 int p0,
                                 int p1)
                          throws javax.swing.text.BadLocationException
Overrides:
drawUnselectedText in class javax.swing.text.PlainView
Throws:
javax.swing.text.BadLocationException