public class ImageView extends View
ALT
属性的任何文本都将呈现。
虽然这门课已经有一段时间了,现在,它是1.4的公众。
IconView
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 |
---|---|
void |
changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
当元素属性更改时调用。
|
float |
getAlignment(int axis)
沿着一个轴确定此视图所需的对齐方式。
|
String |
getAltText()
返回要显示的文本,如果图像不能加载。
|
AttributeSet |
getAttributes()
读取属性时要使用的渲染。
|
Image |
getImage()
返回要渲染的图像。
|
URL |
getImageURL()
返回图像源的网址,或无法确定它是否为空。
|
Icon |
getLoadingImageIcon()
返回在加载图像的过程中使用的图标。
|
boolean |
getLoadsSynchronously()
返回真,如果图像应加载时,首先要求。
|
Icon |
getNoImageIcon()
返回使用的图标,如果图像不能被发现。
|
float |
getPreferredSpan(int axis)
沿着一个轴确定该视图的首选跨度。
|
protected StyleSheet |
getStyleSheet()
把样式表的便捷方法。
|
String |
getToolTipText(float x, float y, Shape allocation)
对于图像的工具提示文本来自与
ALT 属性指定文本。
|
Shape |
modelToView(int pos, Shape a, Position.Bias b)
提供从文档模型坐标空间到映射到它的视图的坐标空间的映射。
|
void |
paint(Graphics g, Shape a)
画风景。
|
void |
setLoadsSynchronously(boolean newValue)
设置图像是如何加载的。
|
void |
setParent(View parent)
为此视图建立父视图。
|
protected void |
setPropertiesFromAttributes()
更新来自属性的任何缓存值。
|
void |
setSize(float width, float height)
设置视图的大小。
|
int |
viewToModel(float x, float y, Shape a, Position.Bias[] bias)
从视图坐标空间提供一个映射到模型的逻辑坐标空间。
|
append, breakView, createFragment, forwardUpdate, forwardUpdateToView, getBreakWeight, getChildAllocation, getContainer, getDocument, getElement, getEndOffset, getGraphics, getMaximumSpan, getMinimumSpan, getNextVisualPositionFrom, getParent, getResizeWeight, getStartOffset, getView, getViewCount, getViewFactory, getViewIndex, getViewIndex, insert, insertUpdate, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, removeUpdate, replace, updateChildren, updateLayout, viewToModel
public ImageView(Element elem)
elem
的元素创建了一个视图
public String getAltText()
HTML.Attribute.ALT
。
public URL getImageURL()
public Icon getNoImageIcon()
public Icon getLoadingImageIcon()
public Image getImage()
public void setLoadsSynchronously(boolean newValue)
newValue
是真的,我们的形象被加载时,首先要求,否则将异步加载。默认的是不加载同步,即加载图像异步。
public boolean getLoadsSynchronously()
protected StyleSheet getStyleSheet()
public AttributeSet getAttributes()
getAttributes
方法重写,继承类
View
public String getToolTipText(float x, float y, Shape allocation)
ALT
属性指定文本。这是重写返回
getAltText
。
getToolTipText
方法重写,继承类
View
JTextComponent.getToolTipText(java.awt.event.MouseEvent)
protected void setPropertiesFromAttributes()
public void setParent(View parent)
public void changedUpdate(DocumentEvent e, Shape a, ViewFactory f)
changedUpdate
方法重写,继承类
View
e
-从相关文档的变更信息
a
-视图的当前配置
f
-工厂用重建如果视图有孩子
View.changedUpdate(javax.swing.event.DocumentEvent, java.awt.Shape, javax.swing.text.ViewFactory)
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
-可能是x_axis或y_axis
View.getPreferredSpan(int)
public float getAlignment(int axis)
getAlignment
方法重写,继承类
View
axis
-可能是x_axis或y_axis
public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException
modelToView
方法重写,继承类
View
pos
的位置转换
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坐标
y
的Y坐标
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.