public class PasswordView extends FieldView
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
Constructor and Description |
---|
PasswordView(Element elem)
构造一个包含在元素上的新视图。
|
Modifier and Type | Method and Description |
---|---|
protected int |
drawEchoCharacter(Graphics g, int x, int y, char c)
呈现回音字符,或者用于显示密码字符的任何图形。
|
protected int |
drawSelectedText(Graphics g, int x, int y, int p0, int p1)
将模型中的给定范围渲染为所选文本。
|
protected int |
drawUnselectedText(Graphics g, int x, int y, int p0, int p1)
将模型中的给定范围呈现为正常未选择的文本。
|
float |
getPreferredSpan(int axis)
确定沿着轴的此视图的首选跨度。
|
Shape |
modelToView(int pos, Shape a, Position.Bias b)
提供从文档模型坐标空间映射到映射到它的视图的坐标空间的映射。
|
int |
viewToModel(float fx, float fy, Shape a, Position.Bias[] bias)
提供从视图坐标空间到模型的逻辑坐标空间的映射。
|
adjustAllocation, getFontMetrics, getResizeWeight, insertUpdate, paint, removeUpdate
changedUpdate, damageLineRange, drawLine, getLineBuffer, getTabSize, lineToRect, nextTabStop, setSize, updateDamage, updateMetrics
append, 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, viewToModel
public PasswordView(Element elem)
elem
- 元素
protected int drawUnselectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException
drawUnselectedText
在
PlainView
g
- 图形上下文
x
- 起始X坐标> = 0
y
- 起始Y坐标> = 0
p0
- 模型中的起始偏移量> = 0
p1
- 模型中的结束偏移量> = p0
BadLocationException
- 如果p0或p1超出范围
protected int drawSelectedText(Graphics g, int x, int y, int p0, int p1) throws BadLocationException
drawSelectedText
在
PlainView
g
- 图形上下文
x
- 起始X坐标> = 0
y
- 起始Y坐标> = 0
p0
- 模型中的起始偏移量> = 0
p1
- 模型中的结束偏移量> = p0
BadLocationException
- 如果p0或p1超出范围
protected int drawEchoCharacter(Graphics g, int x, int y, char c)
g
- 图形上下文
x
- 起始X坐标> = 0
y
- 起始Y坐标> = 0
c
- 回音字符
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
modelToView
在
FieldView
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
在
FieldView
fx
- X坐标> = 0.0f
fy
- Y坐标> = 0.0f
a
- 要分配的区域
View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public float getPreferredSpan(int axis)
getPreferredSpan
在
FieldView
axis
- 可以是View.X_AXIS或View.Y_AXIS
View.getPreferredSpan(int)
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.