public class FieldView extends PlainView
View
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXISBOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST| Constructor and Description |
|---|
FieldView(Element
Constructs a new FieldView wrapped on an element.
|
| Modifier and Type | Method and Description |
|---|---|
protected Shape |
adjustAllocation(Shape
Adjusts the allocation given to the view to be a suitable allocation for a text field.
|
protected FontMetrics |
getFontMetrics()
Fetches the font metrics associated with the component hosting this view.
|
float |
getPreferredSpan(int axis)
Determines the preferred span for this view along an axis.
|
int |
getResizeWeight(int axis)
Determines the resizability of the view along the given axis.
|
void |
insertUpdate(DocumentEvent
Gives notification that something was inserted into the document in a location that this view is responsible for.
|
Shape |
modelToView(int pos, Shape
Provides a mapping from the document model coordinate space to the coordinate space of the view mapped to it.
|
void |
paint(Graphics
Renders using the given rendering surface and area on that surface.
|
void |
removeUpdate(DocumentEvent
Gives notification that something was removed from the document in a location that this view is responsible for.
|
int |
viewToModel(float fx, float fy, Shape
Provides a mapping from the view coordinate space to the logical coordinate space of the model.
|
changedUpdate, damageLineRange, drawLine, drawSelectedText, drawUnselectedText, getLineBuffer, getTabSize, lineToRect, nextTabStop, setSize, updateDamage, updateMetricsappend, 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, viewToModelpublic FieldView(Elementelem)
elem - the element
protected FontMetricsgetFontMetrics()
protected ShapeadjustAllocation(Shape a)
a - the allocation given to the view, which may need to be adjusted.
public void paint(Graphicsg, Shape a)
paint in class
PlainView
g - the rendering surface to use
a - the allocated region to render into
View.paint(java.awt.Graphics, java.awt.Shape)
public float getPreferredSpan(int axis)
getPreferredSpan in class
PlainView
axis - may be either View.X_AXIS or View.Y_AXIS
View.getPreferredSpan(int)
public int getResizeWeight(int axis)
getResizeWeight in class
View
axis - View.X_AXIS or View.Y_AXIS
public ShapemodelToView(int pos, Shape a, Position .Bias b) throws BadLocationException
modelToView in class
PlainView
pos - the position to convert >= 0
a - the allocated region to render into
b - the bias toward the previous character or the next character represented by the offset, in case the position is a boundary of two views;
b will have one of these values:
Position.Bias.Forward Position.Bias.Backward BadLocationException - if the given position does not represent a valid location in the associated document
View.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)
public int viewToModel(float fx,
float fy,
Shape a,
Position.Bias [] bias)
viewToModel in class
PlainView
fx - the X coordinate >= 0.0f
fy - the Y coordinate >= 0.0f
a - the allocated region to render into
View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public void insertUpdate(DocumentEventchanges, Shape a, ViewFactory f)
insertUpdate in class
PlainView
changes - the change information from the associated document
a - the current allocation of the view
f - the factory to use to rebuild if the view has children
View.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void removeUpdate(DocumentEventchanges, Shape a, ViewFactory f)
removeUpdate in class
PlainView
changes - the change information from the associated document
a - the current allocation of the view
f - the factory to use to rebuild if the view has children
View.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)