public class FieldView extends PlainView
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| Modifier and Type | Method and Description |
|---|---|
protected Shape |
adjustAllocation(Shape shape)
Vertically centers the single line of text within the
bounds of the input shape.
|
void |
changedUpdate(DocumentEvent ev,
Shape shape,
ViewFactory vf)
This method is called when attributes were changed in the
Document in a location that this view is responsible for.
|
protected FontMetrics |
getFontMetrics() |
float |
getPreferredSpan(int axis)
Returns the preferred span along the specified axis.
|
int |
getResizeWeight(int axis)
Returns the resize weight of this view.
|
void |
insertUpdate(DocumentEvent ev,
Shape shape,
ViewFactory vf)
This method is called when something is inserted into the Document
that this View is displaying.
|
Shape |
modelToView(int pos,
Shape a,
Position.Bias bias)
Maps a position in the document into the coordinate space of the View.
|
void |
paint(Graphics g,
Shape s) |
void |
removeUpdate(DocumentEvent ev,
Shape shape,
ViewFactory vf)
This method is called when something is removed from the Document
that this View is displaying.
|
int |
viewToModel(float fx,
float fy,
Shape a,
Position.Bias[] bias)
Maps coordinates from the
View's space into a position
in the document model. |
damageLineRange, drawLine, drawSelectedText, drawUnselectedText, getLineBuffer, getTabSize, lineToRect, nextTabStop, updateDamage, updateMetricsappend, breakView, createFragment, dump, 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, setSize, updateChildren, updateLayout, viewToModelprotected FontMetrics getFontMetrics()
protected Shape adjustAllocation(Shape shape)
shape and has a height of the
preferred span along the Y axis. Horizontal adjustment is done according
to the horizontalAligment property of the component that is rendered.shape - the shape within which the line is beeing centeredpublic float getPreferredSpan(int axis)
ViewgetPreferredSpan in class PlainViewaxis - the axispublic int getResizeWeight(int axis)
View0 or less
means this view is not resizeable. Positive values make the view
resizeable. The default implementation returns 0
unconditionally.getResizeWeight in class Viewaxis - the axispublic Shape modelToView(int pos, Shape a, Position.Bias bias) throws BadLocationException
ViewmodelToView in class PlainViewpos - the position of the character in the modela - the area that is occupied by the viewbias - either Position.Bias.Forward or
Position.Bias.Backward depending on the preferred
direction bias. If null this defaults to
Position.Bias.ForwardBadLocationException - if pos is invalidpublic void insertUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
PlainViewinsertUpdate in class PlainViewev - the DocumentEvent for the changes.shape - the allocation of the Viewvf - the ViewFactory used to rebuildpublic void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
PlainViewremoveUpdate in class PlainViewev - the DocumentEvent for the changes.shape - the allocation of the Viewvf - the ViewFactory used to rebuildpublic void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
PlainViewchangedUpdate in class PlainViewev - the DocumentEvent that describes the changeshape - the shape of the viewvf - the ViewFactory for creating child viewspublic int viewToModel(float fx, float fy, Shape a, Position.Bias[] bias)
PlainViewView's space into a position
in the document model.viewToModel in class PlainViewfx - the x coordinate in the view spacefy - the y coordinate in the view spacea - the allocation of this Viewbias - the bias to usex, y