-
- 所有已知实现类:
-
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,JFXPanel,JInternalFrame,JInternalFrame.JDesktopIcon,JLabel,JLayer,JLayeredPane,JList,JMenu,JMenuBar,JMenuItem,JOptionPane,JPanel,JPasswordFieldJPasswordField,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异步更新界面用于在构建图像时接收关于图像信息的通知。
-
-
Field Summary
Fields Modifier and Type Field 描述 static intABORTimageUpdate的infoflags参数中的此标志表示在生成完成之前异步跟踪的图像已中止。static intALLBITSimageUpdate的infoflags参数中的此标志表示以前绘制的静态图像现在已完成,可以以其最终形式再次绘制。static intERRORimageUpdate的infoflags参数中的此标志表示正在异步跟踪的图像遇到错误。static intFRAMEBITSimageUpdate的infoflags参数中的此标志表示先前绘制的多帧图像的另一个完整帧现在可以再次绘制。static intHEIGHTimageUpdate的infoflags参数中的此标志表示基本图像的高度现在可用,可以从imageUpdate回调方法的height参数中获取。static intPROPERTIESimageUpdate的infoflags参数中的此标志表示图像的属性现在可用。static intSOMEBITSimageUpdate的infoflags参数中的此标志表示绘制图像缩放变体所需的更多像素可用。static intWIDTHimageUpdate的infoflags参数中的此标志表示基本图像的宽度现在可用,可以从imageUpdate回调方法的width参数中获取。
-
方法摘要
所有方法 接口方法 抽象方法 Modifier and Type 方法 描述 booleanimageUpdate(Image img, int infoflags, int x, int y, int width, int height)当先前使用异步接口请求的图像的信息变得可用时,将调用此方法。
-
-
-
字段详细信息
-
WIDTH
static final int WIDTH
imageUpdate的infoflags参数中的此标志表示基本图像的宽度现在可用,可以从imageUpdate回调方法的width参数中获取。
-
HEIGHT
static final int HEIGHT
imageUpdate的infoflags参数中的此标志表示基本图像的高度现在可用,可以从imageUpdate回调方法的height参数中获取。
-
PROPERTIES
static final int PROPERTIES
imageUpdate的infoflags参数中的此标志表示图像的属性现在可用。
-
SOMEBITS
static final int SOMEBITS
imageUpdate的infoflags参数中的此标志表示绘制图像缩放变体所需的更多像素可用。 新像素的边界框可以从imageUpdate回调方法的x,y,width和height参数中获取。
-
FRAMEBITS
static final int FRAMEBITS
imageUpdate的infoflags参数中的此标志表示先前绘制的多帧图像的另一个完整帧现在可以再次绘制。 应该忽略imageUpdate回调方法的x,y,width和height参数。
-
ALLBITS
static final int ALLBITS
imageUpdate的infoflags参数中的此标志表示以前绘制的静态图像现在已完成,可以以其最终形式再次绘制。 应该忽略imageUpdate回调方法的x,y,width和height参数。
-
ERROR
static final int ERROR
imageUpdate的infoflags参数中的此标志表示正在异步跟踪的图像遇到错误。 没有进一步的信息将可用,绘制图像将失败。 为方便起见,ABORT标志将同时显示,表示图像生产已中止。
-
ABORT
static final int ABORT
imageUpdate的infoflags参数中的此标志表示在生成完成之前异步跟踪的图像已中止。 没有更多的信息将可用,没有进一步的操作来触发另一个图像制作序列。 如果此图像更新中未设置ERROR标志,则访问图像中的任何数据将重新开始生产,可能从一开始。
-
-
方法详细信息
-
imageUpdate
boolean imageUpdate(Image img, int infoflags, int x, int y, int width, int height)
当先前使用异步接口请求的图像的信息变得可用时,将调用此方法。 异步接口是方法调用,例如getWidth(ImageObserver)和drawImage(img,x,y,ImageObserver),它将ImageObserver对象作为参数。 这些方法将调用者注册为关于整体图像本身的信息(在getWidth(ImageObserver)的情况下)或关于图像的输出版本(在drawImage(img,x,y,[w, h,] ImageObserver)调用)。如果需要进一步更新,则此方法应返回true,如果已获取所需信息,则返回false。 正在跟踪的图像使用img参数传入。 组合各种常数以形成infoflags参数,该参数指示关于图像的什么信息现在可用。 x,y,width和height参数的解释取决于infoflags参数的内容。
该
infoflags参数应该是按位下列标志的OR:WIDTH,HEIGHT,PROPERTIES,SOMEBITS,FRAMEBITS,ALLBITS,ERROR,ABORT。- 参数
-
img- 正在观察的图像。 -
infoflags-按位下列标志的OR:WIDTH,HEIGHT,PROPERTIES,SOMEBITS,FRAMEBITS,ALLBITS,ERROR,ABORT。 -
x- x坐标。 -
y- y坐标。 -
width- 宽度。 -
height- 高度。 - 结果
-
false如果infoflags指示图像被完全加载; 否则为true。 - 另请参见:
-
WIDTH,HEIGHT,PROPERTIES,SOMEBITS,FRAMEBITS,ALLBITS,ERROR,ABORT,Image.getWidth(java.awt.image.ImageObserver),Image.getHeight(java.awt.image.ImageObserver),Graphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)
-
-