java.lang.Object | +--javax.swing.text.View | +--javax.swing.text.PlainView | +--javax.swing.text.FieldView
Safe: Extends the multi-line plain text view to be suitable for a single-line editor view. If the view is allocated extra space, the field must adjust for it. If the hosting component is a JTextField, this view will manage the ranges of the associated BoundedRangeModel and will adjust the horizontal allocation to match the current visibility settings of the JTextField.
Viewfont, lineBuffer, longLine, metrics, sel0, sel1, selected, tabBase, tabSize, unselected
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, sharedBiasReturn, X_AXIS, Y_AXIS
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
protected Shape
adjustAllocation(Shape a)
(package private) Shape
adjustPaintRegion(Shape a)
a based on the visible region and returns it.
protected FontMetrics
getFontMetrics()
float
getPreferredSpan(int axis)
int
getResizeWeight(int axis)
void
insertUpdate(DocumentEvent changes,
Shape a,
ViewFactory f)
Shape
modelToView(int pos,
Shape a,
javax.swing.text.Position.Bias b)
void
paint(Graphics g,
Shape a)
void
removeUpdate(DocumentEvent changes,
Shape a,
ViewFactory f)
(package private) void
updateVisibilityModel()
int
viewToModel(float fx,
float fy,
Shape a,
javax.swing.text.Position.Bias[] bias)
changedUpdate, damageLineRange, drawLine, drawSelectedText, drawUnselectedText, getLineBuffer, getTabSize, lineToRect, nextTabStop, setSize, updateDamage, updateMetrics
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
public FieldView(Element elem)
elem - the elementprotected FontMetrics getFontMetrics()
protected Shape adjustAllocation(Shape a)
a - the allocation given to the view, which may need
to be adjusted.
void updateVisibilityModel()
public void paint(Graphics g, Shape a)
g - the rendering surface to usea - the allocated region to render intoView.paint(java.awt.Graphics, java.awt.Shape)Shape adjustPaintRegion(Shape a)
a based on the visible region and returns it.
adjustPaintRegion in class PlainViewpublic float getPreferredSpan(int axis)
getPreferredSpan in class PlainViewaxis - may be either View.X_AXIS or View.Y_AXIS
public int getResizeWeight(int axis)
getResizeWeight in class Viewaxis - View.X_AXIS or View.Y_AXIS
public Shape modelToView(int pos, Shape a, javax.swing.text.Position.Bias b) throws BadLocationException
modelToView in class PlainViewpos - the position to convert>= 0a - the allocated region to render into
BadLocationExceptionView.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)public int viewToModel(float fx, float fy, Shape a, javax.swing.text.Position.Bias[] bias)
viewToModel in class PlainViewfx - the X coordinate>= 0.0ffy - the Y coordinate>= 0.0fa - the allocated region to render into
View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])public void insertUpdate(DocumentEvent changes, Shape a, ViewFactory f)
insertUpdate in class PlainViewchanges - the change information from the associated documenta - the current allocation of the viewf - the factory to use to rebuild if the view has childrenView.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)public void removeUpdate(DocumentEvent changes, Shape a, ViewFactory f)
removeUpdate in class PlainViewchanges - the change information from the associated documenta - the current allocation of the viewf - the factory to use to rebuild if the view has childrenView.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)