feat(jdk8): move files to new folder to avoid resources compiled.
This commit is contained in:
170
jdkSrc/jdk8/javax/imageio/event/IIOReadProgressListener.java
Normal file
170
jdkSrc/jdk8/javax/imageio/event/IIOReadProgressListener.java
Normal file
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.imageio.event;
|
||||
|
||||
import java.util.EventListener;
|
||||
import javax.imageio.ImageReader;
|
||||
|
||||
/**
|
||||
* An interface used by <code>ImageReader</code> implementations to
|
||||
* notify callers of their image and thumbnail reading methods of
|
||||
* progress.
|
||||
*
|
||||
* <p> This interface receives general indications of decoding
|
||||
* progress (via the <code>imageProgress</code> and
|
||||
* <code>thumbnailProgress</code> methods), and events indicating when
|
||||
* an entire image has been updated (via the
|
||||
* <code>imageStarted</code>, <code>imageComplete</code>,
|
||||
* <code>thumbnailStarted</code> and <code>thumbnailComplete</code>
|
||||
* methods). Applications that wish to be informed of pixel updates
|
||||
* as they happen (for example, during progressive decoding), should
|
||||
* provide an <code>IIOReadUpdateListener</code>.
|
||||
*
|
||||
* @see IIOReadUpdateListener
|
||||
* @see javax.imageio.ImageReader#addIIOReadProgressListener
|
||||
* @see javax.imageio.ImageReader#removeIIOReadProgressListener
|
||||
*
|
||||
*/
|
||||
public interface IIOReadProgressListener extends EventListener {
|
||||
|
||||
/**
|
||||
* Reports that a sequence of read operations is beginning.
|
||||
* <code>ImageReader</code> implementations are required to call
|
||||
* this method exactly once from their
|
||||
* <code>readAll(Iterator)</code> method.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this method.
|
||||
* @param minIndex the index of the first image to be read.
|
||||
*/
|
||||
void sequenceStarted(ImageReader source, int minIndex);
|
||||
|
||||
/**
|
||||
* Reports that a sequence of read operations has completed.
|
||||
* <code>ImageReader</code> implementations are required to call
|
||||
* this method exactly once from their
|
||||
* <code>readAll(Iterator)</code> method.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this method.
|
||||
*/
|
||||
void sequenceComplete(ImageReader source);
|
||||
|
||||
/**
|
||||
* Reports that an image read operation is beginning. All
|
||||
* <code>ImageReader</code> implementations are required to call
|
||||
* this method exactly once when beginning an image read
|
||||
* operation.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this method.
|
||||
* @param imageIndex the index of the image being read within its
|
||||
* containing input file or stream.
|
||||
*/
|
||||
void imageStarted(ImageReader source, int imageIndex);
|
||||
|
||||
/**
|
||||
* Reports the approximate degree of completion of the current
|
||||
* <code>read</code> call of the associated
|
||||
* <code>ImageReader</code>.
|
||||
*
|
||||
* <p> The degree of completion is expressed as a percentage
|
||||
* varying from <code>0.0F</code> to <code>100.0F</code>. The
|
||||
* percentage should ideally be calculated in terms of the
|
||||
* remaining time to completion, but it is usually more practical
|
||||
* to use a more well-defined metric such as pixels decoded or
|
||||
* portion of input stream consumed. In any case, a sequence of
|
||||
* calls to this method during a given read operation should
|
||||
* supply a monotonically increasing sequence of percentage
|
||||
* values. It is not necessary to supply the exact values
|
||||
* <code>0</code> and <code>100</code>, as these may be inferred
|
||||
* by the callee from other methods.
|
||||
*
|
||||
* <p> Each particular <code>ImageReader</code> implementation may
|
||||
* call this method at whatever frequency it desires. A rule of
|
||||
* thumb is to call it around each 5 percent mark.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this method.
|
||||
* @param percentageDone the approximate percentage of decoding that
|
||||
* has been completed.
|
||||
*/
|
||||
void imageProgress(ImageReader source, float percentageDone);
|
||||
|
||||
/**
|
||||
* Reports that the current image read operation has completed.
|
||||
* All <code>ImageReader</code> implementations are required to
|
||||
* call this method exactly once upon completion of each image
|
||||
* read operation.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this
|
||||
* method.
|
||||
*/
|
||||
void imageComplete(ImageReader source);
|
||||
|
||||
/**
|
||||
* Reports that a thumbnail read operation is beginning. All
|
||||
* <code>ImageReader</code> implementations are required to call
|
||||
* this method exactly once when beginning a thumbnail read
|
||||
* operation.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this method.
|
||||
* @param imageIndex the index of the image being read within its
|
||||
* containing input file or stream.
|
||||
* @param thumbnailIndex the index of the thumbnail being read.
|
||||
*/
|
||||
void thumbnailStarted(ImageReader source,
|
||||
int imageIndex, int thumbnailIndex);
|
||||
|
||||
/**
|
||||
* Reports the approximate degree of completion of the current
|
||||
* <code>getThumbnail</code> call within the associated
|
||||
* <code>ImageReader</code>. The semantics are identical to those
|
||||
* of <code>imageProgress</code>.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this method.
|
||||
* @param percentageDone the approximate percentage of decoding that
|
||||
* has been completed.
|
||||
*/
|
||||
void thumbnailProgress(ImageReader source, float percentageDone);
|
||||
|
||||
/**
|
||||
* Reports that a thumbnail read operation has completed. All
|
||||
* <code>ImageReader</code> implementations are required to call
|
||||
* this method exactly once upon completion of each thumbnail read
|
||||
* operation.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this
|
||||
* method.
|
||||
*/
|
||||
void thumbnailComplete(ImageReader source);
|
||||
|
||||
/**
|
||||
* Reports that a read has been aborted via the reader's
|
||||
* <code>abort</code> method. No further notifications will be
|
||||
* given.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this
|
||||
* method.
|
||||
*/
|
||||
void readAborted(ImageReader source);
|
||||
}
|
||||
249
jdkSrc/jdk8/javax/imageio/event/IIOReadUpdateListener.java
Normal file
249
jdkSrc/jdk8/javax/imageio/event/IIOReadUpdateListener.java
Normal file
@@ -0,0 +1,249 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.imageio.event;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.EventListener;
|
||||
import javax.imageio.ImageReader;
|
||||
|
||||
/**
|
||||
* An interface used by <code>ImageReader</code> implementations to
|
||||
* notify callers of their image and thumbnail reading methods of
|
||||
* pixel updates.
|
||||
*
|
||||
* @see javax.imageio.ImageReader#addIIOReadUpdateListener
|
||||
* @see javax.imageio.ImageReader#removeIIOReadUpdateListener
|
||||
*
|
||||
*/
|
||||
public interface IIOReadUpdateListener extends EventListener {
|
||||
|
||||
/**
|
||||
* Reports that the current read operation is about to begin a
|
||||
* progressive pass. Readers of formats that support progressive
|
||||
* encoding should use this to notify clients when each pass is
|
||||
* completed when reading a progressively encoded image.
|
||||
*
|
||||
* <p> An estimate of the area that will be updated by the pass is
|
||||
* indicated by the <code>minX</code>, <code>minY</code>,
|
||||
* <code>width</code>, and <code>height</code> parameters. If the
|
||||
* pass is interlaced, that is, it only updates selected rows or
|
||||
* columns, the <code>periodX</code> and <code>periodY</code>
|
||||
* parameters will indicate the degree of subsampling. The set of
|
||||
* bands that may be affected is indicated by the value of
|
||||
* <code>bands</code>.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this
|
||||
* method.
|
||||
* @param theImage the <code>BufferedImage</code> being updated.
|
||||
* @param pass the number of the pass that is about to begin,
|
||||
* starting with 0.
|
||||
* @param minPass the index of the first pass that will be decoded.
|
||||
* @param maxPass the index of the last pass that will be decoded.
|
||||
* @param minX the X coordinate of the leftmost updated column
|
||||
* of pixels.
|
||||
* @param minY the Y coordinate of the uppermost updated row
|
||||
* of pixels.
|
||||
* @param periodX the horizontal spacing between updated pixels;
|
||||
* a value of 1 means no gaps.
|
||||
* @param periodY the vertical spacing between updated pixels;
|
||||
* a value of 1 means no gaps.
|
||||
* @param bands an array of <code>int</code>s indicating the the
|
||||
* set bands that may be updated.
|
||||
*/
|
||||
void passStarted(ImageReader source,
|
||||
BufferedImage theImage,
|
||||
int pass,
|
||||
int minPass, int maxPass,
|
||||
int minX, int minY,
|
||||
int periodX, int periodY,
|
||||
int[] bands);
|
||||
|
||||
/**
|
||||
* Reports that a given region of the image has been updated.
|
||||
* The application might choose to redisplay the specified area,
|
||||
* for example, in order to provide a progressive display effect,
|
||||
* or perform other incremental processing.
|
||||
*
|
||||
* <p> Note that different image format readers may produce
|
||||
* decoded pixels in a variety of different orders. Many readers
|
||||
* will produce pixels in a simple top-to-bottom,
|
||||
* left-to-right-order, but others may use multiple passes of
|
||||
* interlacing, tiling, etc. The sequence of updates may even
|
||||
* differ from call to call depending on network speeds, for
|
||||
* example. A call to this method does not guarantee that all the
|
||||
* specified pixels have actually been updated, only that some
|
||||
* activity has taken place within some subregion of the one
|
||||
* specified.
|
||||
*
|
||||
* <p> The particular <code>ImageReader</code> implementation may
|
||||
* choose how often to provide updates. Each update specifies
|
||||
* that a given region of the image has been updated since the
|
||||
* last update. A region is described by its spatial bounding box
|
||||
* (<code>minX</code>, <code>minY</code>, <code>width</code>, and
|
||||
* <code>height</code>); X and Y subsampling factors
|
||||
* (<code>periodX</code> and <code>periodY</code>); and a set of
|
||||
* updated bands (<code>bands</code>). For example, the update:
|
||||
*
|
||||
* <pre>
|
||||
* minX = 10
|
||||
* minY = 20
|
||||
* width = 3
|
||||
* height = 4
|
||||
* periodX = 2
|
||||
* periodY = 3
|
||||
* bands = { 1, 3 }
|
||||
* </pre>
|
||||
*
|
||||
* would indicate that bands 1 and 3 of the following pixels were
|
||||
* updated:
|
||||
*
|
||||
* <pre>
|
||||
* (10, 20) (12, 20) (14, 20)
|
||||
* (10, 23) (12, 23) (14, 23)
|
||||
* (10, 26) (12, 26) (14, 26)
|
||||
* (10, 29) (12, 29) (14, 29)
|
||||
* </pre>
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this method.
|
||||
* @param theImage the <code>BufferedImage</code> being updated.
|
||||
* @param minX the X coordinate of the leftmost updated column
|
||||
* of pixels.
|
||||
* @param minY the Y coordinate of the uppermost updated row
|
||||
* of pixels.
|
||||
* @param width the number of updated pixels horizontally.
|
||||
* @param height the number of updated pixels vertically.
|
||||
* @param periodX the horizontal spacing between updated pixels;
|
||||
* a value of 1 means no gaps.
|
||||
* @param periodY the vertical spacing between updated pixels;
|
||||
* a value of 1 means no gaps.
|
||||
* @param bands an array of <code>int</code>s indicating which
|
||||
* bands are being updated.
|
||||
*/
|
||||
void imageUpdate(ImageReader source,
|
||||
BufferedImage theImage,
|
||||
int minX, int minY,
|
||||
int width, int height,
|
||||
int periodX, int periodY,
|
||||
int[] bands);
|
||||
|
||||
/**
|
||||
* Reports that the current read operation has completed a
|
||||
* progressive pass. Readers of formats that support
|
||||
* progressive encoding should use this to notify clients when
|
||||
* each pass is completed when reading a progressively
|
||||
* encoded image.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this
|
||||
* method.
|
||||
* @param theImage the <code>BufferedImage</code> being updated.
|
||||
*
|
||||
* @see javax.imageio.ImageReadParam#setSourceProgressivePasses(int, int)
|
||||
*/
|
||||
void passComplete(ImageReader source, BufferedImage theImage);
|
||||
|
||||
/**
|
||||
* Reports that the current thumbnail read operation is about to
|
||||
* begin a progressive pass. Readers of formats that support
|
||||
* progressive encoding should use this to notify clients when
|
||||
* each pass is completed when reading a progressively encoded
|
||||
* thumbnail image.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this
|
||||
* method.
|
||||
* @param theThumbnail the <code>BufferedImage</code> thumbnail
|
||||
* being updated.
|
||||
* @param pass the number of the pass that is about to begin,
|
||||
* starting with 0.
|
||||
* @param minPass the index of the first pass that will be decoded.
|
||||
* @param maxPass the index of the last pass that will be decoded.
|
||||
* @param minX the X coordinate of the leftmost updated column
|
||||
* of pixels.
|
||||
* @param minY the Y coordinate of the uppermost updated row
|
||||
* of pixels.
|
||||
* @param periodX the horizontal spacing between updated pixels;
|
||||
* a value of 1 means no gaps.
|
||||
* @param periodY the vertical spacing between updated pixels;
|
||||
* a value of 1 means no gaps.
|
||||
* @param bands an array of <code>int</code>s indicating the the
|
||||
* set bands that may be updated.
|
||||
*
|
||||
* @see #passStarted
|
||||
*/
|
||||
void thumbnailPassStarted(ImageReader source,
|
||||
BufferedImage theThumbnail,
|
||||
int pass,
|
||||
int minPass, int maxPass,
|
||||
int minX, int minY,
|
||||
int periodX, int periodY,
|
||||
int[] bands);
|
||||
|
||||
/**
|
||||
* Reports that a given region of a thumbnail image has been updated.
|
||||
* The application might choose to redisplay the specified area,
|
||||
* for example, in order to provide a progressive display effect,
|
||||
* or perform other incremental processing.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this method.
|
||||
* @param theThumbnail the <code>BufferedImage</code> thumbnail
|
||||
* being updated.
|
||||
* @param minX the X coordinate of the leftmost updated column
|
||||
* of pixels.
|
||||
* @param minY the Y coordinate of the uppermost updated row
|
||||
* of pixels.
|
||||
* @param width the number of updated pixels horizontally.
|
||||
* @param height the number of updated pixels vertically.
|
||||
* @param periodX the horizontal spacing between updated pixels;
|
||||
* a value of 1 means no gaps.
|
||||
* @param periodY the vertical spacing between updated pixels;
|
||||
* a value of 1 means no gaps.
|
||||
* @param bands an array of <code>int</code>s indicating which
|
||||
* bands are being updated.
|
||||
*
|
||||
* @see #imageUpdate
|
||||
*/
|
||||
void thumbnailUpdate(ImageReader source,
|
||||
BufferedImage theThumbnail,
|
||||
int minX, int minY,
|
||||
int width, int height,
|
||||
int periodX, int periodY,
|
||||
int[] bands);
|
||||
|
||||
/**
|
||||
* Reports that the current thumbnail read operation has completed
|
||||
* a progressive pass. Readers of formats that support
|
||||
* progressive encoding should use this to notify clients when
|
||||
* each pass is completed when reading a progressively encoded
|
||||
* thumbnail image.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this
|
||||
* method.
|
||||
* @param theThumbnail the <code>BufferedImage</code> thumbnail
|
||||
* being updated.
|
||||
*
|
||||
* @see #passComplete
|
||||
*/
|
||||
void thumbnailPassComplete(ImageReader source, BufferedImage theThumbnail);
|
||||
}
|
||||
58
jdkSrc/jdk8/javax/imageio/event/IIOReadWarningListener.java
Normal file
58
jdkSrc/jdk8/javax/imageio/event/IIOReadWarningListener.java
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.imageio.event;
|
||||
|
||||
import java.util.EventListener;
|
||||
import javax.imageio.ImageReader;
|
||||
|
||||
/**
|
||||
* An interface used by <code>ImageReader</code> implementations to
|
||||
* notify callers of their image and thumbnail reading methods of
|
||||
* warnings (non-fatal errors). Fatal errors cause the relevant
|
||||
* read method to throw an <code>IIOException</code>.
|
||||
*
|
||||
* <p> Localization is handled by associating a <code>Locale</code>
|
||||
* with each <code>IIOReadWarningListener</code> as it is registered
|
||||
* with an <code>ImageReader</code>. It is up to the
|
||||
* <code>ImageReader</code> to provide localized messages.
|
||||
*
|
||||
* @see javax.imageio.ImageReader#addIIOReadWarningListener
|
||||
* @see javax.imageio.ImageReader#removeIIOReadWarningListener
|
||||
*
|
||||
*/
|
||||
public interface IIOReadWarningListener extends EventListener {
|
||||
|
||||
/**
|
||||
* Reports the occurrence of a non-fatal error in decoding. Decoding
|
||||
* will continue following the call to this method. The application
|
||||
* may choose to display a dialog, print the warning to the console,
|
||||
* ignore the warning, or take any other action it chooses.
|
||||
*
|
||||
* @param source the <code>ImageReader</code> object calling this method.
|
||||
* @param warning a <code>String</code> containing the warning.
|
||||
*/
|
||||
void warningOccurred(ImageReader source, String warning);
|
||||
}
|
||||
140
jdkSrc/jdk8/javax/imageio/event/IIOWriteProgressListener.java
Normal file
140
jdkSrc/jdk8/javax/imageio/event/IIOWriteProgressListener.java
Normal file
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.imageio.event;
|
||||
|
||||
import java.util.EventListener;
|
||||
import javax.imageio.ImageWriter;
|
||||
|
||||
/**
|
||||
* An interface used by <code>ImageWriter</code> implementations to notify
|
||||
* callers of their image writing methods of progress.
|
||||
*
|
||||
* @see javax.imageio.ImageWriter#write
|
||||
*
|
||||
*/
|
||||
public interface IIOWriteProgressListener extends EventListener {
|
||||
|
||||
/**
|
||||
* Reports that an image write operation is beginning. All
|
||||
* <code>ImageWriter</code> implementations are required to call
|
||||
* this method exactly once when beginning an image write
|
||||
* operation.
|
||||
*
|
||||
* @param source the <code>ImageWriter</code> object calling this
|
||||
* method.
|
||||
* @param imageIndex the index of the image being written within
|
||||
* its containing input file or stream.
|
||||
*/
|
||||
void imageStarted(ImageWriter source, int imageIndex);
|
||||
|
||||
/**
|
||||
* Reports the approximate degree of completion of the current
|
||||
* <code>write</code> call within the associated
|
||||
* <code>ImageWriter</code>.
|
||||
*
|
||||
* <p> The degree of completion is expressed as an index
|
||||
* indicating which image is being written, and a percentage
|
||||
* varying from <code>0.0F</code> to <code>100.0F</code>
|
||||
* indicating how much of the current image has been output. The
|
||||
* percentage should ideally be calculated in terms of the
|
||||
* remaining time to completion, but it is usually more practical
|
||||
* to use a more well-defined metric such as pixels decoded or
|
||||
* portion of input stream consumed. In any case, a sequence of
|
||||
* calls to this method during a given read operation should
|
||||
* supply a monotonically increasing sequence of percentage
|
||||
* values. It is not necessary to supply the exact values
|
||||
* <code>0</code> and <code>100</code>, as these may be inferred
|
||||
* by the callee from other methods.
|
||||
*
|
||||
* <p> Each particular <code>ImageWriter</code> implementation may
|
||||
* call this method at whatever frequency it desires. A rule of
|
||||
* thumb is to call it around each 5 percent mark.
|
||||
*
|
||||
* @param source the <code>ImageWriter</code> object calling this method.
|
||||
* @param percentageDone the approximate percentage of decoding that
|
||||
* has been completed.
|
||||
*/
|
||||
void imageProgress(ImageWriter source,
|
||||
float percentageDone);
|
||||
|
||||
/**
|
||||
* Reports that the image write operation has completed. All
|
||||
* <code>ImageWriter</code> implementations are required to call
|
||||
* this method exactly once upon completion of each image write
|
||||
* operation.
|
||||
*
|
||||
* @param source the <code>ImageWriter</code> object calling this method.
|
||||
*/
|
||||
void imageComplete(ImageWriter source);
|
||||
|
||||
/**
|
||||
* Reports that a thumbnail write operation is beginning. All
|
||||
* <code>ImageWriter</code> implementations are required to call
|
||||
* this method exactly once when beginning a thumbnail write
|
||||
* operation.
|
||||
*
|
||||
* @param source the <code>ImageWrite</code> object calling this method.
|
||||
* @param imageIndex the index of the image being written within its
|
||||
* containing input file or stream.
|
||||
* @param thumbnailIndex the index of the thumbnail being written.
|
||||
*/
|
||||
void thumbnailStarted(ImageWriter source,
|
||||
int imageIndex, int thumbnailIndex);
|
||||
|
||||
/**
|
||||
* Reports the approximate degree of completion of the current
|
||||
* thumbnail write within the associated <code>ImageWriter</code>.
|
||||
* The semantics are identical to those of
|
||||
* <code>imageProgress</code>.
|
||||
*
|
||||
* @param source the <code>ImageWriter</code> object calling this
|
||||
* method.
|
||||
* @param percentageDone the approximate percentage of decoding that
|
||||
* has been completed.
|
||||
*/
|
||||
void thumbnailProgress(ImageWriter source, float percentageDone);
|
||||
|
||||
/**
|
||||
* Reports that a thumbnail write operation has completed. All
|
||||
* <code>ImageWriter</code> implementations are required to call
|
||||
* this method exactly once upon completion of each thumbnail
|
||||
* write operation.
|
||||
*
|
||||
* @param source the <code>ImageWriter</code> object calling this
|
||||
* method.
|
||||
*/
|
||||
void thumbnailComplete(ImageWriter source);
|
||||
|
||||
/**
|
||||
* Reports that a write has been aborted via the writer's
|
||||
* <code>abort</code> method. No further notifications will be
|
||||
* given.
|
||||
*
|
||||
* @param source the <code>ImageWriter</code> object calling this
|
||||
* method.
|
||||
*/
|
||||
void writeAborted(ImageWriter source);
|
||||
}
|
||||
62
jdkSrc/jdk8/javax/imageio/event/IIOWriteWarningListener.java
Normal file
62
jdkSrc/jdk8/javax/imageio/event/IIOWriteWarningListener.java
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package javax.imageio.event;
|
||||
|
||||
import java.util.EventListener;
|
||||
import javax.imageio.ImageWriter;
|
||||
|
||||
/**
|
||||
* An interface used by <code>ImageWriter</code> implementations to
|
||||
* notify callers of their image and thumbnail reading methods of
|
||||
* warnings (non-fatal errors). Fatal errors cause the relevant
|
||||
* read method to throw an <code>IIOException</code>.
|
||||
*
|
||||
* <p> Localization is handled by associating a <code>Locale</code>
|
||||
* with each <code>IIOWriteWarningListener</code> as it is registered
|
||||
* with an <code>ImageWriter</code>. It is up to the
|
||||
* <code>ImageWriter</code> to provide localized messages.
|
||||
*
|
||||
* @see javax.imageio.ImageWriter#addIIOWriteWarningListener
|
||||
* @see javax.imageio.ImageWriter#removeIIOWriteWarningListener
|
||||
*
|
||||
*/
|
||||
public interface IIOWriteWarningListener extends EventListener {
|
||||
|
||||
/**
|
||||
* Reports the occurrence of a non-fatal error in encoding. Encoding
|
||||
* will continue following the call to this method. The application
|
||||
* may choose to display a dialog, print the warning to the console,
|
||||
* ignore the warning, or take any other action it chooses.
|
||||
*
|
||||
* @param source the <code>ImageWriter</code> object calling this method.
|
||||
* @param imageIndex the index, starting with 0, of the image
|
||||
* generating the warning.
|
||||
* @param warning a <code>String</code> containing the warning.
|
||||
*/
|
||||
void warningOccurred(ImageWriter source,
|
||||
int imageIndex,
|
||||
String warning);
|
||||
}
|
||||
Reference in New Issue
Block a user