public class IconView extends View
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 |
---|---|
float |
getAlignment(int axis)
沿着一个轴确定此视图所需的对齐方式。
|
float |
getPreferredSpan(int axis)
沿着一个轴确定该视图的首选跨度。
|
Shape |
modelToView(int pos, Shape a, Position.Bias b)
提供从文档模型坐标空间到映射到它的视图的坐标空间的映射。
|
void |
paint(Graphics g, Shape a)
油漆图标。
|
int |
viewToModel(float x, float y, Shape a, Position.Bias[] bias)
从视图坐标空间提供一个映射到模型的逻辑坐标空间。
|
append, breakView, changedUpdate, createFragment, forwardUpdate, forwardUpdateToView, getAttributes, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getResizeWeight, getStartOffset, getToolTipText, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, insertUpdate, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, removeUpdate, replace, setParent, setSize, updateChildren, updateLayout, viewToModel
public IconView(Element elem)
elem
的元素创建了一个视图
public void paint(Graphics g, Shape a)
paint
方法重写,继承类
View
g
-绘制表面使用
a
-分配区域进行渲染
View.paint(java.awt.Graphics, java.awt.Shape)
public float getPreferredSpan(int axis)
getPreferredSpan
方法重写,继承类
View
axis
-可能是view.x_axis或view.y_axis
IllegalArgumentException
-无效的轴
View.getPreferredSpan(int)
public float getAlignment(int axis)
getAlignment
方法重写,继承类
View
axis
-可能是view.x_axis或view.y_axis
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
modelToView
方法重写,继承类
View
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 x, float y, Shape a, Position.Bias[] bias)
viewToModel
方法重写,继承类
View
x
- x坐标> = 0
y
- Y坐标> = 0
a
-分配区域进行渲染
View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
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.