java.awt.image

Interface ImageObserver

Known Implementing Classes:
AbstractAssertionGui, AbstractButton, AbstractColorChooserPanel, AbstractConfigGui, AbstractControllerGui, AbstractJMeterGuiComponent, AbstractPostProcessorGui, AbstractPreProcessorGui, AbstractSamplerGui, AbstractTimerGui, AbstractVisualizer, Applet, ArgumentsPanel, BasicArrowButton, BasicComboBoxRenderer, BasicComboBoxRenderer.UIResource, BasicComboPopup, BasicInternalFrameTitlePane, BasicInternalFrameTitlePane.SystemMenuBar, BasicSplitPaneDivider, BasicToolBarUI.DragWindow, BeanShellSamplerGui, Box, Box.Filler, BSFSamplerGui, Button, ButtonPanel, Canvas, CellRendererPane, ChartFrame, ChartPanel, Checkbox, Choice, CommentPanel, Component, Container, DefaultListCellRenderer, DefaultListCellRenderer.UIResource, DefaultTableCellRenderer, DefaultTableCellRenderer.UIResource, DefaultTreeCellEditor.DefaultTextField, DefaultTreeCellEditor.EditorContainer, DefaultTreeCellRenderer, Dialog, FileDialog, FileListPanel, FilePanel, FileReporter, Frame, FunctionHelper, GenericTestBeanCustomizer, GTKFileChooserUI.DirectoryCellRenderer, GTKFileChooserUI.FileCellRenderer, GTKFileChooserUI.FilterComboBoxRenderer, HorizontalPanel, HtmlPane, IfControllerPanel, JApplet, JasperDesignViewer, JasperViewer, JavaConfigGui, JavaTestSamplerGui, JButton, JCheckBox, JCheckBoxMenuItem, JColorChooser, JComboBox, JComponent, JDateField, JDesktopPane, JDialog, JEditorPane, JFileChooser, JFormattedTextField, JFrame, JInternalFrame, JInternalFrame.JDesktopIcon, JLabel, JLayeredPane, JList, JMenu, JMenuBar, JMenuItem, JMeterCellRenderer, JMeterMenuBar, JOptionPane, JPanel, JPasswordField, JPopupMenu, JPopupMenu.Separator, JProgressBar, JRadioButton, JRadioButtonMenuItem, JRDesignViewer, JRootPane, JRViewer, JRViewer.ImageMapPanel, JScrollBar, JScrollPane, JScrollPane.ScrollBar, JSeparator, JSlider, JSpinner, JSpinner.DateEditor, JSpinner.DefaultEditor, JSpinner.ListEditor, JSpinner.NumberEditor, JSplitPane, JTabbedPane, JTable, JTableHeader, JTextArea, JTextComponent, JTextField, JTextPane, JThermometer, JToggleButton, JToolBar, JToolBar.Separator, JToolTip, JTree, JUnitTestSamplerGui, JViewport, JWindow, Label, List, LogicControllerGui, LoginConfigGui, LoopControlPanel, MainFrame, MetalComboBoxButton, MetalComboBoxUI.MetalComboPopup, MetalFileChooserUI.FileRenderer, MetalFileChooserUI.FilterComboBoxRenderer, MetalInternalFrameTitlePane, MetalScrollButton, MotifComboBoxRenderer, MotifComboBoxRenderer.UIResource, MotifComboBoxUI.MotifComboPopup, MotifDesktopIconUI.IconButton, MotifDesktopIconUI.IconLabel, MotifFileChooserUI.DirectoryCellRenderer, MotifFileChooserUI.FileCellRenderer, MotifFileChooserUI.FilterComboBoxRenderer, MotifInternalFrameTitlePane, MotifScrollBarButton, MotifSplitPaneDivider, MotifTreeCellRenderer, NamePanel, ObsoleteGui, OnErrorPanel, PaletteSample, Panel, PolarChartPanel, REDemo, ResultActionGui, ResultSaverGui, RunTimeGui, SavePropertyDialog, Scrollbar, ScrollPane, SimpleConfigGui, StopWatchDisplay, SummariserGui, TestBeanGUI, TestPlanGui, TextArea, TextComponent, TextField, ThreadGroupGui, TransactionControllerGui, VerifierAppFrame, VerifyDialog, VerticalPanel, WhileControllerGui, Window, WindowsComboBoxUI.WindowsComboPopup, WindowsFileChooserUI.FileRenderer, WindowsFileChooserUI.FilterComboBoxRenderer, WindowsInternalFrameTitlePane, WindowsSplitPaneDivider, WindowsTreeUI.WindowsTreeCellRenderer, WorkBenchGui

public interface ImageObserver

An asynchronous update interface for receiving notifications about Image information as the Image is constructed.

Field Summary

static int
ABORT
This flag in the infoflags argument to imageUpdate indicates that an image which was being tracked asynchronously was aborted before production was complete.
static int
ALLBITS
This flag in the infoflags argument to imageUpdate indicates that a static image which was previously drawn is now complete and can be drawn again in its final form.
static int
ERROR
This flag in the infoflags argument to imageUpdate indicates that an image which was being tracked asynchronously has encountered an error.
static int
FRAMEBITS
This flag in the infoflags argument to imageUpdate indicates that another complete frame of a multi-frame image which was previously drawn is now available to be drawn again.
static int
HEIGHT
This flag in the infoflags argument to imageUpdate indicates that the height of the base image is now available and can be taken from the height argument to the imageUpdate callback method.
static int
PROPERTIES
This flag in the infoflags argument to imageUpdate indicates that the properties of the image are now available.
static int
SOMEBITS
This flag in the infoflags argument to imageUpdate indicates that more pixels needed for drawing a scaled variation of the image are available.
static int
WIDTH
This flag in the infoflags argument to imageUpdate indicates that the width of the base image is now available and can be taken from the width argument to the imageUpdate callback method.

Method Summary

boolean
imageUpdate(Image img, int infoflags, int x, int y, int width, int height)
This method is called when information about an image which was previously requested using an asynchronous interface becomes available.

Field Details

ABORT

public static final int ABORT
This flag in the infoflags argument to imageUpdate indicates that an image which was being tracked asynchronously was aborted before production was complete. No more information will become available without further action to trigger another image production sequence. If the ERROR flag was not also set in this image update, then accessing any of the data in the image will restart the production again, probably from the beginning.
Field Value:
128
Usages and Demos :

View More Examples of ImageObserver.ABORT
   1: 
   2:         while ( (is.checkSave() & ( ImageObserver.ALLBITS | ImageObserver.ABORT | ImageObserver.ERROR )) == 0 ) {
   3:             System.out.println("Waiting for save to finish!");
   4:             try { Thread.sleep(100); } 
   5:             catch ( InterruptedException e ) { System.exit(1); }

View Full Code Here
   1: 
   2:         while ( (is.checkSave() & ( ImageObserver.ALLBITS | ImageObserver.ABORT | ImageObserver.ERROR )) == 0 ) {
   3:             System.out.println("Waiting for save to finish!");
   4:             try { Thread.sleep(100); } 
   5:             catch ( InterruptedException e ) { System.exit(1); }

View Full Code Here
   1: 
   2:         while ( (is.checkSave() & ( ImageObserver.ALLBITS | ImageObserver.ABORT | ImageObserver.ERROR )) == 0 ) {
   3:             System.out.println("Waiting for save to finish!");
   4:             try { Thread.sleep(100); } 
   5:             catch ( InterruptedException e ) { System.exit(1); }

View Full Code Here
   1: 
   2:         while ( (is.checkSave() & ( ImageObserver.ALLBITS | ImageObserver.ABORT | ImageObserver.ERROR )) == 0 ) {
   3:             System.out.println("Waiting for save to finish!");
   4:             try { Thread.sleep(100); } 
   5:             catch ( InterruptedException e ) { System.exit(1); }

View Full Code Here
   1: 
   2:         while ( (is.checkSave() & ( ImageObserver.ALLBITS | ImageObserver.ABORT | ImageObserver.ERROR )) == 0 ) {
   3:             System.out.println("Waiting for save to finish!");
   4:             try { Thread.sleep(100); } 
   5:             catch ( InterruptedException e ) { System.exit(1); }

View Full Code Here

ALLBITS

public static final int ALLBITS
This flag in the infoflags argument to imageUpdate indicates that a static image which was previously drawn is now complete and can be drawn again in its final form. The x, y, width, and height arguments to the imageUpdate callback method should be ignored.
Field Value:
32
See Also:
java.awt.Graphics.drawImage, imageUpdate(Image,int,int,int,int,int)
Usages and Demos :

View More Examples of ImageObserver.ALLBITS
   1:   public boolean imageUpdate(Image img, int flags, int x,int y, int w,int h) {
   2:     return (flags&ImageObserver.ALLBITS)==0;
   3:   }
   4: 
   5:   public boolean paintAfter(Context cx, Node node) {

View Full Code Here
   1:             int height = delegate.getHeight(null);
   2:             observer.imageUpdate(this, ImageObserver.ALLBITS, 0, 0, width, height);
   3:         }
   4:         document.notifyNewImage(delegate);
   5:     }

View Full Code Here
   1:                 
   2:                 return (infoflags & ImageObserver.ALLBITS) != 0;
   3:             }
   4:             
   5:         };

View Full Code Here
   1:   {
   2:     return ImageObserver.ALLBITS;
   3: 
   4:   }

View Full Code Here
   1:       {
   2:          pending.add(new Pending(ImageObserver.ALLBITS, null, obs));
   3:          return false;
   4:         ...
   5:                return true;
   6:             case ImageObserver.ALLBITS:
   7:         ...
   8:                observer.imageUpdate(RemoteImage.this, ImageObserver.ALLBITS, 0, 0,
   9:                                     backing.getWidth(null), backing.getHeight(null));

View Full Code Here

ERROR

public static final int ERROR
This flag in the infoflags argument to imageUpdate indicates that an image which was being tracked asynchronously has encountered an error. No further information will become available and drawing the image will fail. As a convenience, the ABORT flag will be indicated at the same time to indicate that the image production was aborted.
Field Value:
64
Usages and Demos :

View More Examples of ImageObserver.ERROR
   1: 
   2:         while ( (is.checkSave() & ( ImageObserver.ALLBITS | ImageObserver.ABORT | ImageObserver.ERROR )) == 0 ) {
   3:             System.out.println("Waiting for save to finish!");
   4:             try { Thread.sleep(100); } 
   5:             catch ( InterruptedException e ) { System.exit(1); }

View Full Code Here
   1: 
   2:         while ( (is.checkSave() & ( ImageObserver.ALLBITS | ImageObserver.ABORT | ImageObserver.ERROR )) == 0 ) {
   3:             System.out.println("Waiting for save to finish!");
   4:             try { Thread.sleep(100); } 
   5:             catch ( InterruptedException e ) { System.exit(1); }

View Full Code Here
   1: 
   2:         while ( (is.checkSave() & ( ImageObserver.ALLBITS | ImageObserver.ABORT | ImageObserver.ERROR )) == 0 ) {
   3:             System.out.println("Waiting for save to finish!");
   4:             try { Thread.sleep(100); } 
   5:             catch ( InterruptedException e ) { System.exit(1); }

View Full Code Here
   1: 
   2:         while ( (is.checkSave() & ( ImageObserver.ALLBITS | ImageObserver.ABORT | ImageObserver.ERROR )) == 0 ) {
   3:             System.out.println("Waiting for save to finish!");
   4:             try { Thread.sleep(100); } 
   5:             catch ( InterruptedException e ) { System.exit(1); }

View Full Code Here
   1: 
   2:         while ( (is.checkSave() & ( ImageObserver.ALLBITS | ImageObserver.ABORT | ImageObserver.ERROR )) == 0 ) {
   3:             System.out.println("Waiting for save to finish!");
   4:             try { Thread.sleep(100); } 
   5:             catch ( InterruptedException e ) { System.exit(1); }

View Full Code Here

FRAMEBITS

public static final int FRAMEBITS
This flag in the infoflags argument to imageUpdate indicates that another complete frame of a multi-frame image which was previously drawn is now available to be drawn again. The x, y, width, and height arguments to the imageUpdate callback method should be ignored.
Field Value:
16
See Also:
java.awt.Graphics.drawImage, imageUpdate(Image,int,int,int,int,int)

HEIGHT

public static final int HEIGHT
This flag in the infoflags argument to imageUpdate indicates that the height of the base image is now available and can be taken from the height argument to the imageUpdate callback method.
Field Value:
2
Usages and Demos :

View More Examples of ImageObserver.HEIGHT
   1:          {
   2:             case ImageObserver.HEIGHT:
   3:                int height = backing.getHeight(observer);
   4:         ...
   5:                {
   6:                   observer.imageUpdate(RemoteImage.this, ImageObserver.HEIGHT,
   7:                                        0, 0, backing.getWidth(null), height);
   8:                }
   9:                return true;

View Full Code Here
   1:         availinfo |= (ImageObserver.WIDTH |
   2:                     ImageObserver.HEIGHT |
   3:                     ImageObserver.PROPERTIES);
   4:         ...
   5:         }
   6:         if ((availinfo & ImageObserver.HEIGHT) == 0) {
   7:         ...
   8:             reconstruct(ImageObserver.HEIGHT);
   9:         }

View Full Code Here
   1:   {
   2:     return ImageObserver.ALLBITS | ImageObserver.WIDTH | ImageObserver.HEIGHT;
   3:   }
   4: 

View Full Code Here
   1:     
   2:     saveStatus |= ImageObserver.WIDTH | ImageObserver.HEIGHT;
   3:     }
   4:     
   5:     public void setPixels(int x, int y, int w, int h,

View Full Code Here
   1:     
   2:     return ImageObserver.ALLBITS | ImageObserver.WIDTH | ImageObserver.HEIGHT;
   3:   }
   4:         ...
   5:   {
   6:     int flags = ImageObserver.HEIGHT | 
   7:       ImageObserver.WIDTH |
   8:       ImageObserver.PROPERTIES |
   9:       ImageObserver.ALLBITS;

View Full Code Here

PROPERTIES

public static final int PROPERTIES
This flag in the infoflags argument to imageUpdate indicates that the properties of the image are now available.
Field Value:
4
Usages and Demos :

View More Examples of ImageObserver.PROPERTIES
   1:          {
   2:             pending.add(new Pending(ImageObserver.PROPERTIES, name, observer));
   3:          }
   4:         ...
   5:                return true;
   6:             case ImageObserver.PROPERTIES:
   7:                Object property = backing.getProperty((String) otherInfo, observer);
   8:         ...
   9:                {
  10:                   observer.imageUpdate(RemoteImage.this, ImageObserver.PROPERTIES, 0, 0,
  11:                                        backing.getWidth(null), backing.getHeight(null));

View Full Code Here
   1:                     ImageObserver.HEIGHT |
   2:                     ImageObserver.PROPERTIES);
   3:         imagerep = makeImageRep();
   4:         ...
   5:                     ImageObserver.HEIGHT |
   6:                     ImageObserver.PROPERTIES)) != 0) {
   7:             addWatcher(iw, false);
   8:         ...
   9:         properties = props;
  10:         addInfo(ImageObserver.PROPERTIES);
  11:     }

View Full Code Here
   1:     public void setProperties(Hashtable props) {
   2:     saveStatus |= ImageObserver.PROPERTIES;
   3:     }
   4:     
   5:     public void setHints(int hintflags) {}

View Full Code Here
   1:       ImageObserver.WIDTH |
   2:       ImageObserver.PROPERTIES |
   3:       ImageObserver.ALLBITS;
   4: 
   5:     if (observers != null)

View Full Code Here
   1:     public void setProperties(Hashtable props) {
   2:     saveStatus |= ImageObserver.PROPERTIES;
   3:     }
   4:     
   5:     public void setHints(int hintflags) {}

View Full Code Here

SOMEBITS

public static final int SOMEBITS
This flag in the infoflags argument to imageUpdate indicates that more pixels needed for drawing a scaled variation of the image are available. The bounding box of the new pixels can be taken from the x, y, width, and height arguments to the imageUpdate callback method.
Field Value:
8
See Also:
java.awt.Graphics.drawImage, imageUpdate(Image,int,int,int,int,int)
Usages and Demos :

View More Examples of ImageObserver.SOMEBITS
   1:     
   2:     saveStatus |= ImageObserver.SOMEBITS;
   3:     }
   4:         ...
   5:     
   6:     saveStatus |= ImageObserver.SOMEBITS;
   7:     }
   8:     
   9:     public void imageComplete(int status) {

View Full Code Here
   1:     
   2:     saveStatus |= ImageObserver.SOMEBITS;
   3:     }
   4:         ...
   5:     
   6:     saveStatus |= ImageObserver.SOMEBITS;
   7:     }
   8:     
   9:     public void imageComplete(int status) {

View Full Code Here
   1:     
   2:     saveStatus |= ImageObserver.SOMEBITS;
   3:     }
   4:         ...
   5:     
   6:     saveStatus |= ImageObserver.SOMEBITS;
   7:     }
   8:     
   9:     public void imageComplete(int status) {

View Full Code Here
   1:     
   2:     saveStatus |= ImageObserver.SOMEBITS;
   3:     }
   4:     
   5:     public void imageComplete(int status) {

View Full Code Here
   1:     
   2:     saveStatus |= ImageObserver.SOMEBITS;
   3:     }
   4:         ...
   5:     
   6:     saveStatus |= ImageObserver.SOMEBITS;
   7:     }
   8:     
   9:     public void imageComplete(int status) {

View Full Code Here

WIDTH

public static final int WIDTH
This flag in the infoflags argument to imageUpdate indicates that the width of the base image is now available and can be taken from the width argument to the imageUpdate callback method.
Field Value:
1
Usages and Demos :

View More Examples of ImageObserver.WIDTH
   1:                return true;
   2:             case ImageObserver.WIDTH:
   3:                int width = backing.getWidth(observer);
   4:         ...
   5:                {
   6:                   observer.imageUpdate(RemoteImage.this, ImageObserver.WIDTH,
   7:                                        0, 0, width, backing.getHeight(null));
   8:                }
   9:                return true;

View Full Code Here
   1:         properties = new Hashtable();
   2:         availinfo |= (ImageObserver.WIDTH |
   3:                     ImageObserver.HEIGHT |
   4:         ...
   5:         }
   6:         if ((availinfo & ImageObserver.WIDTH) == 0) {
   7:         ...
   8:             reconstruct(ImageObserver.WIDTH);
   9:         }

View Full Code Here
   1:         height = h;
   2:         availinfo |= ImageObserver.WIDTH | ImageObserver.HEIGHT;
   3:     }
   4:         ...
   5:         boolean full) {
   6:         if (full && (availinfo & ImageObserver.WIDTH) != 0
   7:             && (availinfo & ImageObserver.HEIGHT) != 0) {
   8:         ...
   9:             if (((availinfo & ImageObserver.HEIGHT) == 0)
  10:                 || ((availinfo & ImageObserver.WIDTH) == 0)
  11:                 || (colormodel == null)) {

View Full Code Here
   1:   {
   2:     return ImageObserver.ALLBITS | ImageObserver.WIDTH | ImageObserver.HEIGHT;
   3:   }
   4: 

View Full Code Here
   1:     
   2:     saveStatus |= ImageObserver.WIDTH | ImageObserver.HEIGHT;
   3:     }
   4:     
   5:     public void setPixels(int x, int y, int w, int h,

View Full Code Here

Method Details

imageUpdate

public boolean imageUpdate(Image img,
                           int infoflags,
                           int x,
                           int y,
                           int width,
                           int height)
This method is called when information about an image which was previously requested using an asynchronous interface becomes available. Asynchronous interfaces are method calls such as getWidth(ImageObserver) and drawImage(img, x, y, ImageObserver) which take an ImageObserver object as an argument. Those methods register the caller as interested either in information about the overall image itself (in the case of getWidth(ImageObserver)) or about an output version of an image (in the case of the drawImage(img, x, y, [w, h,] ImageObserver) call).

This method should return true if further updates are needed or false if the required information has been acquired. The image which was being tracked is passed in using the img argument. Various constants are combined to form the infoflags argument which indicates what information about the image is now available. The interpretation of the x, y, width, and height arguments depends on the contents of the infoflags argument.

The infoflags argument should be the bitwise inclusive OR of the following flags: WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT.

Parameters:
img - the image being observed.
infoflags - the bitwise inclusive OR of the following flags: WIDTH, HEIGHT, PROPERTIES, SOMEBITS, FRAMEBITS, ALLBITS, ERROR, ABORT.
x - the x coordinate.
y - the y coordinate.
width - the width.
height - the height.
Returns:
false if the infoflags indicate that the image is completely loaded; true otherwise.
Usages and Demos :

View More Examples of imageUpdate(Image img,int infoflags,int x,int y,int width,int height)
   1: import java.awt.Image;
   2: import java.awt.image.ImageObserver;
   3: import java.awt.image.ImageProducer;
   4:         ...
   5: 
   6:     private void addObserver(ImageObserver observer)
   7:     {
   8:         ...
   9:         {
  10:             ImageObserver observer = (ImageObserver) observers.get(i);
  11:             int width = delegate.getWidth(null);
  12:         ...
  13:             int height = delegate.getHeight(null);
  14:             observer.imageUpdate(this, ImageObserver.ALLBITS, 0, 0, width, height);

View Full Code Here
   1: import java.awt.image.BufferedImage;
   2: import java.awt.image.ImageObserver;
   3: import java.io.ByteArrayInputStream;
   4:         ...
   5:    
   6:    public void getImage(final ImageObserver obs, final int ID,
   7:          final int w, final int h, final int type)
   8:         ...
   9:                Image img = getImage(ID, w, h, type);
  10:                obs.imageUpdate(img, ImageObserver.ALLBITS, 0, 0, w, h);
  11:             }
  12:         ...
  13:                ex.printStackTrace();
  14:                obs.imageUpdate(null, 0, 0, 0, 0, 0);

View Full Code Here