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| Modifier and Type | Method and Description |
|---|---|
protected Shape |
adjustAllocation(Shape a)
调整给定视图的分配,以成为文本字段的一个合适的分配。
|
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, Position.Bias b)
提供从文档模型坐标空间到映射到它的视图的坐标空间的映射。
|
void |
paint(Graphics g, Shape a)
使用给定的渲染表面和表面上的区域。
|
void |
removeUpdate(DocumentEvent changes, Shape a, ViewFactory f)
给予通知,该视图是由该视图负责的位置中的某个文件被删除的。
|
int |
viewToModel(float fx, float fy, Shape a, Position.Bias[] bias)
从视图坐标空间提供一个映射到模型的逻辑坐标空间。
|
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(Element elem)
elem -元素
protected FontMetrics getFontMetrics()
protected Shape adjustAllocation(Shape a)
a -给视图的配置,这可能需要调整。
public void paint(Graphics g, Shape a)
paint 方法重写,继承类
PlainView
g -绘制表面使用
a -分配区域进行渲染
View.paint(java.awt.Graphics, java.awt.Shape)
public float getPreferredSpan(int axis)
getPreferredSpan 方法重写,继承类
PlainView
axis -可能是view.x_axis或view.y_axis
View.getPreferredSpan(int)
public int getResizeWeight(int axis)
getResizeWeight 方法重写,继承类
View
axis - view.x_axis或view.y_axis
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
modelToView 方法重写,继承类
PlainView
pos -位置转换> = 0
a -分配区域进行渲染
b -偏向前一个字符或下一个字符的偏移量表示,如果位置是两视图边界;
b将有以下值之一:
Position.Bias.ForwardPosition.Bias.BackwardBadLocationException -如果给定的位置不在相关文件表示一个有效的位置
View.modelToView(int, java.awt.Shape, javax.swing.text.Position.Bias)
public int viewToModel(float fx,
float fy,
Shape a,
Position.Bias[] bias)
viewToModel 方法重写,继承类
PlainView
fx - x坐标> = 0.0f
fy - Y坐标> = 0.0f
a -分配区域进行渲染
View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public void insertUpdate(DocumentEvent changes, Shape a, ViewFactory f)
insertUpdate 方法重写,继承类
PlainView
changes -从相关文档的变更信息
a -视图的当前配置
f -工厂用重建如果视图有孩子
View.insertUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
public void removeUpdate(DocumentEvent changes, Shape a, ViewFactory f)
removeUpdate 方法重写,继承类
PlainView
changes -从相关文档的变更信息
a -视图的当前配置
f -工厂用重建如果视图有孩子
View.removeUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.