- 所有已知的实现类:
AbstractButton,AbstractColorChooserPanel,Applet,BasicArrowButton,BasicComboBoxRenderer,BasicComboBoxRenderer.UIResource,BasicComboPopup,BasicInternalFrameTitlePane,BasicInternalFrameTitlePane.SystemMenuBar,BasicSplitPaneDivider,BasicToolBarUI.DragWindow,Box,Box.Filler,Button,Canvas,CellRendererPane,Checkbox,Choice,Component,Container,DefaultListCellRenderer,DefaultListCellRenderer.UIResource,DefaultTableCellRenderer,DefaultTableCellRenderer.UIResource,DefaultTreeCellEditor.DefaultTextField,DefaultTreeCellEditor.EditorContainer,DefaultTreeCellRenderer,Dialog,FileDialog,Frame,JApplet,JButton,JCheckBox,JCheckBoxMenuItem,JColorChooser,JComboBox,JComponent,JDesktopPane,JDialog,JEditorPane,JFileChooser,JFormattedTextField,JFrame,JInternalFrame,JInternalFrame.JDesktopIcon,JLabel,JLayer,JLayeredPane,JList,JMenu,JMenuBar,JMenuItem,JOptionPane,JPanel,JPasswordField,JPopupMenu,JPopupMenu.Separator,JProgressBar,JRadioButton,JRadioButtonMenuItem,JRootPane,JScrollBar,JScrollPane,JScrollPane.ScrollBar,JSeparator,JSlider,JSpinner,JSpinner.DateEditor,JSpinner.DefaultEditor,JSpinner.ListEditor,JSpinner.NumberEditor,JSplitPane,JTabbedPane,JTable,JTableHeader,JTextArea,JTextComponent,JTextField,JTextPane,JToggleButton,JToolBar,JToolBar.Separator,JToolTip,JTree,JViewport,JWindow,Label,List,MetalComboBoxButton,MetalComboBoxUI.MetalComboPopup,MetalFileChooserUI.FileRenderer,MetalFileChooserUI.FilterComboBoxRenderer,MetalInternalFrameTitlePane,MetalScrollButton,Panel,Scrollbar,ScrollPane,TextArea,TextComponent,TextField,Window
public interface ImageObserver
一个异步更新接口,用于在构建 Image 时接收有关 Image 信息的通知。
-
字段摘要
字段修饰符和类型Field描述static final intimageUpdate 的 infoflags 参数中的这个标志表示异步跟踪的图像在生产完成之前被中止。static final intimageUpdate 的 infoflags 参数中的这个标志表示之前绘制的静态图像现在已经完成并且可以以其最终形式再次绘制。static final intimageUpdate 的 infoflags 参数中的这个标志表示异步跟踪的图像遇到了错误。static final intimageUpdate 的 infoflags 参数中的这个标志表示以前绘制的多帧图像的另一个完整帧现在可以再次绘制。static final intimageUpdate 的 infoflags 参数中的此标志表示基础图像的高度现在可用,并且可以从 imageUpdate 回调方法的高度参数中获取。static final intimageUpdate 的 infoflags 参数中的这个标志表示图像的属性现在可用。static final intimageUpdate 的 infoflags 参数中的此标志表示绘制图像缩放变化所需的更多像素可用。static final intimageUpdate 的 infoflags 参数中的此标志表示基础图像的宽度现在可用,并且可以从 imageUpdate 回调方法的宽度参数中获取。 -
方法总结
修饰符和类型方法描述booleanimageUpdate(Image img, int infoflags, int x, int y, int width, int height) 当有关先前使用异步接口请求的图像的信息可用时,将调用此方法。
-
字段详细信息
-
WIDTH
static final int WIDTHimageUpdate 的 infoflags 参数中的此标志表示基础图像的宽度现在可用,并且可以从 imageUpdate 回调方法的宽度参数中获取。- 参见:
-
HEIGHT
static final int HEIGHTimageUpdate 的 infoflags 参数中的此标志表示基础图像的高度现在可用,并且可以从 imageUpdate 回调方法的高度参数中获取。- 参见:
-
PROPERTIES
static final int PROPERTIESimageUpdate 的 infoflags 参数中的这个标志表示图像的属性现在可用。- 参见:
-
SOMEBITS
static final int SOMEBITSimageUpdate 的 infoflags 参数中的此标志表示绘制图像缩放变化所需的更多像素可用。新像素的边界框可以从 imageUpdate 回调方法的 x、y、宽度和高度参数中获取。- 参见:
-
FRAMEBITS
static final int FRAMEBITSimageUpdate 的 infoflags 参数中的这个标志表示以前绘制的多帧图像的另一个完整帧现在可以再次绘制。应该忽略 imageUpdate 回调方法的 x、y、宽度和高度参数。- 参见:
-
ALLBITS
static final int ALLBITSimageUpdate 的 infoflags 参数中的这个标志表示之前绘制的静态图像现在已经完成并且可以以其最终形式再次绘制。应该忽略 imageUpdate 回调方法的 x、y、宽度和高度参数。- 参见:
-
ERROR
static final int ERRORimageUpdate 的 infoflags 参数中的这个标志表示异步跟踪的图像遇到了错误。没有进一步的信息可用,并且绘制图像将失败。为方便起见,ABORT 标志将同时显示,以指示图像生成已中止。- 参见:
-
ABORT
static final int ABORTimageUpdate 的 infoflags 参数中的这个标志表示异步跟踪的图像在生产完成之前被中止。如果不采取进一步行动来触发另一个图像生成序列,则不会有更多信息可用。如果 ERROR 标志也没有在此图像更新中设置,那么访问图像中的任何数据都将再次重新开始生产,可能是从头开始。- 参见:
-
-
方法详情
-
imageUpdate
当有关先前使用异步接口请求的图像的信息可用时,将调用此方法。异步接口是方法调用,例如 getWidth(ImageObserver) 和 drawImage(img, x, y, ImageObserver),它们将 ImageObserver 对象作为参数。这些方法将调用者注册为对有关整体图像本身的信息(在 getWidth(ImageObserver) 的情况下)或图像的输出版本(在 drawImage(img, x, y, [w, h,]ImageObserver)调用)。如果需要进一步更新,此方法应返回 true,如果已获取所需信息,则应返回 false。使用 img 参数传入被跟踪的图像。各种常量组合在一起形成 infoflags 参数,它指示有关图像的哪些信息现在可用。 x、y、宽度和高度参数的解释取决于 infoflags 参数的内容。
infoflags参数应该是按位包含的OR以下标志:WIDTH、HEIGHT、PROPERTIES、SOMEBITS、FRAMEBITS、ALLBITS、ERROR、ABORT。- 参数:
img- 正在观察的图像。infoflags- 以下标志的按位或运算:WIDTH、HEIGHT、PROPERTIES、SOMEBITS、FRAMEBITS、ALLBITS、ERROR、ABORT。x- 的x协调。y- 的y协调。width- 宽度。height- 身高。- 返回:
false如果信息标志表明图像已完全加载;true否则。- 参见:
-