public class FieldView extends PlainView
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, 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
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, updateMetrics
append, 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, viewToModel
protected 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)
View
getPreferredSpan
in class PlainView
axis
- the axispublic int getResizeWeight(int axis)
View
0
or less
means this view is not resizeable. Positive values make the view
resizeable. The default implementation returns 0
unconditionally.getResizeWeight
in class View
axis
- the axispublic Shape modelToView(int pos, Shape a, Position.Bias bias) throws BadLocationException
View
modelToView
in class PlainView
pos
- 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.Forward
BadLocationException
- if pos
is invalidpublic void insertUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
PlainView
insertUpdate
in class PlainView
ev
- the DocumentEvent for the changes.shape
- the allocation of the Viewvf
- the ViewFactory used to rebuildpublic void removeUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
PlainView
removeUpdate
in class PlainView
ev
- the DocumentEvent for the changes.shape
- the allocation of the Viewvf
- the ViewFactory used to rebuildpublic void changedUpdate(DocumentEvent ev, Shape shape, ViewFactory vf)
PlainView
changedUpdate
in class PlainView
ev
- 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)
PlainView
View
's space into a position
in the document model.viewToModel
in class PlainView
fx
- the x coordinate in the view spacefy
- the y coordinate in the view spacea
- the allocation of this View
bias
- the bias to usex, y