| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.swing.text.View
javax.swing.text.html.ImageView
public class ImageView
图像视图,用于支持 HTML <IMG> 标记。支持通过标记的 HEIGHT 和 WIDTH 属性进行缩放。如果不能加载图像,则将呈现任何通过 ALT 属性指定的文本。
 
虽然此类现在已经是 swing 的一部分,但它是从 1.4 版本才开始公开。
IconView| 字段摘要 | 
|---|
| 从类 javax.swing.text.View 继承的字段 | 
|---|
| BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS | 
| 从接口 javax.swing.SwingConstants 继承的字段 | 
|---|
| BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST | 
| 构造方法摘要 | |
|---|---|
| ImageView(Element elem)创建表示 IMG 元素的新视图。 | |
| 方法摘要 | |
|---|---|
|  void | changedUpdate(DocumentEvent e,
              Shape a,
              ViewFactory f)当 Elements 属性已更改时调用。 | 
|  float | getAlignment(int axis)确定此视图沿某个轴所需的调整值。 | 
|  String | getAltText()如果不能加载图像,则返回要显示的文本。 | 
|  AttributeSet | getAttributes()获取呈现时要使用的属性。 | 
|  Image | getImage()返回要呈现的图像。 | 
|  URL | getImageURL()返回图像源的 URL,如果不能确定图像源,则返回 null。 | 
|  Icon | getLoadingImageIcon()返回加载图像过程中要使用的图标。 | 
|  boolean | getLoadsSynchronously()如果图像应该在首次被请求时加载,则返回 true。 | 
|  Icon | getNoImageIcon()如果不能找到图像,则返回要使用的图标。 | 
|  float | getPreferredSpan(int axis)确定此视图沿某轴的首选区域。 | 
| protected  StyleSheet | getStyleSheet()获取 StyleSheet 的便捷方法。 | 
|  String | getToolTipText(float x,
               float y,
               Shape allocation)对于图像,工具提示文本来自于 ALT属性指定的文本。 | 
|  Shape | modelToView(int pos,
            Shape a,
            Position.Bias b)提供从文档模型坐标空间到所映射的视图坐标空间的映射。 | 
|  void | paint(Graphics g,
      Shape a)绘制 View。 | 
|  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)提供从视图坐标空间到该模型的逻辑坐标空间的映射。 | 
| 从类 java.lang.Object 继承的方法 | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| 构造方法详细信息 | 
|---|
public ImageView(Element elem)
elem - 要为其创建视图的元素| 方法详细信息 | 
|---|
public String getAltText()
HTML.Attribute.ALT 的 Elements 属性集获取的。
public URL getImageURL()
public Icon getNoImageIcon()
public Icon getLoadingImageIcon()
public Image getImage()
public void setLoadsSynchronously(boolean newValue)
newValue 为 true,则图像将在首次被请求时加载,否则将异步加载。默认是不同步加载,也即异步加载。
public boolean getLoadsSynchronously()
protected StyleSheet getStyleSheet()
public AttributeSet getAttributes()
View 中的 getAttributes
public String getToolTipText(float x,
                             float y,
                             Shape allocation)
ALT 属性指定的文本。对其进行重写以返回 getAltText。
View 中的 getToolTipTextJTextComponent.getToolTipText(java.awt.event.MouseEvent)protected void setPropertiesFromAttributes()
public void setParent(View parent)
View 中的 setParentparent - 新的父级,如果要从父级中移除视图,则为 null
public void changedUpdate(DocumentEvent e,
                          Shape a,
                          ViewFactory f)
View 中的 changedUpdatee - 发自关联文档的更改信息a - 视图的当前分配f - 视图有子级时用于重建的工厂 View#changedUpdate
public void paint(Graphics g,
                  Shape a)
View 中的 paintg - 要使用的呈现表面a - 分配的要在其中呈现的区域View.paint(java.awt.Graphics, java.awt.Shape)public float getPreferredSpan(int axis)
View 中的 getPreferredSpanaxis - 可以是 X_AXIS,也可以是 Y_AXIS
View.getPreferredSpan(int)public float getAlignment(int axis)
View 中的 getAlignmentaxis - 可以是 X_AXIS,也可以是 Y_AXIS
public Shape modelToView(int pos,
                         Shape a,
                         Position.Bias b)
                  throws BadLocationException
View 中的 modelToViewpos - 要转换的位置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)
View 中的 viewToModelx - X 坐标y - Y 坐标a - 要在其中呈现的分配区域
View.viewToModel(float, float, java.awt.Shape, javax.swing.text.Position.Bias[])
public void setSize(float width,
                    float height)
View 中的 setSizewidth - 宽度,其值 >= 0height - 高度,其值 >= 0| 
 | JavaTM Platform Standard Ed. 6 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。