1. /*
  2. * @(#)IIOWriteWarningListener.java 1.19 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.imageio.event;
  8. import java.util.EventListener;
  9. import javax.imageio.ImageWriter;
  10. /**
  11. * An interface used by <code>ImageWriter</code> implementations to
  12. * notify callers of their image and thumbnail reading methods of
  13. * warnings (non-fatal errors). Fatal errors cause the relevant
  14. * read method to throw an <code>IIOException</code>.
  15. *
  16. * <p> Localization is handled by associating a <code>Locale</code>
  17. * with each <code>IIOWriteWarningListener</code> as it is registered
  18. * with an <code>ImageWriter</code>. It is up to the
  19. * <code>ImageWriter</code> to provide localized messages.
  20. *
  21. * @see javax.imageio.ImageWriter#addIIOWriteWarningListener
  22. * @see javax.imageio.ImageWriter#removeIIOWriteWarningListener
  23. *
  24. * @version 0.5
  25. */
  26. public interface IIOWriteWarningListener extends EventListener {
  27. /**
  28. * Reports the occurence of a non-fatal error in encoding. Encoding
  29. * will continue following the call to this method. The application
  30. * may choose to display a dialog, print the warning to the console,
  31. * ignore the warning, or take any other action it chooses.
  32. *
  33. * @param source the <code>ImageWriter</code> object calling this method.
  34. * @param imageIndex the index, starting with 0, of the image
  35. * generating the warning.
  36. * @param warning a <code>String</code> containing the warning.
  37. */
  38. void warningOccurred(ImageWriter source,
  39. int imageIndex,
  40. String warning);
  41. }