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.Forward Position.Bias.Backward BadLocationException - 如果给定的位置不表示相关文档中的有效位置
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.