public class FieldView extends PlainView
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS| Modifier and Type | Method and Description |
|---|---|
protected java.awt.Shape |
adjustAllocation(java.awt.Shape shape)
Vertically centers the single line of text within the
bounds of the input shape.
|
void |
changedUpdate(javax.swing.event.DocumentEvent ev,
java.awt.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 java.awt.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(javax.swing.event.DocumentEvent ev,
java.awt.Shape shape,
ViewFactory vf)
This method is called when something is inserted into the Document
that this View is displaying.
|
java.awt.Shape |
modelToView(int pos,
java.awt.Shape a,
Position.Bias bias)
Maps a position in the document into the coordinate space of the View.
|
void |
paint(java.awt.Graphics g,
java.awt.Shape s) |
void |
removeUpdate(javax.swing.event.DocumentEvent ev,
java.awt.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,
java.awt.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 java.awt.FontMetrics getFontMetrics()
protected java.awt.Shape adjustAllocation(java.awt.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 java.awt.Shape modelToView(int pos, java.awt.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(javax.swing.event.DocumentEvent ev, java.awt.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(javax.swing.event.DocumentEvent ev, java.awt.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(javax.swing.event.DocumentEvent ev, java.awt.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, java.awt.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