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.