diff options
42 files changed, 4604 insertions, 33 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 1aa5263..924288c 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,149 @@ +2004-11-06 Mark Wielaard <mark@klomp.org> + + * Makefile.am: Add new javax.imageio files. + * Makefile.in: Regenerated. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/event/IIOReadProgressListener.java, + javax/imageio/event/IIOReadUpdateListener.java, + javax/imageio/event/IIOReadWarningListener.java, + javax/imageio/event/IIOWriteProgressListener.java, + javax/imageio/event/IIOWriteWarningListener.java, + javax/imageio/metadata/IIOMetadataFormat.java, + javax/imageio/stream/FileCacheImageInputStream.java, + javax/imageio/stream/FileCacheImageOutputStream.java, + javax/imageio/stream/ImageInputStreamImpl.java: + Import cleanup. + * javax/imageio/metadata/package.html: New file. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/spi/ImageReaderSpi.java + (isOwnReader): New method. + * javax/imageio/spi/ImageWriterSpi.java + (isOwnWriter): Likewise. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/ImageWriter.java + (convertImageMetadata): New abstract method. + (convertStreamMetadata): Likewise. + (write): Likewise. + * javax/imageio/stream/FileCacheImageInputStream.java + (close): Fixed setting of stream to null. + (checkStreamClosed): Throws IOException. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/stream/FileCacheImageInputStream.java, + javax/imageio/stream/FileCacheImageOutputStream.java, + javax/imageio/stream/FileImageInputStream.java, + javax/imageio/stream/FileImageOutputStream.java, + javax/imageio/stream/MemoryCacheImageInputStream.java, + javax/imageio/stream/MemoryCacheImageOutputStream.java: + New files. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/metadata/IIOInvalidTreeException.java, + javax/imageio/metadata/IIOMetadataFormatImpl.java, + javax/imageio/metadata/IIOMetadataNode.java: + New stub files. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/stream/ImageInputStreamImpl.java, + javax/imageio/stream/ImageOutputStreamImpl.java: + New files. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/ImageIO.java: + Added much new methods. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/ImageReader.java, + javax/imageio/ImageWriter.java, + javax/imageio/spi/ImageWriterSpi.java: + Add SOME new methods. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/IIOParam.java, + javax/imageio/ImageReadParam.java, + javax/imageio/ImageReader.java, + javax/imageio/ImageWriter.java: + Mostly implemented. + * javax/imageio/spi/ImageReaderSpi.java, + javax/imageio/spi/ImageWriterSpi.java: + New files. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/ImageWriteParam.java, + javax/imageio/metadata/IIOMetadataFormat.java: + Implemented. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/ImageTypeSpecifier.java: + Mostly implemented. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/metadata/IIOMetadata.java: + Mostly implemented. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/IIOImage.java, + javax/imageio/ImageReadParam.java, + javax/imageio/metadata/IIOMetadataController.java, + javax/imageio/metadata/IIOMetadataFormat.java: + New files. + * javax/imageio/stream/ImageOutputStream.java: + Implemented. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/IIOParam.java, + javax/imageio/IIOParamController.java, + javax/imageio/ImageTypeSpecifier.java, + javax/imageio/ImageWriteParam.java, + javax/imageio/metadata/IIOMetadata.java: + New files. + * javax/imageio/ImageTranscoder.java: + Implemented. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/spi/ImageInputStreamSpi.java, + javax/imageio/spi/ImageOutputStreamSpi.java: + Reworked import startments. + * javax/imageio/spi/ServiceRegistry.java: + Reworked import startments. Fixed XHTML in javadocs. + (ServiceRegistry): Added @param tag to javadoc. + * javax/imageio/stream/ImageInputStream.java + (mark): Doesn't throws IOException; + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/ImageIO.java: + New file. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/spi/IIORegistry.java + (static): Don't register ImageReaderSpi.class and + ImageWriterSpi.class yet. + +2004-11-06 Michael Koch <konqueror@gmx.de> + + * javax/imageio/spi/IIORegistry.java: + New file. + 2004-11-06 Noa Resare <noa@resare.com> * java/net/Socket.java (getPort): Return 0 instead of -1 on diff --git a/libjava/Makefile.am b/libjava/Makefile.am index e17bc95..9c39dec 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -1907,24 +1907,48 @@ javax/crypto/spec/RC2ParameterSpec.java \ javax/crypto/spec/RC5ParameterSpec.java \ javax/crypto/spec/SecretKeySpec.java \ javax/imageio/IIOException.java \ +javax/imageio/IIOImage.java \ +javax/imageio/IIOParam.java \ +javax/imageio/IIOParamController.java \ +javax/imageio/ImageIO.java \ +javax/imageio/ImageReadParam.java \ javax/imageio/ImageReader.java \ javax/imageio/ImageTranscoder.java \ +javax/imageio/ImageTypeSpecifier.java \ +javax/imageio/ImageWriteParam.java \ javax/imageio/ImageWriter.java \ javax/imageio/event/IIOReadProgressListener.java \ javax/imageio/event/IIOReadUpdateListener.java \ javax/imageio/event/IIOReadWarningListener.java \ javax/imageio/event/IIOWriteProgressListener.java \ javax/imageio/event/IIOWriteWarningListener.java \ +javax/imageio/metadata/IIOInvalidTreeException.java \ +javax/imageio/metadata/IIOMetadata.java \ +javax/imageio/metadata/IIOMetadataController.java \ +javax/imageio/metadata/IIOMetadataFormat.java \ +javax/imageio/metadata/IIOMetadataFormatImpl.java \ +javax/imageio/metadata/IIOMetadataNode.java \ javax/imageio/spi/IIOServiceProvider.java \ +javax/imageio/spi/IIORegistry.java \ javax/imageio/spi/ImageInputStreamSpi.java \ javax/imageio/spi/ImageOutputStreamSpi.java \ +javax/imageio/spi/ImageReaderSpi.java \ javax/imageio/spi/ImageReaderWriterSpi.java \ javax/imageio/spi/ImageTranscoderSpi.java \ javax/imageio/spi/RegisterableService.java \ javax/imageio/spi/ServiceRegistry.java \ +javax/imageio/spi/ImageWriterSpi.java \ +javax/imageio/stream/FileCacheImageInputStream.java \ +javax/imageio/stream/FileCacheImageOutputStream.java \ +javax/imageio/stream/FileImageInputStream.java \ +javax/imageio/stream/FileImageOutputStream.java \ javax/imageio/stream/IIOByteBuffer.java \ javax/imageio/stream/ImageInputStream.java \ +javax/imageio/stream/ImageInputStreamImpl.java \ javax/imageio/stream/ImageOutputStream.java \ +javax/imageio/stream/ImageOutputStreamImpl.java \ +javax/imageio/stream/MemoryCacheImageInputStream.java \ +javax/imageio/stream/MemoryCacheImageOutputStream.java \ javax/naming/directory/Attribute.java \ javax/naming/directory/AttributeInUseException.java \ javax/naming/directory/AttributeModificationException.java \ diff --git a/libjava/Makefile.in b/libjava/Makefile.in index 80361d6..8a23bcd 100644 --- a/libjava/Makefile.in +++ b/libjava/Makefile.in @@ -1944,24 +1944,47 @@ am__libgcj_la_SOURCES_DIST = prims.cc jni.cc exception.cc resolve.cc \ javax/crypto/spec/RC2ParameterSpec.java \ javax/crypto/spec/RC5ParameterSpec.java \ javax/crypto/spec/SecretKeySpec.java \ - javax/imageio/IIOException.java javax/imageio/ImageReader.java \ + javax/imageio/IIOException.java javax/imageio/IIOImage.java \ + javax/imageio/IIOParam.java \ + javax/imageio/IIOParamController.java \ + javax/imageio/ImageIO.java javax/imageio/ImageReadParam.java \ + javax/imageio/ImageReader.java \ javax/imageio/ImageTranscoder.java \ + javax/imageio/ImageTypeSpecifier.java \ + javax/imageio/ImageWriteParam.java \ javax/imageio/ImageWriter.java \ javax/imageio/event/IIOReadProgressListener.java \ javax/imageio/event/IIOReadUpdateListener.java \ javax/imageio/event/IIOReadWarningListener.java \ javax/imageio/event/IIOWriteProgressListener.java \ javax/imageio/event/IIOWriteWarningListener.java \ + javax/imageio/metadata/IIOInvalidTreeException.java \ + javax/imageio/metadata/IIOMetadata.java \ + javax/imageio/metadata/IIOMetadataController.java \ + javax/imageio/metadata/IIOMetadataFormat.java \ + javax/imageio/metadata/IIOMetadataFormatImpl.java \ + javax/imageio/metadata/IIOMetadataNode.java \ javax/imageio/spi/IIOServiceProvider.java \ + javax/imageio/spi/IIORegistry.java \ javax/imageio/spi/ImageInputStreamSpi.java \ javax/imageio/spi/ImageOutputStreamSpi.java \ + javax/imageio/spi/ImageReaderSpi.java \ javax/imageio/spi/ImageReaderWriterSpi.java \ javax/imageio/spi/ImageTranscoderSpi.java \ javax/imageio/spi/RegisterableService.java \ javax/imageio/spi/ServiceRegistry.java \ + javax/imageio/spi/ImageWriterSpi.java \ + javax/imageio/stream/FileCacheImageInputStream.java \ + javax/imageio/stream/FileCacheImageOutputStream.java \ + javax/imageio/stream/FileImageInputStream.java \ + javax/imageio/stream/FileImageOutputStream.java \ javax/imageio/stream/IIOByteBuffer.java \ javax/imageio/stream/ImageInputStream.java \ + javax/imageio/stream/ImageInputStreamImpl.java \ javax/imageio/stream/ImageOutputStream.java \ + javax/imageio/stream/ImageOutputStreamImpl.java \ + javax/imageio/stream/MemoryCacheImageInputStream.java \ + javax/imageio/stream/MemoryCacheImageOutputStream.java \ javax/naming/directory/Attribute.java \ javax/naming/directory/AttributeInUseException.java \ javax/naming/directory/AttributeModificationException.java \ @@ -3192,23 +3215,44 @@ am__objects_13 = javax/accessibility/Accessible.lo \ javax/crypto/spec/RC2ParameterSpec.lo \ javax/crypto/spec/RC5ParameterSpec.lo \ javax/crypto/spec/SecretKeySpec.lo \ - javax/imageio/IIOException.lo javax/imageio/ImageReader.lo \ - javax/imageio/ImageTranscoder.lo javax/imageio/ImageWriter.lo \ + javax/imageio/IIOException.lo javax/imageio/IIOImage.lo \ + javax/imageio/IIOParam.lo javax/imageio/IIOParamController.lo \ + javax/imageio/ImageIO.lo javax/imageio/ImageReadParam.lo \ + javax/imageio/ImageReader.lo javax/imageio/ImageTranscoder.lo \ + javax/imageio/ImageTypeSpecifier.lo \ + javax/imageio/ImageWriteParam.lo javax/imageio/ImageWriter.lo \ javax/imageio/event/IIOReadProgressListener.lo \ javax/imageio/event/IIOReadUpdateListener.lo \ javax/imageio/event/IIOReadWarningListener.lo \ javax/imageio/event/IIOWriteProgressListener.lo \ javax/imageio/event/IIOWriteWarningListener.lo \ + javax/imageio/metadata/IIOInvalidTreeException.lo \ + javax/imageio/metadata/IIOMetadata.lo \ + javax/imageio/metadata/IIOMetadataController.lo \ + javax/imageio/metadata/IIOMetadataFormat.lo \ + javax/imageio/metadata/IIOMetadataFormatImpl.lo \ + javax/imageio/metadata/IIOMetadataNode.lo \ javax/imageio/spi/IIOServiceProvider.lo \ + javax/imageio/spi/IIORegistry.lo \ javax/imageio/spi/ImageInputStreamSpi.lo \ javax/imageio/spi/ImageOutputStreamSpi.lo \ + javax/imageio/spi/ImageReaderSpi.lo \ javax/imageio/spi/ImageReaderWriterSpi.lo \ javax/imageio/spi/ImageTranscoderSpi.lo \ javax/imageio/spi/RegisterableService.lo \ javax/imageio/spi/ServiceRegistry.lo \ + javax/imageio/spi/ImageWriterSpi.lo \ + javax/imageio/stream/FileCacheImageInputStream.lo \ + javax/imageio/stream/FileCacheImageOutputStream.lo \ + javax/imageio/stream/FileImageInputStream.lo \ + javax/imageio/stream/FileImageOutputStream.lo \ javax/imageio/stream/IIOByteBuffer.lo \ javax/imageio/stream/ImageInputStream.lo \ + javax/imageio/stream/ImageInputStreamImpl.lo \ javax/imageio/stream/ImageOutputStream.lo \ + javax/imageio/stream/ImageOutputStreamImpl.lo \ + javax/imageio/stream/MemoryCacheImageInputStream.lo \ + javax/imageio/stream/MemoryCacheImageOutputStream.lo \ javax/naming/directory/Attribute.lo \ javax/naming/directory/AttributeInUseException.lo \ javax/naming/directory/AttributeModificationException.lo \ @@ -5699,24 +5743,48 @@ javax/crypto/spec/RC2ParameterSpec.java \ javax/crypto/spec/RC5ParameterSpec.java \ javax/crypto/spec/SecretKeySpec.java \ javax/imageio/IIOException.java \ +javax/imageio/IIOImage.java \ +javax/imageio/IIOParam.java \ +javax/imageio/IIOParamController.java \ +javax/imageio/ImageIO.java \ +javax/imageio/ImageReadParam.java \ javax/imageio/ImageReader.java \ javax/imageio/ImageTranscoder.java \ +javax/imageio/ImageTypeSpecifier.java \ +javax/imageio/ImageWriteParam.java \ javax/imageio/ImageWriter.java \ javax/imageio/event/IIOReadProgressListener.java \ javax/imageio/event/IIOReadUpdateListener.java \ javax/imageio/event/IIOReadWarningListener.java \ javax/imageio/event/IIOWriteProgressListener.java \ javax/imageio/event/IIOWriteWarningListener.java \ +javax/imageio/metadata/IIOInvalidTreeException.java \ +javax/imageio/metadata/IIOMetadata.java \ +javax/imageio/metadata/IIOMetadataController.java \ +javax/imageio/metadata/IIOMetadataFormat.java \ +javax/imageio/metadata/IIOMetadataFormatImpl.java \ +javax/imageio/metadata/IIOMetadataNode.java \ javax/imageio/spi/IIOServiceProvider.java \ +javax/imageio/spi/IIORegistry.java \ javax/imageio/spi/ImageInputStreamSpi.java \ javax/imageio/spi/ImageOutputStreamSpi.java \ +javax/imageio/spi/ImageReaderSpi.java \ javax/imageio/spi/ImageReaderWriterSpi.java \ javax/imageio/spi/ImageTranscoderSpi.java \ javax/imageio/spi/RegisterableService.java \ javax/imageio/spi/ServiceRegistry.java \ +javax/imageio/spi/ImageWriterSpi.java \ +javax/imageio/stream/FileCacheImageInputStream.java \ +javax/imageio/stream/FileCacheImageOutputStream.java \ +javax/imageio/stream/FileImageInputStream.java \ +javax/imageio/stream/FileImageOutputStream.java \ javax/imageio/stream/IIOByteBuffer.java \ javax/imageio/stream/ImageInputStream.java \ +javax/imageio/stream/ImageInputStreamImpl.java \ javax/imageio/stream/ImageOutputStream.java \ +javax/imageio/stream/ImageOutputStreamImpl.java \ +javax/imageio/stream/MemoryCacheImageInputStream.java \ +javax/imageio/stream/MemoryCacheImageOutputStream.java \ javax/naming/directory/Attribute.java \ javax/naming/directory/AttributeInUseException.java \ javax/naming/directory/AttributeModificationException.java \ @@ -12938,10 +13006,24 @@ javax/imageio/$(DEPDIR)/$(am__dirstamp): @: > javax/imageio/$(DEPDIR)/$(am__dirstamp) javax/imageio/IIOException.lo: javax/imageio/$(am__dirstamp) \ javax/imageio/$(DEPDIR)/$(am__dirstamp) +javax/imageio/IIOImage.lo: javax/imageio/$(am__dirstamp) \ + javax/imageio/$(DEPDIR)/$(am__dirstamp) +javax/imageio/IIOParam.lo: javax/imageio/$(am__dirstamp) \ + javax/imageio/$(DEPDIR)/$(am__dirstamp) +javax/imageio/IIOParamController.lo: javax/imageio/$(am__dirstamp) \ + javax/imageio/$(DEPDIR)/$(am__dirstamp) +javax/imageio/ImageIO.lo: javax/imageio/$(am__dirstamp) \ + javax/imageio/$(DEPDIR)/$(am__dirstamp) +javax/imageio/ImageReadParam.lo: javax/imageio/$(am__dirstamp) \ + javax/imageio/$(DEPDIR)/$(am__dirstamp) javax/imageio/ImageReader.lo: javax/imageio/$(am__dirstamp) \ javax/imageio/$(DEPDIR)/$(am__dirstamp) javax/imageio/ImageTranscoder.lo: javax/imageio/$(am__dirstamp) \ javax/imageio/$(DEPDIR)/$(am__dirstamp) +javax/imageio/ImageTypeSpecifier.lo: javax/imageio/$(am__dirstamp) \ + javax/imageio/$(DEPDIR)/$(am__dirstamp) +javax/imageio/ImageWriteParam.lo: javax/imageio/$(am__dirstamp) \ + javax/imageio/$(DEPDIR)/$(am__dirstamp) javax/imageio/ImageWriter.lo: javax/imageio/$(am__dirstamp) \ javax/imageio/$(DEPDIR)/$(am__dirstamp) javax/imageio/event/$(am__dirstamp): @@ -12965,6 +13047,30 @@ javax/imageio/event/IIOWriteProgressListener.lo: \ javax/imageio/event/IIOWriteWarningListener.lo: \ javax/imageio/event/$(am__dirstamp) \ javax/imageio/event/$(DEPDIR)/$(am__dirstamp) +javax/imageio/metadata/$(am__dirstamp): + @$(mkdir_p) javax/imageio/metadata + @: > javax/imageio/metadata/$(am__dirstamp) +javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp): + @$(mkdir_p) javax/imageio/metadata/$(DEPDIR) + @: > javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp) +javax/imageio/metadata/IIOInvalidTreeException.lo: \ + javax/imageio/metadata/$(am__dirstamp) \ + javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp) +javax/imageio/metadata/IIOMetadata.lo: \ + javax/imageio/metadata/$(am__dirstamp) \ + javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp) +javax/imageio/metadata/IIOMetadataController.lo: \ + javax/imageio/metadata/$(am__dirstamp) \ + javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp) +javax/imageio/metadata/IIOMetadataFormat.lo: \ + javax/imageio/metadata/$(am__dirstamp) \ + javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp) +javax/imageio/metadata/IIOMetadataFormatImpl.lo: \ + javax/imageio/metadata/$(am__dirstamp) \ + javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp) +javax/imageio/metadata/IIOMetadataNode.lo: \ + javax/imageio/metadata/$(am__dirstamp) \ + javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp) javax/imageio/spi/$(am__dirstamp): @$(mkdir_p) javax/imageio/spi @: > javax/imageio/spi/$(am__dirstamp) @@ -12974,12 +13080,17 @@ javax/imageio/spi/$(DEPDIR)/$(am__dirstamp): javax/imageio/spi/IIOServiceProvider.lo: \ javax/imageio/spi/$(am__dirstamp) \ javax/imageio/spi/$(DEPDIR)/$(am__dirstamp) +javax/imageio/spi/IIORegistry.lo: javax/imageio/spi/$(am__dirstamp) \ + javax/imageio/spi/$(DEPDIR)/$(am__dirstamp) javax/imageio/spi/ImageInputStreamSpi.lo: \ javax/imageio/spi/$(am__dirstamp) \ javax/imageio/spi/$(DEPDIR)/$(am__dirstamp) javax/imageio/spi/ImageOutputStreamSpi.lo: \ javax/imageio/spi/$(am__dirstamp) \ javax/imageio/spi/$(DEPDIR)/$(am__dirstamp) +javax/imageio/spi/ImageReaderSpi.lo: \ + javax/imageio/spi/$(am__dirstamp) \ + javax/imageio/spi/$(DEPDIR)/$(am__dirstamp) javax/imageio/spi/ImageReaderWriterSpi.lo: \ javax/imageio/spi/$(am__dirstamp) \ javax/imageio/spi/$(DEPDIR)/$(am__dirstamp) @@ -12992,21 +13103,48 @@ javax/imageio/spi/RegisterableService.lo: \ javax/imageio/spi/ServiceRegistry.lo: \ javax/imageio/spi/$(am__dirstamp) \ javax/imageio/spi/$(DEPDIR)/$(am__dirstamp) +javax/imageio/spi/ImageWriterSpi.lo: \ + javax/imageio/spi/$(am__dirstamp) \ + javax/imageio/spi/$(DEPDIR)/$(am__dirstamp) javax/imageio/stream/$(am__dirstamp): @$(mkdir_p) javax/imageio/stream @: > javax/imageio/stream/$(am__dirstamp) javax/imageio/stream/$(DEPDIR)/$(am__dirstamp): @$(mkdir_p) javax/imageio/stream/$(DEPDIR) @: > javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) +javax/imageio/stream/FileCacheImageInputStream.lo: \ + javax/imageio/stream/$(am__dirstamp) \ + javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) +javax/imageio/stream/FileCacheImageOutputStream.lo: \ + javax/imageio/stream/$(am__dirstamp) \ + javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) +javax/imageio/stream/FileImageInputStream.lo: \ + javax/imageio/stream/$(am__dirstamp) \ + javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) +javax/imageio/stream/FileImageOutputStream.lo: \ + javax/imageio/stream/$(am__dirstamp) \ + javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) javax/imageio/stream/IIOByteBuffer.lo: \ javax/imageio/stream/$(am__dirstamp) \ javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) javax/imageio/stream/ImageInputStream.lo: \ javax/imageio/stream/$(am__dirstamp) \ javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) +javax/imageio/stream/ImageInputStreamImpl.lo: \ + javax/imageio/stream/$(am__dirstamp) \ + javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) javax/imageio/stream/ImageOutputStream.lo: \ javax/imageio/stream/$(am__dirstamp) \ javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) +javax/imageio/stream/ImageOutputStreamImpl.lo: \ + javax/imageio/stream/$(am__dirstamp) \ + javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) +javax/imageio/stream/MemoryCacheImageInputStream.lo: \ + javax/imageio/stream/$(am__dirstamp) \ + javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) +javax/imageio/stream/MemoryCacheImageOutputStream.lo: \ + javax/imageio/stream/$(am__dirstamp) \ + javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) javax/naming/directory/$(am__dirstamp): @$(mkdir_p) javax/naming/directory @: > javax/naming/directory/$(am__dirstamp) @@ -17407,10 +17545,24 @@ mostlyclean-compile: -rm -f javax/crypto/spec/SecretKeySpec.lo -rm -f javax/imageio/IIOException.$(OBJEXT) -rm -f javax/imageio/IIOException.lo + -rm -f javax/imageio/IIOImage.$(OBJEXT) + -rm -f javax/imageio/IIOImage.lo + -rm -f javax/imageio/IIOParam.$(OBJEXT) + -rm -f javax/imageio/IIOParam.lo + -rm -f javax/imageio/IIOParamController.$(OBJEXT) + -rm -f javax/imageio/IIOParamController.lo + -rm -f javax/imageio/ImageIO.$(OBJEXT) + -rm -f javax/imageio/ImageIO.lo + -rm -f javax/imageio/ImageReadParam.$(OBJEXT) + -rm -f javax/imageio/ImageReadParam.lo -rm -f javax/imageio/ImageReader.$(OBJEXT) -rm -f javax/imageio/ImageReader.lo -rm -f javax/imageio/ImageTranscoder.$(OBJEXT) -rm -f javax/imageio/ImageTranscoder.lo + -rm -f javax/imageio/ImageTypeSpecifier.$(OBJEXT) + -rm -f javax/imageio/ImageTypeSpecifier.lo + -rm -f javax/imageio/ImageWriteParam.$(OBJEXT) + -rm -f javax/imageio/ImageWriteParam.lo -rm -f javax/imageio/ImageWriter.$(OBJEXT) -rm -f javax/imageio/ImageWriter.lo -rm -f javax/imageio/event/IIOReadProgressListener.$(OBJEXT) @@ -17423,26 +17575,60 @@ mostlyclean-compile: -rm -f javax/imageio/event/IIOWriteProgressListener.lo -rm -f javax/imageio/event/IIOWriteWarningListener.$(OBJEXT) -rm -f javax/imageio/event/IIOWriteWarningListener.lo + -rm -f javax/imageio/metadata/IIOInvalidTreeException.$(OBJEXT) + -rm -f javax/imageio/metadata/IIOInvalidTreeException.lo + -rm -f javax/imageio/metadata/IIOMetadata.$(OBJEXT) + -rm -f javax/imageio/metadata/IIOMetadata.lo + -rm -f javax/imageio/metadata/IIOMetadataController.$(OBJEXT) + -rm -f javax/imageio/metadata/IIOMetadataController.lo + -rm -f javax/imageio/metadata/IIOMetadataFormat.$(OBJEXT) + -rm -f javax/imageio/metadata/IIOMetadataFormat.lo + -rm -f javax/imageio/metadata/IIOMetadataFormatImpl.$(OBJEXT) + -rm -f javax/imageio/metadata/IIOMetadataFormatImpl.lo + -rm -f javax/imageio/metadata/IIOMetadataNode.$(OBJEXT) + -rm -f javax/imageio/metadata/IIOMetadataNode.lo + -rm -f javax/imageio/spi/IIORegistry.$(OBJEXT) + -rm -f javax/imageio/spi/IIORegistry.lo -rm -f javax/imageio/spi/IIOServiceProvider.$(OBJEXT) -rm -f javax/imageio/spi/IIOServiceProvider.lo -rm -f javax/imageio/spi/ImageInputStreamSpi.$(OBJEXT) -rm -f javax/imageio/spi/ImageInputStreamSpi.lo -rm -f javax/imageio/spi/ImageOutputStreamSpi.$(OBJEXT) -rm -f javax/imageio/spi/ImageOutputStreamSpi.lo + -rm -f javax/imageio/spi/ImageReaderSpi.$(OBJEXT) + -rm -f javax/imageio/spi/ImageReaderSpi.lo -rm -f javax/imageio/spi/ImageReaderWriterSpi.$(OBJEXT) -rm -f javax/imageio/spi/ImageReaderWriterSpi.lo -rm -f javax/imageio/spi/ImageTranscoderSpi.$(OBJEXT) -rm -f javax/imageio/spi/ImageTranscoderSpi.lo + -rm -f javax/imageio/spi/ImageWriterSpi.$(OBJEXT) + -rm -f javax/imageio/spi/ImageWriterSpi.lo -rm -f javax/imageio/spi/RegisterableService.$(OBJEXT) -rm -f javax/imageio/spi/RegisterableService.lo -rm -f javax/imageio/spi/ServiceRegistry.$(OBJEXT) -rm -f javax/imageio/spi/ServiceRegistry.lo + -rm -f javax/imageio/stream/FileCacheImageInputStream.$(OBJEXT) + -rm -f javax/imageio/stream/FileCacheImageInputStream.lo + -rm -f javax/imageio/stream/FileCacheImageOutputStream.$(OBJEXT) + -rm -f javax/imageio/stream/FileCacheImageOutputStream.lo + -rm -f javax/imageio/stream/FileImageInputStream.$(OBJEXT) + -rm -f javax/imageio/stream/FileImageInputStream.lo + -rm -f javax/imageio/stream/FileImageOutputStream.$(OBJEXT) + -rm -f javax/imageio/stream/FileImageOutputStream.lo -rm -f javax/imageio/stream/IIOByteBuffer.$(OBJEXT) -rm -f javax/imageio/stream/IIOByteBuffer.lo -rm -f javax/imageio/stream/ImageInputStream.$(OBJEXT) -rm -f javax/imageio/stream/ImageInputStream.lo + -rm -f javax/imageio/stream/ImageInputStreamImpl.$(OBJEXT) + -rm -f javax/imageio/stream/ImageInputStreamImpl.lo -rm -f javax/imageio/stream/ImageOutputStream.$(OBJEXT) -rm -f javax/imageio/stream/ImageOutputStream.lo + -rm -f javax/imageio/stream/ImageOutputStreamImpl.$(OBJEXT) + -rm -f javax/imageio/stream/ImageOutputStreamImpl.lo + -rm -f javax/imageio/stream/MemoryCacheImageInputStream.$(OBJEXT) + -rm -f javax/imageio/stream/MemoryCacheImageInputStream.lo + -rm -f javax/imageio/stream/MemoryCacheImageOutputStream.$(OBJEXT) + -rm -f javax/imageio/stream/MemoryCacheImageOutputStream.lo -rm -f javax/naming/AuthenticationException.$(OBJEXT) -rm -f javax/naming/AuthenticationException.lo -rm -f javax/naming/AuthenticationNotSupportedException.$(OBJEXT) @@ -20686,24 +20872,48 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@javax/crypto/spec/$(DEPDIR)/RC5ParameterSpec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/crypto/spec/$(DEPDIR)/SecretKeySpec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/$(DEPDIR)/IIOException.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/$(DEPDIR)/IIOImage.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/$(DEPDIR)/IIOParam.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/$(DEPDIR)/IIOParamController.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/$(DEPDIR)/ImageIO.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/$(DEPDIR)/ImageReadParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/$(DEPDIR)/ImageReader.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/$(DEPDIR)/ImageTranscoder.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/$(DEPDIR)/ImageTypeSpecifier.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/$(DEPDIR)/ImageWriteParam.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/$(DEPDIR)/ImageWriter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/event/$(DEPDIR)/IIOReadProgressListener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/event/$(DEPDIR)/IIOReadUpdateListener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/event/$(DEPDIR)/IIOReadWarningListener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/event/$(DEPDIR)/IIOWriteProgressListener.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/event/$(DEPDIR)/IIOWriteWarningListener.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOInvalidTreeException.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOMetadata.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOMetadataController.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOMetadataFormat.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOMetadataFormatImpl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/metadata/$(DEPDIR)/IIOMetadataNode.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/IIORegistry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/IIOServiceProvider.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/ImageInputStreamSpi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/ImageOutputStreamSpi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/ImageReaderSpi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/ImageReaderWriterSpi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/ImageTranscoderSpi.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/ImageWriterSpi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/RegisterableService.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/spi/$(DEPDIR)/ServiceRegistry.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/stream/$(DEPDIR)/FileCacheImageInputStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/stream/$(DEPDIR)/FileCacheImageOutputStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/stream/$(DEPDIR)/FileImageInputStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/stream/$(DEPDIR)/FileImageOutputStream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/stream/$(DEPDIR)/IIOByteBuffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/stream/$(DEPDIR)/ImageInputStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/stream/$(DEPDIR)/ImageInputStreamImpl.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/stream/$(DEPDIR)/ImageOutputStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/stream/$(DEPDIR)/ImageOutputStreamImpl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/stream/$(DEPDIR)/MemoryCacheImageInputStream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@javax/imageio/stream/$(DEPDIR)/MemoryCacheImageOutputStream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/naming/$(DEPDIR)/AuthenticationException.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/naming/$(DEPDIR)/AuthenticationNotSupportedException.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@javax/naming/$(DEPDIR)/BinaryRefAddr.Plo@am__quote@ @@ -22393,6 +22603,7 @@ clean-libtool: -rm -rf javax/crypto/spec/.libs javax/crypto/spec/_libs -rm -rf javax/imageio/.libs javax/imageio/_libs -rm -rf javax/imageio/event/.libs javax/imageio/event/_libs + -rm -rf javax/imageio/metadata/.libs javax/imageio/metadata/_libs -rm -rf javax/imageio/spi/.libs javax/imageio/spi/_libs -rm -rf javax/imageio/stream/.libs javax/imageio/stream/_libs -rm -rf javax/naming/.libs javax/naming/_libs @@ -22980,6 +23191,8 @@ distclean-generic: -rm -f javax/imageio/$(am__dirstamp) -rm -f javax/imageio/event/$(DEPDIR)/$(am__dirstamp) -rm -f javax/imageio/event/$(am__dirstamp) + -rm -f javax/imageio/metadata/$(DEPDIR)/$(am__dirstamp) + -rm -f javax/imageio/metadata/$(am__dirstamp) -rm -f javax/imageio/spi/$(DEPDIR)/$(am__dirstamp) -rm -f javax/imageio/spi/$(am__dirstamp) -rm -f javax/imageio/stream/$(DEPDIR)/$(am__dirstamp) @@ -23084,7 +23297,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libtool clean-local \ distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ./$(DEPDIR) gnu/awt/$(DEPDIR) gnu/awt/j2d/$(DEPDIR) gnu/awt/xlib/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/awt/$(DEPDIR) gnu/java/awt/image/$(DEPDIR) gnu/java/awt/peer/$(DEPDIR) gnu/java/awt/peer/gtk/$(DEPDIR) gnu/java/beans/$(DEPDIR) gnu/java/beans/editors/$(DEPDIR) gnu/java/beans/info/$(DEPDIR) gnu/java/io/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/lang/reflect/$(DEPDIR) gnu/java/locale/$(DEPDIR) gnu/java/math/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/net/protocol/file/$(DEPDIR) gnu/java/net/protocol/gcjlib/$(DEPDIR) gnu/java/net/protocol/http/$(DEPDIR) gnu/java/net/protocol/jar/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) gnu/java/nio/charset/$(DEPDIR) gnu/java/rmi/$(DEPDIR) gnu/java/rmi/dgc/$(DEPDIR) gnu/java/rmi/registry/$(DEPDIR) gnu/java/rmi/rmic/$(DEPDIR) gnu/java/rmi/server/$(DEPDIR) gnu/java/security/$(DEPDIR) gnu/java/security/action/$(DEPDIR) gnu/java/security/der/$(DEPDIR) gnu/java/security/provider/$(DEPDIR) gnu/java/security/util/$(DEPDIR) gnu/java/security/x509/$(DEPDIR) gnu/java/text/$(DEPDIR) gnu/java/util/$(DEPDIR) gnu/java/util/prefs/$(DEPDIR) gnu/regexp/$(DEPDIR) java/applet/$(DEPDIR) java/awt/$(DEPDIR) java/awt/color/$(DEPDIR) java/awt/datatransfer/$(DEPDIR) java/awt/dnd/$(DEPDIR) java/awt/dnd/peer/$(DEPDIR) java/awt/event/$(DEPDIR) java/awt/font/$(DEPDIR) java/awt/geom/$(DEPDIR) java/awt/im/$(DEPDIR) java/awt/im/spi/$(DEPDIR) java/awt/image/$(DEPDIR) java/awt/image/renderable/$(DEPDIR) java/awt/peer/$(DEPDIR) java/awt/print/$(DEPDIR) java/beans/$(DEPDIR) java/beans/beancontext/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/math/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/nio/channels/spi/$(DEPDIR) java/nio/charset/$(DEPDIR) java/nio/charset/spi/$(DEPDIR) java/rmi/$(DEPDIR) java/rmi/activation/$(DEPDIR) java/rmi/dgc/$(DEPDIR) java/rmi/registry/$(DEPDIR) java/rmi/server/$(DEPDIR) java/security/$(DEPDIR) java/security/acl/$(DEPDIR) java/security/cert/$(DEPDIR) java/security/interfaces/$(DEPDIR) java/security/spec/$(DEPDIR) java/sql/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/jar/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/prefs/$(DEPDIR) java/util/regex/$(DEPDIR) java/util/zip/$(DEPDIR) javax/accessibility/$(DEPDIR) javax/crypto/$(DEPDIR) javax/crypto/interfaces/$(DEPDIR) javax/crypto/spec/$(DEPDIR) javax/imageio/$(DEPDIR) javax/imageio/event/$(DEPDIR) javax/imageio/spi/$(DEPDIR) javax/imageio/stream/$(DEPDIR) javax/naming/$(DEPDIR) javax/naming/directory/$(DEPDIR) javax/naming/event/$(DEPDIR) javax/naming/ldap/$(DEPDIR) javax/naming/spi/$(DEPDIR) javax/net/$(DEPDIR) javax/net/ssl/$(DEPDIR) javax/print/$(DEPDIR) javax/print/attribute/$(DEPDIR) javax/print/attribute/standard/$(DEPDIR) javax/print/event/$(DEPDIR) javax/security/auth/$(DEPDIR) javax/security/auth/callback/$(DEPDIR) javax/security/auth/login/$(DEPDIR) javax/security/auth/x500/$(DEPDIR) javax/security/cert/$(DEPDIR) javax/security/sasl/$(DEPDIR) javax/sql/$(DEPDIR) javax/swing/$(DEPDIR) javax/swing/border/$(DEPDIR) javax/swing/colorchooser/$(DEPDIR) javax/swing/event/$(DEPDIR) javax/swing/filechooser/$(DEPDIR) javax/swing/plaf/$(DEPDIR) javax/swing/plaf/basic/$(DEPDIR) javax/swing/plaf/metal/$(DEPDIR) javax/swing/table/$(DEPDIR) javax/swing/text/$(DEPDIR) javax/swing/text/html/$(DEPDIR) javax/swing/text/html/parser/$(DEPDIR) javax/swing/tree/$(DEPDIR) javax/swing/undo/$(DEPDIR) javax/transaction/$(DEPDIR) javax/transaction/xa/$(DEPDIR) jni/classpath/$(DEPDIR) jni/gtk-peer/$(DEPDIR) org/ietf/jgss/$(DEPDIR) org/w3c/dom/$(DEPDIR) org/w3c/dom/ranges/$(DEPDIR) org/w3c/dom/traversal/$(DEPDIR) org/xml/sax/$(DEPDIR) org/xml/sax/ext/$(DEPDIR) org/xml/sax/helpers/$(DEPDIR) sysdep/$(DEPDIR) + -rm -rf ./$(DEPDIR) gnu/awt/$(DEPDIR) gnu/awt/j2d/$(DEPDIR) gnu/awt/xlib/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/awt/$(DEPDIR) gnu/java/awt/image/$(DEPDIR) gnu/java/awt/peer/$(DEPDIR) gnu/java/awt/peer/gtk/$(DEPDIR) gnu/java/beans/$(DEPDIR) gnu/java/beans/editors/$(DEPDIR) gnu/java/beans/info/$(DEPDIR) gnu/java/io/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/lang/reflect/$(DEPDIR) gnu/java/locale/$(DEPDIR) gnu/java/math/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/net/protocol/file/$(DEPDIR) gnu/java/net/protocol/gcjlib/$(DEPDIR) gnu/java/net/protocol/http/$(DEPDIR) gnu/java/net/protocol/jar/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) gnu/java/nio/charset/$(DEPDIR) gnu/java/rmi/$(DEPDIR) gnu/java/rmi/dgc/$(DEPDIR) gnu/java/rmi/registry/$(DEPDIR) gnu/java/rmi/rmic/$(DEPDIR) gnu/java/rmi/server/$(DEPDIR) gnu/java/security/$(DEPDIR) gnu/java/security/action/$(DEPDIR) gnu/java/security/der/$(DEPDIR) gnu/java/security/provider/$(DEPDIR) gnu/java/security/util/$(DEPDIR) gnu/java/security/x509/$(DEPDIR) gnu/java/text/$(DEPDIR) gnu/java/util/$(DEPDIR) gnu/java/util/prefs/$(DEPDIR) gnu/regexp/$(DEPDIR) java/applet/$(DEPDIR) java/awt/$(DEPDIR) java/awt/color/$(DEPDIR) java/awt/datatransfer/$(DEPDIR) java/awt/dnd/$(DEPDIR) java/awt/dnd/peer/$(DEPDIR) java/awt/event/$(DEPDIR) java/awt/font/$(DEPDIR) java/awt/geom/$(DEPDIR) java/awt/im/$(DEPDIR) java/awt/im/spi/$(DEPDIR) java/awt/image/$(DEPDIR) java/awt/image/renderable/$(DEPDIR) java/awt/peer/$(DEPDIR) java/awt/print/$(DEPDIR) java/beans/$(DEPDIR) java/beans/beancontext/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/math/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/nio/channels/spi/$(DEPDIR) java/nio/charset/$(DEPDIR) java/nio/charset/spi/$(DEPDIR) java/rmi/$(DEPDIR) java/rmi/activation/$(DEPDIR) java/rmi/dgc/$(DEPDIR) java/rmi/registry/$(DEPDIR) java/rmi/server/$(DEPDIR) java/security/$(DEPDIR) java/security/acl/$(DEPDIR) java/security/cert/$(DEPDIR) java/security/interfaces/$(DEPDIR) java/security/spec/$(DEPDIR) java/sql/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/jar/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/prefs/$(DEPDIR) java/util/regex/$(DEPDIR) java/util/zip/$(DEPDIR) javax/accessibility/$(DEPDIR) javax/crypto/$(DEPDIR) javax/crypto/interfaces/$(DEPDIR) javax/crypto/spec/$(DEPDIR) javax/imageio/$(DEPDIR) javax/imageio/event/$(DEPDIR) javax/imageio/metadata/$(DEPDIR) javax/imageio/spi/$(DEPDIR) javax/imageio/stream/$(DEPDIR) javax/naming/$(DEPDIR) javax/naming/directory/$(DEPDIR) javax/naming/event/$(DEPDIR) javax/naming/ldap/$(DEPDIR) javax/naming/spi/$(DEPDIR) javax/net/$(DEPDIR) javax/net/ssl/$(DEPDIR) javax/print/$(DEPDIR) javax/print/attribute/$(DEPDIR) javax/print/attribute/standard/$(DEPDIR) javax/print/event/$(DEPDIR) javax/security/auth/$(DEPDIR) javax/security/auth/callback/$(DEPDIR) javax/security/auth/login/$(DEPDIR) javax/security/auth/x500/$(DEPDIR) javax/security/cert/$(DEPDIR) javax/security/sasl/$(DEPDIR) javax/sql/$(DEPDIR) javax/swing/$(DEPDIR) javax/swing/border/$(DEPDIR) javax/swing/colorchooser/$(DEPDIR) javax/swing/event/$(DEPDIR) javax/swing/filechooser/$(DEPDIR) javax/swing/plaf/$(DEPDIR) javax/swing/plaf/basic/$(DEPDIR) javax/swing/plaf/metal/$(DEPDIR) javax/swing/table/$(DEPDIR) javax/swing/text/$(DEPDIR) javax/swing/text/html/$(DEPDIR) javax/swing/text/html/parser/$(DEPDIR) javax/swing/tree/$(DEPDIR) javax/swing/undo/$(DEPDIR) javax/transaction/$(DEPDIR) javax/transaction/xa/$(DEPDIR) jni/classpath/$(DEPDIR) jni/gtk-peer/$(DEPDIR) org/ietf/jgss/$(DEPDIR) org/w3c/dom/$(DEPDIR) org/w3c/dom/ranges/$(DEPDIR) org/w3c/dom/traversal/$(DEPDIR) org/xml/sax/$(DEPDIR) org/xml/sax/ext/$(DEPDIR) org/xml/sax/helpers/$(DEPDIR) sysdep/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-local distclean-tags @@ -23114,7 +23327,7 @@ installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ./$(DEPDIR) gnu/awt/$(DEPDIR) gnu/awt/j2d/$(DEPDIR) gnu/awt/xlib/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/awt/$(DEPDIR) gnu/java/awt/image/$(DEPDIR) gnu/java/awt/peer/$(DEPDIR) gnu/java/awt/peer/gtk/$(DEPDIR) gnu/java/beans/$(DEPDIR) gnu/java/beans/editors/$(DEPDIR) gnu/java/beans/info/$(DEPDIR) gnu/java/io/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/lang/reflect/$(DEPDIR) gnu/java/locale/$(DEPDIR) gnu/java/math/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/net/protocol/file/$(DEPDIR) gnu/java/net/protocol/gcjlib/$(DEPDIR) gnu/java/net/protocol/http/$(DEPDIR) gnu/java/net/protocol/jar/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) gnu/java/nio/charset/$(DEPDIR) gnu/java/rmi/$(DEPDIR) gnu/java/rmi/dgc/$(DEPDIR) gnu/java/rmi/registry/$(DEPDIR) gnu/java/rmi/rmic/$(DEPDIR) gnu/java/rmi/server/$(DEPDIR) gnu/java/security/$(DEPDIR) gnu/java/security/action/$(DEPDIR) gnu/java/security/der/$(DEPDIR) gnu/java/security/provider/$(DEPDIR) gnu/java/security/util/$(DEPDIR) gnu/java/security/x509/$(DEPDIR) gnu/java/text/$(DEPDIR) gnu/java/util/$(DEPDIR) gnu/java/util/prefs/$(DEPDIR) gnu/regexp/$(DEPDIR) java/applet/$(DEPDIR) java/awt/$(DEPDIR) java/awt/color/$(DEPDIR) java/awt/datatransfer/$(DEPDIR) java/awt/dnd/$(DEPDIR) java/awt/dnd/peer/$(DEPDIR) java/awt/event/$(DEPDIR) java/awt/font/$(DEPDIR) java/awt/geom/$(DEPDIR) java/awt/im/$(DEPDIR) java/awt/im/spi/$(DEPDIR) java/awt/image/$(DEPDIR) java/awt/image/renderable/$(DEPDIR) java/awt/peer/$(DEPDIR) java/awt/print/$(DEPDIR) java/beans/$(DEPDIR) java/beans/beancontext/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/math/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/nio/channels/spi/$(DEPDIR) java/nio/charset/$(DEPDIR) java/nio/charset/spi/$(DEPDIR) java/rmi/$(DEPDIR) java/rmi/activation/$(DEPDIR) java/rmi/dgc/$(DEPDIR) java/rmi/registry/$(DEPDIR) java/rmi/server/$(DEPDIR) java/security/$(DEPDIR) java/security/acl/$(DEPDIR) java/security/cert/$(DEPDIR) java/security/interfaces/$(DEPDIR) java/security/spec/$(DEPDIR) java/sql/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/jar/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/prefs/$(DEPDIR) java/util/regex/$(DEPDIR) java/util/zip/$(DEPDIR) javax/accessibility/$(DEPDIR) javax/crypto/$(DEPDIR) javax/crypto/interfaces/$(DEPDIR) javax/crypto/spec/$(DEPDIR) javax/imageio/$(DEPDIR) javax/imageio/event/$(DEPDIR) javax/imageio/spi/$(DEPDIR) javax/imageio/stream/$(DEPDIR) javax/naming/$(DEPDIR) javax/naming/directory/$(DEPDIR) javax/naming/event/$(DEPDIR) javax/naming/ldap/$(DEPDIR) javax/naming/spi/$(DEPDIR) javax/net/$(DEPDIR) javax/net/ssl/$(DEPDIR) javax/print/$(DEPDIR) javax/print/attribute/$(DEPDIR) javax/print/attribute/standard/$(DEPDIR) javax/print/event/$(DEPDIR) javax/security/auth/$(DEPDIR) javax/security/auth/callback/$(DEPDIR) javax/security/auth/login/$(DEPDIR) javax/security/auth/x500/$(DEPDIR) javax/security/cert/$(DEPDIR) javax/security/sasl/$(DEPDIR) javax/sql/$(DEPDIR) javax/swing/$(DEPDIR) javax/swing/border/$(DEPDIR) javax/swing/colorchooser/$(DEPDIR) javax/swing/event/$(DEPDIR) javax/swing/filechooser/$(DEPDIR) javax/swing/plaf/$(DEPDIR) javax/swing/plaf/basic/$(DEPDIR) javax/swing/plaf/metal/$(DEPDIR) javax/swing/table/$(DEPDIR) javax/swing/text/$(DEPDIR) javax/swing/text/html/$(DEPDIR) javax/swing/text/html/parser/$(DEPDIR) javax/swing/tree/$(DEPDIR) javax/swing/undo/$(DEPDIR) javax/transaction/$(DEPDIR) javax/transaction/xa/$(DEPDIR) jni/classpath/$(DEPDIR) jni/gtk-peer/$(DEPDIR) org/ietf/jgss/$(DEPDIR) org/w3c/dom/$(DEPDIR) org/w3c/dom/ranges/$(DEPDIR) org/w3c/dom/traversal/$(DEPDIR) org/xml/sax/$(DEPDIR) org/xml/sax/ext/$(DEPDIR) org/xml/sax/helpers/$(DEPDIR) sysdep/$(DEPDIR) + -rm -rf ./$(DEPDIR) gnu/awt/$(DEPDIR) gnu/awt/j2d/$(DEPDIR) gnu/awt/xlib/$(DEPDIR) gnu/classpath/$(DEPDIR) gnu/gcj/$(DEPDIR) gnu/gcj/convert/$(DEPDIR) gnu/gcj/io/$(DEPDIR) gnu/gcj/runtime/$(DEPDIR) gnu/gcj/xlib/$(DEPDIR) gnu/java/awt/$(DEPDIR) gnu/java/awt/image/$(DEPDIR) gnu/java/awt/peer/$(DEPDIR) gnu/java/awt/peer/gtk/$(DEPDIR) gnu/java/beans/$(DEPDIR) gnu/java/beans/editors/$(DEPDIR) gnu/java/beans/info/$(DEPDIR) gnu/java/io/$(DEPDIR) gnu/java/lang/$(DEPDIR) gnu/java/lang/reflect/$(DEPDIR) gnu/java/locale/$(DEPDIR) gnu/java/math/$(DEPDIR) gnu/java/net/$(DEPDIR) gnu/java/net/protocol/core/$(DEPDIR) gnu/java/net/protocol/file/$(DEPDIR) gnu/java/net/protocol/gcjlib/$(DEPDIR) gnu/java/net/protocol/http/$(DEPDIR) gnu/java/net/protocol/jar/$(DEPDIR) gnu/java/nio/$(DEPDIR) gnu/java/nio/channels/$(DEPDIR) gnu/java/nio/charset/$(DEPDIR) gnu/java/rmi/$(DEPDIR) gnu/java/rmi/dgc/$(DEPDIR) gnu/java/rmi/registry/$(DEPDIR) gnu/java/rmi/rmic/$(DEPDIR) gnu/java/rmi/server/$(DEPDIR) gnu/java/security/$(DEPDIR) gnu/java/security/action/$(DEPDIR) gnu/java/security/der/$(DEPDIR) gnu/java/security/provider/$(DEPDIR) gnu/java/security/util/$(DEPDIR) gnu/java/security/x509/$(DEPDIR) gnu/java/text/$(DEPDIR) gnu/java/util/$(DEPDIR) gnu/java/util/prefs/$(DEPDIR) gnu/regexp/$(DEPDIR) java/applet/$(DEPDIR) java/awt/$(DEPDIR) java/awt/color/$(DEPDIR) java/awt/datatransfer/$(DEPDIR) java/awt/dnd/$(DEPDIR) java/awt/dnd/peer/$(DEPDIR) java/awt/event/$(DEPDIR) java/awt/font/$(DEPDIR) java/awt/geom/$(DEPDIR) java/awt/im/$(DEPDIR) java/awt/im/spi/$(DEPDIR) java/awt/image/$(DEPDIR) java/awt/image/renderable/$(DEPDIR) java/awt/peer/$(DEPDIR) java/awt/print/$(DEPDIR) java/beans/$(DEPDIR) java/beans/beancontext/$(DEPDIR) java/io/$(DEPDIR) java/lang/$(DEPDIR) java/lang/ref/$(DEPDIR) java/lang/reflect/$(DEPDIR) java/math/$(DEPDIR) java/net/$(DEPDIR) java/nio/$(DEPDIR) java/nio/channels/$(DEPDIR) java/nio/channels/spi/$(DEPDIR) java/nio/charset/$(DEPDIR) java/nio/charset/spi/$(DEPDIR) java/rmi/$(DEPDIR) java/rmi/activation/$(DEPDIR) java/rmi/dgc/$(DEPDIR) java/rmi/registry/$(DEPDIR) java/rmi/server/$(DEPDIR) java/security/$(DEPDIR) java/security/acl/$(DEPDIR) java/security/cert/$(DEPDIR) java/security/interfaces/$(DEPDIR) java/security/spec/$(DEPDIR) java/sql/$(DEPDIR) java/text/$(DEPDIR) java/util/$(DEPDIR) java/util/jar/$(DEPDIR) java/util/logging/$(DEPDIR) java/util/prefs/$(DEPDIR) java/util/regex/$(DEPDIR) java/util/zip/$(DEPDIR) javax/accessibility/$(DEPDIR) javax/crypto/$(DEPDIR) javax/crypto/interfaces/$(DEPDIR) javax/crypto/spec/$(DEPDIR) javax/imageio/$(DEPDIR) javax/imageio/event/$(DEPDIR) javax/imageio/metadata/$(DEPDIR) javax/imageio/spi/$(DEPDIR) javax/imageio/stream/$(DEPDIR) javax/naming/$(DEPDIR) javax/naming/directory/$(DEPDIR) javax/naming/event/$(DEPDIR) javax/naming/ldap/$(DEPDIR) javax/naming/spi/$(DEPDIR) javax/net/$(DEPDIR) javax/net/ssl/$(DEPDIR) javax/print/$(DEPDIR) javax/print/attribute/$(DEPDIR) javax/print/attribute/standard/$(DEPDIR) javax/print/event/$(DEPDIR) javax/security/auth/$(DEPDIR) javax/security/auth/callback/$(DEPDIR) javax/security/auth/login/$(DEPDIR) javax/security/auth/x500/$(DEPDIR) javax/security/cert/$(DEPDIR) javax/security/sasl/$(DEPDIR) javax/sql/$(DEPDIR) javax/swing/$(DEPDIR) javax/swing/border/$(DEPDIR) javax/swing/colorchooser/$(DEPDIR) javax/swing/event/$(DEPDIR) javax/swing/filechooser/$(DEPDIR) javax/swing/plaf/$(DEPDIR) javax/swing/plaf/basic/$(DEPDIR) javax/swing/plaf/metal/$(DEPDIR) javax/swing/table/$(DEPDIR) javax/swing/text/$(DEPDIR) javax/swing/text/html/$(DEPDIR) javax/swing/text/html/parser/$(DEPDIR) javax/swing/tree/$(DEPDIR) javax/swing/undo/$(DEPDIR) javax/transaction/$(DEPDIR) javax/transaction/xa/$(DEPDIR) jni/classpath/$(DEPDIR) jni/gtk-peer/$(DEPDIR) org/ietf/jgss/$(DEPDIR) org/w3c/dom/$(DEPDIR) org/w3c/dom/ranges/$(DEPDIR) org/w3c/dom/traversal/$(DEPDIR) org/xml/sax/$(DEPDIR) org/xml/sax/ext/$(DEPDIR) org/xml/sax/helpers/$(DEPDIR) sysdep/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/libjava/javax/imageio/IIOImage.java b/libjava/javax/imageio/IIOImage.java new file mode 100644 index 0000000..587a3d4 --- /dev/null +++ b/libjava/javax/imageio/IIOImage.java @@ -0,0 +1,138 @@ +/* IIOImage.java -- + Copyright (C) 2003 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio; + +import java.awt.image.BufferedImage; +import java.awt.image.Raster; +import java.awt.image.RenderedImage; +import java.util.List; + +import javax.imageio.metadata.IIOMetadata; + +public class IIOImage +{ + protected RenderedImage image; + protected IIOMetadata metadata; + protected Raster raster; + protected List thumbnails; + + public IIOImage (Raster raster, List thumbnails, IIOMetadata metadata) + { + if (raster == null) + throw new IllegalArgumentException ("raster may not be null"); + + this.raster = raster; + this.thumbnails = thumbnails; + this.metadata = metadata; + } + + public IIOImage (RenderedImage image, List thumbnails, IIOMetadata metadata) + { + if (image == null) + throw new IllegalArgumentException ("image may not be null"); + + this.image = image; + this.thumbnails = thumbnails; + this.metadata = metadata; + } + + public IIOMetadata getMetadata() + { + return metadata; + } + + public int getNumThumbnails() + { + return thumbnails.size(); + } + + public Raster getRaster() + { + return raster; + } + + public RenderedImage getRenderedImage() + { + return image; + } + + public BufferedImage getThumbnail (int index) + { + return (BufferedImage) thumbnails.get (index); + } + + public List getThumbnails() + { + return thumbnails; + } + + public boolean hasRaster() + { + return raster != null; + } + + public void setMetadata (IIOMetadata metadata) + { + this.metadata = metadata; + } + + public void setRaster (Raster raster) + { + if (raster == null) + throw new IllegalArgumentException ("raster may not be null"); + + this.image = null; + this.raster = raster; + } + + public void setRenderedImage (RenderedImage image) + { + if (image == null) + throw new IllegalArgumentException ("image may not be null"); + + this.image = image; + this.raster = null; + } + + public void setThumbnails (List thumbnails) + { + this.thumbnails = thumbnails; + } + +} // class IIOParam diff --git a/libjava/javax/imageio/IIOParam.java b/libjava/javax/imageio/IIOParam.java new file mode 100644 index 0000000..bbab1cf --- /dev/null +++ b/libjava/javax/imageio/IIOParam.java @@ -0,0 +1,157 @@ +/* IIOParam.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio; + +import java.awt.Point; +import java.awt.Rectangle; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public abstract class IIOParam +{ + protected IIOParamController controller; + protected IIOParamController defaultController; + protected Point destinationOffset = new Point(0, 0); + protected ImageTypeSpecifier destinationType; + protected int[] sourceBands; + protected Rectangle sourceRegion; + protected int sourceXSubsampling; + protected int sourceYSubsampling; + protected int subsamplingXOffset; + protected int subsamplingYOffset; + + /** + * Initializes an <code>IIOParam</code> object. + */ + protected IIOParam() + { + // Do nothing here. + } + + public boolean activateController() + { + if (controller == null) + return false; + + return controller.activate(this); + } + + public IIOParamController getController() + { + return controller; + } + + public IIOParamController getDefaultController() + { + return defaultController; + } + + public Point getDestinationOffset() + { + return destinationOffset; + } + + public ImageTypeSpecifier getDestinationType() + { + return destinationType; + } + + public int[] getSourceBands() + { + return sourceBands; + } + + public Rectangle getSourceRegion() + { + return sourceRegion; + } + + public int getSourceXSubsampling() + { + return sourceXSubsampling; + } + + public int getSourceYSubsampling() + { + return sourceYSubsampling; + } + + public int getSubsamplingXOffset() + { + return subsamplingXOffset; + } + + public int getSubsamplingYOffset() + { + return subsamplingYOffset; + } + + public boolean hasController() + { + return getController() != null; + } + + public void setController(IIOParamController controller) + { + this.controller = controller; + } + + public void setDestinationOffset(Point destinationOffset) + { + if (destinationOffset == null) + throw new IllegalArgumentException("destinationOffset is null"); + + this.destinationOffset = destinationOffset; + } + + public void setSourceRegion(Rectangle sourceRegion) + { + if (sourceRegion != null + && (sourceRegion.x < 0 + || sourceRegion.y < 0 + || sourceRegion.width <= 0 + || sourceRegion.height <= 0)) + throw new IllegalArgumentException("illegal source region"); + + // FIXME: Throw IllegalStateException. + + this.sourceRegion = sourceRegion; + } +} diff --git a/libjava/javax/imageio/IIOParamController.java b/libjava/javax/imageio/IIOParamController.java new file mode 100644 index 0000000..0568c19 --- /dev/null +++ b/libjava/javax/imageio/IIOParamController.java @@ -0,0 +1,58 @@ +/* IIOParamController.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public interface IIOParamController +{ + /** + * Activates the controller. + * + * @param param the <code>IIOParam</code> to be modified + * + * @return true if the <code>IIOParam</code> has been modified, + * false otherwise + * + * @exception IllegalArgumentException if param is null or is not an instance + * of the correct class + */ + boolean activate(IIOParam param); +} diff --git a/libjava/javax/imageio/ImageIO.java b/libjava/javax/imageio/ImageIO.java new file mode 100644 index 0000000..5cc7c92 --- /dev/null +++ b/libjava/javax/imageio/ImageIO.java @@ -0,0 +1,494 @@ +/* ImageIO.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; + +import javax.imageio.spi.IIORegistry; +import javax.imageio.spi.ImageReaderSpi; +import javax.imageio.spi.ImageWriterSpi; +import javax.imageio.spi.ServiceRegistry; + +public final class ImageIO +{ + private static final class ReaderFormatFilter implements ServiceRegistry.Filter + { + private String formatName; + + public ReaderFormatFilter(String formatName) + { + this.formatName = formatName; + } + + public boolean filter (Object provider) + { + if (provider instanceof ImageReaderSpi) + { + ImageWriterSpi spi = (ImageWriterSpi) provider; + String[] formatNames = spi.getFormatNames(); + + for (int i = formatNames.length - 1; i >= 0; --i) + if (formatName.equals(formatNames[i])) + return true; + } + + return false; + } + } + + private static final class ReaderMIMETypeFilter implements ServiceRegistry.Filter + { + private String MIMEType; + + public ReaderMIMETypeFilter(String MIMEType) + { + this.MIMEType = MIMEType; + } + + public boolean filter(Object provider) + { + if (provider instanceof ImageReaderSpi) + { + ImageReaderSpi spi = (ImageReaderSpi) provider; + String[] mimetypes = spi.getMIMETypes(); + + for (int i = mimetypes.length - 1; i >= 0; --i) + if (MIMEType.equals(mimetypes[i])) + return true; + } + + return false; + } + } + + private static final class ReaderSuffixFilter implements ServiceRegistry.Filter + { + private String fileSuffix; + + public ReaderSuffixFilter(String fileSuffix) + { + this.fileSuffix = fileSuffix; + } + + public boolean filter(Object provider) + { + if (provider instanceof ImageReaderSpi) + { + ImageReaderSpi spi = (ImageReaderSpi) provider; + String[] suffixes = spi.getFileSuffixes(); + + for (int i = suffixes.length - 1; i >= 0; --i) + if (fileSuffix.equals(suffixes[i])) + return true; + } + + return false; + } + } + + private static final class WriterFormatFilter implements ServiceRegistry.Filter + { + private String formatName; + + public WriterFormatFilter(String formatName) + { + this.formatName = formatName; + } + + public boolean filter(Object provider) + { + if (provider instanceof ImageReaderSpi) + { + ImageReaderSpi spi = (ImageReaderSpi) provider; + String[] formatNames = spi.getFormatNames(); + + for (int i = formatNames.length - 1; i >= 0; --i) + if (formatName.equals(formatNames[i])) + return true; + } + + return false; + } + } + + private static final class WriterMIMETypeFilter implements ServiceRegistry.Filter + { + private String MIMEType; + + public WriterMIMETypeFilter(String MIMEType) + { + this.MIMEType = MIMEType; + } + + public boolean filter(Object provider) + { + if (provider instanceof ImageReaderSpi) + { + ImageWriterSpi spi = (ImageWriterSpi) provider; + String[] mimetypes = spi.getMIMETypes(); + + for (int i = mimetypes.length - 1; i >= 0; --i) + if (MIMEType.equals(mimetypes[i])) + return true; + } + + return false; + } + } + + private static final class WriterSuffixFilter implements ServiceRegistry.Filter + { + private String fileSuffix; + + public WriterSuffixFilter(String fileSuffix) + { + this.fileSuffix = fileSuffix; + } + + public boolean filter(Object provider) + { + if (provider instanceof ImageReaderSpi) + { + ImageWriterSpi spi = (ImageWriterSpi) provider; + String[] suffixes = spi.getFileSuffixes(); + + for (int i = suffixes.length - 1; i >= 0; --i) + if (fileSuffix.equals(suffixes[i])) + return true; + } + + return false; + } + } + + private static final class ImageReaderIterator implements Iterator + { + Iterator it; + + public ImageReaderIterator(Iterator it) + { + this.it = it; + } + + public boolean hasNext() + { + return it.hasNext(); + } + + public Object next() + { + try + { + return ((ImageReaderSpi) it.next()).createReaderInstance(); + } + catch (IOException e) + { + return null; + } + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + } + + private static final class ImageWriterIterator implements Iterator + { + Iterator it; + + public ImageWriterIterator(Iterator it) + { + this.it = it; + } + + public boolean hasNext() + { + return it.hasNext(); + } + + public Object next() + { + try + { + return ((ImageWriterSpi) it.next()).createWriterInstance(); + } + catch (IOException e) + { + return null; + } + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + } + + private static File cacheDirectory; + private static boolean useCache = true; + + private static Iterator getReadersByFilter(Class type, + ServiceRegistry.Filter filter) + { + try + { + Iterator it = getRegistry().getServiceProviders(type, filter, true); + return new ImageReaderIterator(it); + } + catch (IllegalArgumentException e) + { + return Collections.EMPTY_SET.iterator(); + } + } + + private static Iterator getWritersByFilter(Class type, + ServiceRegistry.Filter filter) + { + try + { + Iterator it = getRegistry().getServiceProviders(type, filter, true); + return new ImageWriterIterator(it); + } + catch (IllegalArgumentException e) + { + return Collections.EMPTY_SET.iterator(); + } + } + + public static File getCacheDirectory() + { + return cacheDirectory; + } + + public static Iterator getImageReadersByFormatName(String formatName) + { + if (formatName == null) + throw new IllegalArgumentException("formatName may not be null"); + + return getReadersByFilter(ImageReaderSpi.class, + new ReaderFormatFilter(formatName)); + } + + public static Iterator getImageReadersByMIMEType(String MIMEType) + { + if (MIMEType == null) + throw new IllegalArgumentException("MIMEType may not be null"); + + return getReadersByFilter(ImageReaderSpi.class, + new ReaderMIMETypeFilter(MIMEType)); + } + + public static Iterator getImageReadersBySuffix(String fileSuffix) + { + if (fileSuffix == null) + throw new IllegalArgumentException("formatName may not be null"); + + return getReadersByFilter(ImageReaderSpi.class, + new ReaderSuffixFilter(fileSuffix)); + } + + public static Iterator getImageWritersByFormatName(String formatName) + { + if (formatName == null) + throw new IllegalArgumentException("formatName may not be null"); + + return getWritersByFilter(ImageWriterSpi.class, + new WriterFormatFilter(formatName)); + } + + public static Iterator getImageWritersByMIMEType(String MIMEType) + { + if (MIMEType == null) + throw new IllegalArgumentException("MIMEType may not be null"); + + return getWritersByFilter(ImageWriterSpi.class, + new WriterMIMETypeFilter(MIMEType)); + } + + public static Iterator getImageWritersBySuffix(String fileSuffix) + { + if (fileSuffix == null) + throw new IllegalArgumentException("fileSuffix may not be null"); + + return getWritersByFilter(ImageWriterSpi.class, + new WriterSuffixFilter(fileSuffix)); + } + + public static String[] getReaderFormatNames() + { + try + { + Iterator it = + getRegistry().getServiceProviders(ImageReaderSpi.class, true); + ArrayList result = new ArrayList(); + + while (it.hasNext()) + { + ImageReaderSpi spi = (ImageReaderSpi) it.next(); + String[] names = spi.getFormatNames(); + + for (int i = names.length - 1; i >= 0; --i) + result.add(names[i]); + } + + return (String[]) result.toArray(new String[result.size()]); + } + catch (IllegalArgumentException e) + { + return new String[0]; + } + } + + public static String[] getReaderMIMETypes() + { + try + { + Iterator it = + getRegistry().getServiceProviders(ImageReaderSpi.class, true); + ArrayList result = new ArrayList(); + + while (it.hasNext()) + { + ImageReaderSpi spi = (ImageReaderSpi) it.next(); + String[] names = spi.getMIMETypes(); + + for (int i = names.length - 1; i >= 0; --i) + result.add(names[i]); + } + + return (String[]) result.toArray(new String[result.size()]); + } + catch (IllegalArgumentException e) + { + return new String[0]; + } + } + + private static IIORegistry getRegistry() + { + return IIORegistry.getDefaultInstance(); + } + + public static boolean getUseCache() + { + return useCache; + } + + public static String[] getWriterFormatNames() + { + try + { + Iterator it = + getRegistry().getServiceProviders(ImageWriterSpi.class, true); + ArrayList result = new ArrayList(); + + while (it.hasNext()) + { + ImageWriterSpi spi = (ImageWriterSpi) it.next(); + String[] names = spi.getFormatNames(); + + for (int i = names.length - 1; i >= 0; --i) + result.add(names[i]); + } + + return (String[]) result.toArray(new String[result.size()]); + } + catch (IllegalArgumentException e) + { + return new String[0]; + } + } + + public static String[] getWriterMIMETypes() + { + try + { + Iterator it = + getRegistry().getServiceProviders(ImageWriterSpi.class, true); + ArrayList result = new ArrayList(); + + while (it.hasNext()) + { + ImageWriterSpi spi = (ImageWriterSpi) it.next(); + String[] names = spi.getMIMETypes(); + + for (int i = names.length - 1; i >= 0; --i) + result.add(names[i]); + } + + return (String[]) result.toArray(new String[result.size()]); + } + catch (IllegalArgumentException e) + { + return new String[0]; + } + } + + /** + * Rescans the application classpath for ImageIO service providers + * and registers them. + */ + public static void scanForPlugins() + { + IIORegistry.getDefaultInstance().registerApplicationClasspathSpis(); + } + + public static void setCacheDirectory(File cacheDirectory) + { + if (cacheDirectory != null) + { + if (!cacheDirectory.isDirectory()) + throw new IllegalArgumentException("cacheDirectory must be a directory"); + + cacheDirectory.canWrite(); + } + + ImageIO.cacheDirectory = cacheDirectory; + } + + public static void setUseCache(boolean useCache) + { + ImageIO.useCache = useCache; + } +} diff --git a/libjava/javax/imageio/ImageReadParam.java b/libjava/javax/imageio/ImageReadParam.java new file mode 100644 index 0000000..e5414bd --- /dev/null +++ b/libjava/javax/imageio/ImageReadParam.java @@ -0,0 +1,110 @@ +/* ImageReadParam.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio; + +import java.awt.Dimension; +import java.awt.image.BufferedImage; + +/** + * @author Michel Koch (konqueror@gmx.de) + */ +public class ImageReadParam extends IIOParam +{ + protected boolean canSetSourceRenderSize; + protected BufferedImage destination; + protected int[] destinationBands; + protected int minProgressivePass; + protected int numProgressivePasses = Integer.MAX_VALUE; + protected Dimension sourceRenderSize; + + public ImageReadParam() + { + } + + public boolean canSetSourceRenderSize() + { + return canSetSourceRenderSize; + } + + public BufferedImage getDestination() + { + return destination; + } + + public int[] getDestinationBands() + { + return destinationBands; + } + + public int getSourceMaxProgressivePass() + { + if (getSourceNumProgressivePasses() == Integer.MAX_VALUE) + return Integer.MAX_VALUE; + + return getSourceMinProgressivePass() + getSourceNumProgressivePasses() - 1; + } + + public int getSourceMinProgressivePass() + { + return minProgressivePass; + } + + public int getSourceNumProgressivePasses() + { + return numProgressivePasses; + } + + public Dimension getSourceRenderSize() + { + return sourceRenderSize; + } + + public void setSourceRenderSize(Dimension size) + throws UnsupportedOperationException + { + if (! canSetSourceRenderSize()) + throw new UnsupportedOperationException + ("setting source render size not supported"); + + if (size.width <= 0 || size.height <= 0) + throw new IllegalArgumentException("negative dimension not allowed"); + + sourceRenderSize = size; + } +} diff --git a/libjava/javax/imageio/ImageReader.java b/libjava/javax/imageio/ImageReader.java index 75ae9ad..91cb53c 100644 --- a/libjava/javax/imageio/ImageReader.java +++ b/libjava/javax/imageio/ImageReader.java @@ -1,5 +1,5 @@ /* ImageReader.java -- Decodes raster images. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,9 +38,482 @@ exception statement from your version. */ package javax.imageio; +import java.awt.image.BufferedImage; +import java.awt.image.Raster; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; + +import javax.imageio.event.IIOReadProgressListener; +import javax.imageio.event.IIOReadUpdateListener; +import javax.imageio.event.IIOReadWarningListener; +import javax.imageio.metadata.IIOMetadata; +import javax.imageio.spi.ImageReaderSpi; + public abstract class ImageReader { - // FIXME: Incomplete. This class is merely present in order to allow - // compilation of the javax.imageio.spi package, for which GNU - // Classpath does provide an implementation. + private boolean aborted; + + protected Locale[] availableLocales; + protected boolean ignoreMetadata; + protected Object input; + protected Locale locale; + protected int minIndex; + protected ImageReaderSpi originatingProvider; + protected List progressListeners; + protected boolean seekForwardOnly; + protected List updateListeners = new ArrayList(); + protected List warningListeners = new ArrayList(); + protected List warningLocales = new ArrayList(); + + protected ImageReader(ImageReaderSpi originatingProvider) + { + this.originatingProvider = originatingProvider; + } + + public void abort() + { + aborted = true; + } + + protected boolean abortRequested() + { + return aborted; + } + + public void addIIOReadProgressListener(IIOReadProgressListener listener) + { + if (listener == null) + return; + + progressListeners.add(listener); + } + + public void addIIOReadUpdateListener(IIOReadUpdateListener listener) + { + if (listener == null) + return; + + updateListeners.add(listener); + } + + public void addIIOReadWarningListener(IIOReadWarningListener listener) + { + if (listener == null) + return; + + warningListeners.add(listener); + } + + public boolean canReadRaster() + { + return false; + } + + protected void clearAbortRequest() + { + aborted = false; + } + + public void dispose() + { + // The default implementation does nothing. + } + + public float getAspectRatio(int imageIndex) + throws IOException + { + return (float) (getWidth(imageIndex) / getHeight(imageIndex)); + } + + public Locale[] getAvailableLocales() + { + if (availableLocales == null) + return null; + + return (Locale[]) availableLocales.clone(); + } + + public ImageReadParam getDefaultReadParam() + { + return new ImageReadParam(); + } + + public String getFormatName() + throws IOException + { + return originatingProvider.getFormatNames()[0]; + } + + public abstract int getHeight(int imageIndex) + throws IOException; + + public abstract IIOMetadata getImageMetadata(int imageIndex) + throws IOException; + + public abstract Iterator getImageTypes(int imageIndex) + throws IOException; + + public Object getInput() + { + return input; + } + + public Locale getLocale() + { + return locale; + } + + public abstract int getNumImages(boolean allowSearch) + throws IOException; + + public int getNumThumbnails(int imageIndex) + throws IOException + { + return 0; + } + + public ImageReaderSpi getOriginatingProvider() + { + return originatingProvider; + } + + public abstract IIOMetadata getStreamMetadata() + throws IOException; + + public int getThumbnailHeight(int imageIndex, int thumbnailIndex) + throws IOException + { + return readThumbnail(imageIndex, thumbnailIndex).getHeight(); + } + + public int getThumbnailWidth(int imageIndex, int thumbnailIndex) + throws IOException + { + return readThumbnail(imageIndex, thumbnailIndex).getWidth(); + } + + public int getTileGridXOffset(int imageIndex) + throws IOException + { + return 0; + } + + public int getTileGridYOffset(int imageIndex) + throws IOException + { + return 0; + } + + public int getTileHeight(int imageIndex) + throws IOException + { + return getHeight(imageIndex); + } + + public int getTileWidth(int imageIndex) + throws IOException + { + return getWidth(imageIndex); + } + + public abstract int getWidth(int imageIndex) + throws IOException; + + public boolean hasThumbnails(int imageIndex) + throws IOException + { + return getNumThumbnails(imageIndex) > 0; + } + + public boolean isIgnoringMetadata() + { + return ignoreMetadata; + } + + public boolean isImageTiled(int imageIndex) + throws IOException + { + return false; + } + + public boolean isRandomAccessEasy(int imageIndex) + throws IOException + { + return false; + } + + public boolean isSeekForwardOnly() + { + return seekForwardOnly; + } + + protected void processImageComplete() + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = (IIOReadProgressListener) it.next(); + listener.imageComplete (this); + } + } + + protected void processImageProgress(float percentageDone) + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = (IIOReadProgressListener) it.next(); + listener.imageProgress(this, percentageDone); + } + } + + protected void processImageStarted(int imageIndex) + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = (IIOReadProgressListener) it.next(); + listener.imageStarted(this, imageIndex); + } + } + + protected void processImageUpdate(BufferedImage image, int minX, int minY, + int width, int height, int periodX, + int periodY, int[] bands) + { + Iterator it = updateListeners.iterator(); + + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.imageUpdate(this, image, minX, minY, width, height, periodX, + periodY, bands); + } + } + + protected void processPassComplete(BufferedImage image) + { + Iterator it = updateListeners.iterator(); + + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.passComplete(this, image); + } + } + + protected void processPassStarted(BufferedImage image, int pass, int minPass, + int maxPass, int minX, int minY, + int periodX, int periodY, int[] bands) + { + Iterator it = updateListeners.iterator(); + + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.passStarted(this, image, pass, minPass, maxPass, minX, minY, + periodX, periodY, bands); + } + } + + protected void processReadAborted() + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = (IIOReadProgressListener) it.next(); + listener.readAborted(this); + } + } + + protected void processSequenceComplete() + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = (IIOReadProgressListener) it.next(); + listener.sequenceComplete(this); + } + } + + protected void processSequenceStarted(int minIndex) + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = (IIOReadProgressListener) it.next(); + listener.sequenceStarted(this, minIndex); + } + } + + protected void processThumbnailComplete() + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = (IIOReadProgressListener) it.next(); + listener.thumbnailComplete(this); + } + } + + protected void processThumbnailPassComplete(BufferedImage thumbnail) + { + Iterator it = updateListeners.iterator(); + + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.thumbnailPassComplete(this, thumbnail); + } + } + + protected void processThumbnailPassStarted(BufferedImage thumbnail, int pass, + int minPass, int maxPass, int minX, + int minY, int periodX, int periodY, + int[] bands) + { + Iterator it = updateListeners.iterator(); + + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.thumbnailPassStarted(this, thumbnail, pass, minPass, maxPass, + minX, minY, periodX, periodY, bands); + } + } + + protected void processThumbnailProgress(float percentageDone) + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = (IIOReadProgressListener) it.next(); + listener.thumbnailProgress(this, percentageDone); + } + } + + protected void processThumbnailStarted(int imageIndex, int thumbnailIndex) + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOReadProgressListener listener = (IIOReadProgressListener) it.next(); + listener.thumbnailStarted(this, imageIndex, thumbnailIndex); + } + } + + protected void processThumbnailUpdate(BufferedImage image, int minX, int minY, + int width, int height, int periodX, + int periodY, int[] bands) + { + Iterator it = updateListeners.iterator(); + + while (it.hasNext()) + { + IIOReadUpdateListener listener = (IIOReadUpdateListener) it.next(); + listener.thumbnailUpdate(this, image, minX, minY, width, height, + periodX, periodY, bands); + } + } + + protected void processWarningOccurred(String warning) + { + Iterator it = warningListeners.iterator(); + + while (it.hasNext()) + { + IIOReadWarningListener listener = (IIOReadWarningListener) it.next(); + listener.warningOccurred(this, warning); + } + } + + public abstract BufferedImage read(int imageIndex, ImageReadParam param) + throws IOException; + + public boolean readerSupportsThumbnails() + { + return false; + } + + public Raster readRaster(int imageIndex, ImageReadParam param) + throws IOException + { + throw new UnsupportedOperationException(); + } + + public BufferedImage readThumbnail(int imageIndex, int thumbnailIndex) + throws IOException + { + throw new UnsupportedOperationException(); + } + + public void removeAllIIOReadProgressListeners() + { + progressListeners.clear(); + } + + public void removeAllIIOReadUpdateListeners() + { + updateListeners.clear(); + } + + public void removeAllIIOReadWarningListeners() + { + warningListeners.clear(); + } + + public void removeIIOReadProgressListener(IIOReadProgressListener listener) + { + if (listener == null) + return; + + progressListeners.remove(listener); + } + + public void removeIIOReadUpdateListener(IIOReadUpdateListener listener) + { + if (listener == null) + return; + + updateListeners.remove(listener); + } + + public void removeIIOReadWarningListener(IIOReadWarningListener listener) + { + if (listener == null) + return; + + warningListeners.remove(listener); + } + + public void setLocale(Locale locale) + { + if (locale != null) + { + // Check if its a valid locale. + boolean found = false; + + if (availableLocales != null) + for (int i = availableLocales.length - 1; i >= 0; --i) + if (availableLocales[i].equals(locale)) + found = true; + + if (! found) + throw new IllegalArgumentException("looale not available"); + } + + this.locale = locale; + } } diff --git a/libjava/javax/imageio/ImageTranscoder.java b/libjava/javax/imageio/ImageTranscoder.java index 20c6959..7b2012b 100644 --- a/libjava/javax/imageio/ImageTranscoder.java +++ b/libjava/javax/imageio/ImageTranscoder.java @@ -1,5 +1,5 @@ /* ImageTranscoder.java -- Image metadata transcoder. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,9 +38,17 @@ exception statement from your version. */ package javax.imageio; +import javax.imageio.metadata.IIOMetadata; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ public interface ImageTranscoder { - // FIXME: Incomplete. This interface is merely present in order to - // allow compilation of the javax.imageio.spi package, for which GNU - // Classpath does provide an implementation. + IIOMetadata convertImageMetadata(IIOMetadata inData, + ImageTypeSpecifier imageType, + ImageWriteParam param); + + IIOMetadata convertStreamMetadata(IIOMetadata inData, + ImageWriteParam param); } diff --git a/libjava/javax/imageio/ImageTypeSpecifier.java b/libjava/javax/imageio/ImageTypeSpecifier.java new file mode 100644 index 0000000..f5d9ee2 --- /dev/null +++ b/libjava/javax/imageio/ImageTypeSpecifier.java @@ -0,0 +1,94 @@ +/* ImageTypeSpecifier.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio; + +import java.awt.image.ColorModel; +import java.awt.image.RenderedImage; +import java.awt.image.SampleModel; + +public class ImageTypeSpecifier +{ + protected ColorModel colorModel; + protected SampleModel sampleModel; + + public ImageTypeSpecifier(ColorModel colorModel, SampleModel sampleModel) + { + if (colorModel == null) + throw new IllegalArgumentException("colorModel may not be null"); + + if (sampleModel == null) + throw new IllegalArgumentException("sampleModel may not be null"); + + if (!colorModel.isCompatibleSampleModel(sampleModel)) + throw new IllegalArgumentException + ("sample Model not compatible with colorModel"); + + this.colorModel = colorModel; + this.sampleModel = sampleModel; + } + + public ImageTypeSpecifier(RenderedImage image) + { + if (image == null) + throw new IllegalArgumentException("image may not be null"); + + this.colorModel = image.getColorModel(); + this.sampleModel = image.getSampleModel(); + } + + public ColorModel getColorModel() + { + return colorModel; + } + + public int getNumBands() + { + return sampleModel.getNumBands(); + } + + public int getNumComponents() + { + return colorModel.getNumComponents(); + } + + public SampleModel getSampleModel() + { + return sampleModel; + } +} diff --git a/libjava/javax/imageio/ImageWriteParam.java b/libjava/javax/imageio/ImageWriteParam.java new file mode 100644 index 0000000..0eb9073 --- /dev/null +++ b/libjava/javax/imageio/ImageWriteParam.java @@ -0,0 +1,398 @@ +/* ImageWriteParam.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio; + +import java.awt.Dimension; +import java.util.Locale; + +public class ImageWriteParam extends IIOParam +{ + public static final int MODE_DISABLED = 0; + public static final int MODE_DEFAULT = 1; + public static final int MODE_EXPLICIT = 2; + public static final int MODE_COPY_FROM_METADATA = 3; + + protected boolean canOffsetTiles; + protected boolean canWriteCompressed; + protected boolean canWriteProgressive; + protected boolean canWriteTiles; + protected int compressionMode = MODE_COPY_FROM_METADATA; + protected float compressionQuality; + protected String compressionType; + protected String[] compressionTypes; + protected Locale locale; + protected Dimension[] preferredTileSizes; + protected int progressiveMode = MODE_COPY_FROM_METADATA; + protected int tileGridXOffset; + protected int tileGridYOffset; + protected int tileHeight; + protected int tileWidth; + protected int tilingMode; + protected boolean tilingSet; + + /** + * Creates an empty <code>ImageWriteParam</code> object. + * The subclass is responsible to initialize all fields. + */ + protected ImageWriteParam() + { + // Do nothing here. + } + + /** + * Creates an <code>ImageWriteParam</code> object with the given locale. + * + * @param locale the locale to use for user visible strings + */ + public ImageWriteParam(Locale locale) + { + this.locale = locale; + } + + public float getBitRate(float quality) + { + checkNotExplicitCompression(); + checkCompressionTypesSet(); + + return -1.0f; + } + + private void checkSupportsCompression() + { + if (! canWriteCompressed()) + throw new UnsupportedOperationException("compression not supported"); + } + + private void checkNotExplicitCompression() + { + if (getCompressionMode() != MODE_EXPLICIT) + throw new IllegalStateException("compression mode is not MODE_EXPLICIT"); + } + + private void checkCompressionTypesSet() + { + if (getCompressionType() == null + && getCompressionTypes() != null) + throw new IllegalStateException("no compression type set"); + } + + private void checkSupportsProgressiveEncoding() + { + if (! canWriteProgressive()) + throw new UnsupportedOperationException + ("progressive output not supported"); + } + + private void checkSupportsTiling() + { + if (! canWriteTiles()) + throw new UnsupportedOperationException("tiling not supported"); + } + + private void checkNotExplicitTiling() + { + if (getTilingMode() != MODE_EXPLICIT) + throw new IllegalStateException("tiling mode not MODE_EXPLICIT"); + } + + private void checkTilingInitialized() + { + if (! tilingSet) + throw new IllegalStateException("tiling parameters not set"); + } + + private void checkMode(int mode) + { + if (mode < MODE_DISABLED || mode > MODE_COPY_FROM_METADATA) + throw new IllegalArgumentException("mode not supported"); + } + + public boolean canOffsetTiles() + { + return canOffsetTiles; + } + + public boolean canWriteCompressed() + { + return canWriteCompressed; + } + + public boolean canWriteProgressive() + { + return canWriteProgressive; + } + + public boolean canWriteTiles() + { + return canWriteTiles; + } + + public int getCompressionMode() + { + checkSupportsCompression(); + + return compressionMode; + } + + public float getCompressionQuality() + { + checkNotExplicitCompression(); + checkCompressionTypesSet(); + + return compressionQuality; + } + + public String[] getCompressionQualityDescriptions() + { + checkNotExplicitCompression(); + checkCompressionTypesSet();; + + return null; + } + + public float[] getCompressionQualityValues() + { + checkNotExplicitCompression(); + checkCompressionTypesSet();; + + return null; + } + + public String getCompressionType() + { + checkNotExplicitCompression(); + + return compressionType; + } + + public String[] getCompressionTypes() + { + checkSupportsCompression(); + + return compressionTypes != null ? (String[]) compressionTypes.clone() : null; + } + + public Locale getLocale() + { + return locale; + } + + public String getLocalizedCompressionTypeName() + { + checkNotExplicitCompression(); + checkCompressionTypesSet(); + + return getCompressionType(); + } + + public Dimension[] getPreferredTileSizes() + { + checkSupportsTiling(); + + return preferredTileSizes; + } + + public int getProgressiveMode() + { + checkSupportsProgressiveEncoding(); + + return progressiveMode; + } + + public int getTileGridXOffset() + { + checkNotExplicitTiling(); + checkTilingInitialized(); + + return tileGridXOffset; + } + + public int getTileGridYOffset() + { + checkNotExplicitTiling(); + checkTilingInitialized(); + + return tileGridYOffset; + } + + public int getTileHeight() + { + checkNotExplicitTiling(); + checkTilingInitialized(); + + return tileHeight; + } + + public int getTileWidth() + { + checkNotExplicitTiling(); + checkTilingInitialized(); + + return tileWidth; + } + + public int getTilingMode() + { + checkSupportsTiling(); + + return tilingMode; + } + + public boolean isCompressionLossless() + { + checkNotExplicitCompression(); + checkCompressionTypesSet(); + + return true; + } + + public void setCompressionMode(int mode) + { + checkSupportsCompression(); + checkMode(mode); + + compressionMode = mode; + + if (mode == MODE_EXPLICIT) + unsetCompression(); + } + + public void setCompressionQuality(float quality) + { + checkNotExplicitCompression(); + checkCompressionTypesSet(); + + if (quality < 0.0f || quality > 1.0f) + throw new IllegalArgumentException("quality out of range"); + + compressionQuality = quality; + } + + public void setCompressionType(String compressionType) + { + checkNotExplicitCompression(); + + String[] types = getCompressionTypes(); + + if (types == null) + throw new UnsupportedOperationException("no settable compression types"); + + if (compressionType == null) + this.compressionType = null; + + for (int i = types.length - 1; i >= 0; --i) + if (types[i].equals(compressionType)) + { + this.compressionType = compressionType; + return; + } + + throw new IllegalArgumentException("unknown compression type"); + } + + public void setProgressiveMode(int mode) + { + checkSupportsProgressiveEncoding(); + checkMode(mode); + + progressiveMode = mode; + } + + public void setTiling(int tileWidth, int tileHeight, + int tileGridXOffset, int tileGridYOffset) + { + checkNotExplicitTiling(); + + if (! canOffsetTiles + && tileGridXOffset != 0 + && tileGridYOffset != 0) + throw new UnsupportedOperationException("tile offsets not supported"); + + if (tileWidth < 0 || tileHeight < 0) + throw new IllegalArgumentException("negative tile dimension"); + + if (preferredTileSizes != null) + { + boolean found = false; + + for (int i = 0; i < preferredTileSizes.length; i += 2) + { + if (tileWidth >= preferredTileSizes[i].width + && tileWidth <= preferredTileSizes[i + 1].width + && tileHeight >= preferredTileSizes[i].height + && tileHeight <= preferredTileSizes[i + 1].height) + found = true; + } + + if (! found) + throw new IllegalArgumentException("illegal tile size"); + } + + this.tilingSet = true; + this.tileWidth = tileWidth; + this.tileHeight = tileHeight; + this.tileGridXOffset = tileGridXOffset; + this.tileGridYOffset = tileGridYOffset; + } + + public void setTilingMode(int mode) + { + checkSupportsTiling(); + checkMode(mode); + tilingMode = mode; + } + + public void unsetCompression() + { + checkNotExplicitCompression(); + + compressionType = null; + compressionQuality = 1.0F; + } + + public void unsetTiling() + { + checkNotExplicitTiling(); + + tileWidth = 0; + tileHeight = 0; + tileGridXOffset = 0; + tileGridYOffset = 0; + } +} diff --git a/libjava/javax/imageio/ImageWriter.java b/libjava/javax/imageio/ImageWriter.java index 7ef60c3..64466b1 100644 --- a/libjava/javax/imageio/ImageWriter.java +++ b/libjava/javax/imageio/ImageWriter.java @@ -1,5 +1,5 @@ /* ImageWriter.java -- Encodes raster images. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,10 +38,352 @@ exception statement from your version. */ package javax.imageio; +import java.awt.Dimension; +import java.io.IOException; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; + +import javax.imageio.event.IIOWriteProgressListener; +import javax.imageio.event.IIOWriteWarningListener; +import javax.imageio.metadata.IIOMetadata; + +import javax.imageio.spi.ImageWriterSpi; + public abstract class ImageWriter implements ImageTranscoder { - // FIXME: Incomplete. This class is merely present in order to allow - // compilation of the javax.imageio.spi package, for which GNU - // Classpath does provide an implementation. + private boolean aborted; + + protected Locale[] availableLocales; + protected Locale locale; + protected ImageWriterSpi originatingProvider; + protected Object output; + protected List progressListeners; + protected List warningListeners; + protected List warningLocales; + + protected ImageWriter(ImageWriterSpi originatingProvider) + { + this.originatingProvider = originatingProvider; + } + + private void checkOutputSet() + { + if (output == null) + throw new IllegalStateException("no output set"); + } + + public void abort() + { + aborted = true; + } + + protected boolean abortRequested() + { + return aborted; + } + + public void addIIOWriteProgressListener(IIOWriteProgressListener listener) + { + if (listener == null) + return; + + progressListeners.add(listener); + } + + public void addIIOWriteWarningListener (IIOWriteWarningListener listener) + { + if (listener == null) + return; + + warningListeners.add(listener); + } + + public boolean canInsertEmpty(int imageIndex) + throws IOException + { + checkOutputSet(); + return false; + } + + public boolean canInsertImage(int imageIndex) + throws IOException + { + checkOutputSet(); + return false; + } + + public boolean canRemoveImage(int imageIndex) + throws IOException + { + checkOutputSet(); + return false; + } + + public boolean canReplaceImageMetadata(int imageIndex) + throws IOException + { + checkOutputSet(); + return false; + } + + public boolean canReplacePixels(int imageIndex) + throws IOException + { + checkOutputSet(); + return false; + } + + public boolean canReplaceStreamMetadata() + throws IOException + { + checkOutputSet(); + return false; + } + + public boolean canWriteEmpty() + throws IOException + { + checkOutputSet(); + return false; + } + + public boolean canWriteRasters() + { + return false; + } + + public boolean canWriteSequence() + { + return false; + } + + protected void clearAbortRequest() + { + aborted = false; + } + + public abstract IIOMetadata convertImageMetadata (IIOMetadata inData, + ImageTypeSpecifier imageType, + ImageWriteParam param); + + public abstract IIOMetadata convertStreamMetadata (IIOMetadata inData, + ImageWriteParam param); + + public void dispose() + { + // The default implementation is empty. Subclasses have to overwrite it. + } + + public Locale[] getAvailableLocales() + { + return availableLocales; + } + + public abstract IIOMetadata getDefaultImageMetadata (ImageTypeSpecifier imageType, ImageWriteParam param); + + public abstract IIOMetadata getDefaultStreamMetadata (ImageWriteParam param); + + public ImageWriteParam getDefaultWriteParam() + { + return new ImageWriteParam(getLocale()); + } + + public Locale getLocale() + { + return locale; + } + + public int getNumThumbnailsSupported (ImageTypeSpecifier imageType, ImageWriteParam param, + IIOMetadata streamMetadata, IIOMetadata imageMetadata) + { + return 0; + } + + public ImageWriterSpi getOriginatingProvider() + { + return originatingProvider; + } + + public Object getOutput() + { + return output; + } + + public Dimension[] getPreferredThumbnailSizes (ImageTypeSpecifier imageType, + ImageWriteParam param, + IIOMetadata streamMetadata, + IIOMetadata imageMetadata) + { + return null; + } + + protected void processImageComplete() + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next(); + listener.imageComplete(this); + } + } + + protected void processImageProgress(float percentageDone) + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next(); + listener.imageProgress(this, percentageDone); + } + } + + protected void processImageStarted(int imageIndex) + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next(); + listener.imageStarted(this, imageIndex); + } + } + + protected void processThumbnailComplete() + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next(); + listener.thumbnailComplete(this); + } + } + + protected void processThumbnailProgress(float percentageDone) + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next(); + listener.thumbnailProgress(this, percentageDone); + } + } + + protected void processThumbnailStarted(int imageIndex, int thumbnailIndex) + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next(); + listener.thumbnailStarted(this, imageIndex, thumbnailIndex); + } + } + + protected void processWarningOccurred(int imageIndex, String warning) + { + Iterator it = warningListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteWarningListener listener = (IIOWriteWarningListener) it.next(); + listener.warningOccurred(this, imageIndex, warning); + } + } + + protected void processWriteAborted() + { + Iterator it = progressListeners.iterator(); + + while (it.hasNext()) + { + IIOWriteProgressListener listener = (IIOWriteProgressListener) it.next(); + listener.writeAborted(this); + } + } + + public void removeAllIIOWriteProgressListeners() + { + progressListeners.clear(); + } + + public void removeAllIIOWriteWarningListeners() + { + progressListeners.clear(); + } + + public void removeIIOWriteProgressListener (IIOWriteProgressListener listener) + { + if (listener == null) + return; + + progressListeners.remove(listener); + } + + public void removeIIOWriteWarningListener (IIOWriteWarningListener listener) + { + if (listener == null) + return; + + warningListeners.remove(listener); + } + + public void reset() + { + setOutput(null); + setLocale(null); + removeAllIIOWriteWarningListeners(); + removeAllIIOWriteProgressListeners(); + clearAbortRequest(); + } + + public void setLocale(Locale locale) + { + if (locale != null) + { + // Check if its a valid locale. + boolean found = false; + + if (availableLocales != null) + for (int i = availableLocales.length - 1; i >= 0; --i) + if (availableLocales[i].equals(locale)) + found = true; + + if (! found) + throw new IllegalArgumentException("looale not available"); + } + + this.locale = locale; + } + + public void setOutput(Object output) + { + if (output != null) + { + // Check if its a valid output object. + boolean found = false; + Class[] types = null; + + if (originatingProvider != null) + types = originatingProvider.getOutputTypes(); + + if (types != null) + for (int i = types.length - 1; i >= 0; --i) + if (types[i].equals(output.getClass())) + found = true; + + if (! found) + throw new IllegalArgumentException("output type not available"); + } + + this.output = output; + } + + public abstract void write (IIOMetadata streamMetadata, IIOImage image, ImageWriteParam param) + throws IOException; } diff --git a/libjava/javax/imageio/event/IIOReadProgressListener.java b/libjava/javax/imageio/event/IIOReadProgressListener.java index 1574432..7ba5bba 100644 --- a/libjava/javax/imageio/event/IIOReadProgressListener.java +++ b/libjava/javax/imageio/event/IIOReadProgressListener.java @@ -35,11 +35,12 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package javax.imageio.event; import java.util.EventListener; -import javax.imageio.ImageReader; +import javax.imageio.ImageReader; public interface IIOReadProgressListener extends EventListener { diff --git a/libjava/javax/imageio/event/IIOReadUpdateListener.java b/libjava/javax/imageio/event/IIOReadUpdateListener.java index d51c852..18ac4f0 100644 --- a/libjava/javax/imageio/event/IIOReadUpdateListener.java +++ b/libjava/javax/imageio/event/IIOReadUpdateListener.java @@ -35,12 +35,13 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package javax.imageio.event; import java.awt.image.BufferedImage; import java.util.EventListener; -import javax.imageio.ImageReader; +import javax.imageio.ImageReader; public interface IIOReadUpdateListener extends EventListener { diff --git a/libjava/javax/imageio/event/IIOReadWarningListener.java b/libjava/javax/imageio/event/IIOReadWarningListener.java index ab12df0..34fcbb7 100644 --- a/libjava/javax/imageio/event/IIOReadWarningListener.java +++ b/libjava/javax/imageio/event/IIOReadWarningListener.java @@ -35,11 +35,12 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package javax.imageio.event; import java.util.EventListener; -import javax.imageio.ImageReader; +import javax.imageio.ImageReader; public interface IIOReadWarningListener extends EventListener { diff --git a/libjava/javax/imageio/event/IIOWriteProgressListener.java b/libjava/javax/imageio/event/IIOWriteProgressListener.java index 6158c54..e713642 100644 --- a/libjava/javax/imageio/event/IIOWriteProgressListener.java +++ b/libjava/javax/imageio/event/IIOWriteProgressListener.java @@ -35,11 +35,12 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package javax.imageio.event; import java.util.EventListener; -import javax.imageio.ImageWriter; +import javax.imageio.ImageWriter; public interface IIOWriteProgressListener extends EventListener { diff --git a/libjava/javax/imageio/event/IIOWriteWarningListener.java b/libjava/javax/imageio/event/IIOWriteWarningListener.java index a0630c9..9f8d521 100644 --- a/libjava/javax/imageio/event/IIOWriteWarningListener.java +++ b/libjava/javax/imageio/event/IIOWriteWarningListener.java @@ -35,11 +35,12 @@ this exception to your version of the library, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. */ + package javax.imageio.event; import java.util.EventListener; -import javax.imageio.ImageWriter; +import javax.imageio.ImageWriter; /** * @author Michael Koch (konqueror@gmx.de) diff --git a/libjava/javax/imageio/event/package.html b/libjava/javax/imageio/event/package.html new file mode 100644 index 0000000..c36a11a --- /dev/null +++ b/libjava/javax/imageio/event/package.html @@ -0,0 +1,46 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - describes classes in javax.imageio.event package. + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. --> + +<html> +<head><title>GNU Classpath - javax.imageio.event</title></head> + +<body> +<p></p> + +</body> +</html> diff --git a/libjava/javax/imageio/metadata/IIOInvalidTreeException.java b/libjava/javax/imageio/metadata/IIOInvalidTreeException.java new file mode 100644 index 0000000..c3ce424 --- /dev/null +++ b/libjava/javax/imageio/metadata/IIOInvalidTreeException.java @@ -0,0 +1,63 @@ +/* IIOInvalidTreeException.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.metadata; + +import javax.imageio.IIOException; + +public class IIOInvalidTreeException extends IIOException +{ + protected /*Node*/ Object offendingNode; + + public IIOInvalidTreeException(String message, /*Node*/ Object offendingNode) + { + super(message); + this.offendingNode = offendingNode; + } + + public IIOInvalidTreeException(String message, Throwable cause, /*Node*/ Object offendingNode) + { + super(message, cause); + this.offendingNode = offendingNode; + } + + public /*Node*/ Object getOffendingNode() + { + return offendingNode; + } +} diff --git a/libjava/javax/imageio/metadata/IIOMetadata.java b/libjava/javax/imageio/metadata/IIOMetadata.java new file mode 100644 index 0000000..bb96770 --- /dev/null +++ b/libjava/javax/imageio/metadata/IIOMetadata.java @@ -0,0 +1,213 @@ +/* IIOMetadata.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.metadata; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public abstract class IIOMetadata +{ + protected IIOMetadataController controller; + protected IIOMetadataController defaultController; + protected String[] extraMetadataFormatClassNames; + protected String[] extraMetadataFormatNames; + protected String nativeMetadataFormatClassName; + protected String nativeMetadataFormatName; + protected boolean standardFormatSupported; + + /** + * Creates a <code>IIOMetaData</code> object. + */ + protected IIOMetadata() + { + // Do nothing here. + } + + /** + * Creates a <code>IIOMetaData</code> object with the given arguments. + * + * @param standardMetadataFormatSupported + * @param nativeMetadataFormatName + * @param nativeMetadataFormatClassName + * @param extraMetadataFormatNames + * @param extraMetadataFormatClassNames + * + * @throws IllegalArgumentException if extraMetadataFormatNames has length of + * zero or extraMetadataFormatNames and extraMetadataFormatClassNames are + * neither both null, not have the same length + */ + protected IIOMetadata(boolean standardMetadataFormatSupported, + String nativeMetadataFormatName, + String nativeMetadataFormatClassName, + String[] extraMetadataFormatNames, + String[] extraMetadataFormatClassNames) + { + if (extraMetadataFormatNames != null + && extraMetadataFormatNames.length == 0) + throw new IllegalArgumentException + ("extraMetadataFormatNames may not be empty"); + + if (((extraMetadataFormatNames == null) + && (extraMetadataFormatClassNames != null)) + || ((extraMetadataFormatNames != null) + && (extraMetadataFormatClassNames == null)) + || ((extraMetadataFormatNames != null) + && (extraMetadataFormatClassNames != null) + && (extraMetadataFormatNames.length != + extraMetadataFormatClassNames.length))) + throw new IllegalArgumentException + ("extraMetadataFormatNames and extraMetadataFormatClassNames " + + "have different lengths"); + + this.standardFormatSupported = standardMetadataFormatSupported; + this.nativeMetadataFormatName = nativeMetadataFormatName; + this.nativeMetadataFormatClassName = nativeMetadataFormatClassName; + this.extraMetadataFormatNames = extraMetadataFormatNames; + this.extraMetadataFormatClassNames = extraMetadataFormatClassNames; + } + + public boolean activateController() + { + if (! hasController()) + return false; + + return getDefaultController().activate(this); + } + + public IIOMetadataController getController() + { + return controller; + } + + public IIOMetadataController getDefaultController() + { + return defaultController; + } + + public String[] getExtraMetadataFormatNames() + { + return (String[]) extraMetadataFormatNames.clone(); + } + + public IIOMetadataFormat getMetadataFormat(String formatName) + { + if (formatName == null) + throw new IllegalArgumentException("formatName may not be null"); + + String formatClassName = null; + + if (isStandardMetadataFormatSupported() + && formatName.equals(nativeMetadataFormatName)) + formatClassName = nativeMetadataFormatClassName; + else + { + String[] extraFormatNames = getExtraMetadataFormatNames(); + + for (int i = extraFormatNames.length - 1; i >= 0; --i) + if (extraFormatNames[i].equals(formatName)) + { + formatClassName = extraFormatNames[i]; + break; + } + } + + if (formatClassName == null) + throw new IllegalArgumentException("unknown format"); + + IIOMetadataFormat format; + + try + { + format = (IIOMetadataFormat) Class.forName(formatClassName) + .newInstance(); + } + catch (Exception e) + { + IllegalStateException ise = new IllegalStateException(); + ise.initCause(e); + throw ise; + } + + return format; + } + + public String[] getMetadataFormatNames() + { + String[] formatNames = getExtraMetadataFormatNames(); + + if (isStandardMetadataFormatSupported()) + { + // Combine native metadata format name and extra metadata format names + // into one String array. + String[] tmp = new String[formatNames.length + 1]; + tmp[0] = getNativeMetadataFormatName(); + + for (int i = 1; i < tmp.length; ++i) + tmp[i] = formatNames[i - 1]; + + formatNames = tmp; + } + + return formatNames; + } + + public String getNativeMetadataFormatName() + { + return nativeMetadataFormatName; + } + + public boolean hasController() + { + return getController() != null; + } + + public abstract boolean isReadOnly(); + + public boolean isStandardMetadataFormatSupported() + { + return standardFormatSupported; + } + + public abstract void reset(); + + public void setController(IIOMetadataController controller) + { + this.controller = controller; + } +} diff --git a/libjava/javax/imageio/metadata/IIOMetadataController.java b/libjava/javax/imageio/metadata/IIOMetadataController.java new file mode 100644 index 0000000..db899d8 --- /dev/null +++ b/libjava/javax/imageio/metadata/IIOMetadataController.java @@ -0,0 +1,47 @@ +/* IIOMetadataController.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.metadata; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public interface IIOMetadataController +{ + boolean activate(IIOMetadata metadata); +} diff --git a/libjava/javax/imageio/metadata/IIOMetadataFormat.java b/libjava/javax/imageio/metadata/IIOMetadataFormat.java new file mode 100644 index 0000000..2aef266 --- /dev/null +++ b/libjava/javax/imageio/metadata/IIOMetadataFormat.java @@ -0,0 +1,124 @@ +/* IIOMetadataFormat.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.metadata; + +import java.util.Locale; + +import javax.imageio.ImageTypeSpecifier; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public interface IIOMetadataFormat +{ + int CHILD_POLICY_ALL = 1; + int CHILD_POLICY_CHOICE = 3; + int CHILD_POLICY_EMPTY = 0; + int CHILD_POLICY_MAX = 5; + int CHILD_POLICY_REPEAT = 5; + int CHILD_POLICY_SEQUENCE = 4; + int CHILD_POLICY_SOME = 2; + int DATATYPE_BOOLEAN = 1; + int DATATYPE_DOUBLE = 4; + int DATATYPE_FLOAT = 3; + int DATATYPE_INTEGER = 2; + int DATATYPE_STRING = 0; + int VALUE_ARBITRARY = 1; + int VALUE_ENUMERATION = 16; + int VALUE_LIST = 32; + int VALUE_NONE = 0; + int VALUE_RANGE = 2; + int VALUE_RANGE_MAX_INCLUSIVE = 10; + int VALUE_RANGE_MAX_INCLUSIVE_MASK = 8; + int VALUE_RANGE_MIN_INCLUSIVE = 6; + int VALUE_RANGE_MIN_INCLUSIVE_MASK = 4; + int VALUE_RANGE_MIN_MAX_INCLUSIVE = 14; + + boolean canNodeAppear (String elementName, ImageTypeSpecifier imageType); + + int getAttributeDataType (String elementName, String attrName); + + String getAttributeDefaultValue (String elementName, String attrName); + + String getAttributeDescription (String elementName, String attrName, Locale locale); + + String[] getAttributeEnumerations (String elementName, String attrName); + + int getAttributeListMaxLength (String elementName, String attrName); + + int getAttributeListMinLength (String elementName, String attrName); + + String getAttributeMaxValue (String elementName, String attrName); + + String getAttributeMinValue (String elementName, String attrName); + + String[] getAttributeNames (String elementName); + + int getAttributeValueType (String elementName, String attrName); + + String[] getChildNames (String elementName); + + int getChildPolicy (String elementName); + + String getElementDescription (String elementName, Locale locale); + + int getElementMaxChildren (String elementName); + + int getElementMinChildren (String elementName); + + int getObjectArrayMaxLength (String elementName); + + int getObjectArrayMinLength (String elementName); + + Class getObjectClass (String elementName); + + Object getObjectDefaultValue (String elementName); + + Object[] getObjectEnumerations (String elementName); + + Comparable getObjectMaxValue (String elementName); + + Comparable getObjectMinValue (String elementName); + + int getObjectValueType (String elementName); + + String getRootName(); + + boolean isAttributeRequired (String elementName, String attrName); +} diff --git a/libjava/javax/imageio/metadata/IIOMetadataFormatImpl.java b/libjava/javax/imageio/metadata/IIOMetadataFormatImpl.java new file mode 100644 index 0000000..eab2055 --- /dev/null +++ b/libjava/javax/imageio/metadata/IIOMetadataFormatImpl.java @@ -0,0 +1,43 @@ +/* IIOMetadataFormatImpl.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.metadata; + +public abstract class IIOMetadataFormatImpl implements IIOMetadataFormat +{ +} diff --git a/libjava/javax/imageio/metadata/IIOMetadataNode.java b/libjava/javax/imageio/metadata/IIOMetadataNode.java new file mode 100644 index 0000000..3d1c7d2 --- /dev/null +++ b/libjava/javax/imageio/metadata/IIOMetadataNode.java @@ -0,0 +1,43 @@ +/* IIOMetadataNode.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.metadata; + +public class IIOMetadataNode +{ +} diff --git a/libjava/javax/imageio/metadata/package.html b/libjava/javax/imageio/metadata/package.html new file mode 100644 index 0000000..3188e32 --- /dev/null +++ b/libjava/javax/imageio/metadata/package.html @@ -0,0 +1,46 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- package.html - describes classes in javax.imageio.metadata package. + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. --> + +<html> +<head><title>GNU Classpath - javax.imageio.metadata</title></head> + +<body> +<p></p> + +</body> +</html> diff --git a/libjava/javax/imageio/spi/IIORegistry.java b/libjava/javax/imageio/spi/IIORegistry.java new file mode 100644 index 0000000..7728cf4 --- /dev/null +++ b/libjava/javax/imageio/spi/IIORegistry.java @@ -0,0 +1,103 @@ +/* IIORegistry.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.spi; + +import gnu.classpath.ServiceFactory; + +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; + +public final class IIORegistry extends ServiceRegistry +{ + private static final HashSet defaultCategories = new HashSet(); + + private static HashMap instances = new HashMap(); + + static + { + //defaultCategories.add(ImageReaderSpi.class); + //defaultCategories.add(ImageWriterSpi.class); + defaultCategories.add(ImageTranscoderSpi.class); + defaultCategories.add(ImageInputStreamSpi.class); + defaultCategories.add(ImageOutputStreamSpi.class); + } + + public static synchronized IIORegistry getDefaultInstance() + { + ThreadGroup group = Thread.currentThread().getThreadGroup(); + IIORegistry registry = (IIORegistry) instances.get(group); + + if (registry == null) + { + registry = new IIORegistry(); + instances.put(group, registry); + } + + return registry; + } + + private IIORegistry() + { + super(defaultCategories.iterator()); + + // XXX: Register built-in Spis here. + + registerApplicationClasspathSpis(); + } + + /** + * Registers all available service providers found on the application + * classpath. + */ + public void registerApplicationClasspathSpis() + { + ClassLoader loader = Thread.currentThread().getContextClassLoader(); + Iterator categories = getCategories(); + + while (categories.hasNext()) + { + Class category = (Class) categories.next(); + Iterator providers = ServiceFactory.lookupProviders(category, loader); + + while (providers.hasNext()) + registerServiceProvider((IIOServiceProvider) providers.next()); + } + } +} diff --git a/libjava/javax/imageio/spi/ImageInputStreamSpi.java b/libjava/javax/imageio/spi/ImageInputStreamSpi.java index b8d5854..6e33d1d 100644 --- a/libjava/javax/imageio/spi/ImageInputStreamSpi.java +++ b/libjava/javax/imageio/spi/ImageInputStreamSpi.java @@ -40,8 +40,8 @@ package javax.imageio.spi; import java.io.File; import java.io.IOException; -import javax.imageio.stream.ImageInputStream; +import javax.imageio.stream.ImageInputStream; /** * An abstract superclass for service providers that create diff --git a/libjava/javax/imageio/spi/ImageOutputStreamSpi.java b/libjava/javax/imageio/spi/ImageOutputStreamSpi.java index aa287c3..935aa7c 100644 --- a/libjava/javax/imageio/spi/ImageOutputStreamSpi.java +++ b/libjava/javax/imageio/spi/ImageOutputStreamSpi.java @@ -40,8 +40,8 @@ package javax.imageio.spi; import java.io.File; import java.io.IOException; -import javax.imageio.stream.ImageOutputStream; +import javax.imageio.stream.ImageOutputStream; /** * An abstract superclass for service providers that create diff --git a/libjava/javax/imageio/spi/ImageReaderSpi.java b/libjava/javax/imageio/spi/ImageReaderSpi.java new file mode 100644 index 0000000..e041c37 --- /dev/null +++ b/libjava/javax/imageio/spi/ImageReaderSpi.java @@ -0,0 +1,121 @@ +/* ImageReaderSpi.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.spi; + +import java.io.IOException; + +import javax.imageio.ImageReader; +import javax.imageio.stream.ImageInputStream; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public abstract class ImageReaderSpi extends ImageReaderWriterSpi +{ + public static final Class[] STANDARD_INPUT_TYPE = + { ImageInputStream.class }; + + protected Class[] inputTypes; + protected String[] writerSpiNames; + + protected ImageReaderSpi() + { + // Do nothing here. + } + + public ImageReaderSpi(String vendorName, String version, String[] names, + String[] suffixes, String[] MIMETypes, + String readerClassName, Class[] inputTypes, + String[] writerSpiNames, + boolean supportsStandardStreamMetadataFormat, + String nativeStreamMetadataFormatName, + String nativeStreamMetadataFormatClassName, + String[] extraStreamMetadataFormatNames, + String[] extraStreamMetadataFormatClassNames, + boolean supportsStandardImageMetadataFormat, + String nativeImageMetadataFormatName, + String nativeImageMetadataFormatClassName, + String[] extraImageMetadataFormatNames, + String[] extraImageMetadataFormatClassNames) + { + super(vendorName, version, names, suffixes, MIMETypes, readerClassName, + supportsStandardStreamMetadataFormat, nativeStreamMetadataFormatName, + nativeStreamMetadataFormatClassName, extraStreamMetadataFormatNames, + extraStreamMetadataFormatClassNames, supportsStandardImageMetadataFormat, + nativeImageMetadataFormatName, nativeImageMetadataFormatClassName, + extraImageMetadataFormatNames, extraImageMetadataFormatClassNames); + + if (inputTypes == null + || inputTypes.length == 0) + throw new IllegalArgumentException("inputTypes may not be null or empty"); + + this.inputTypes = inputTypes; + this.writerSpiNames = writerSpiNames; + } + + public abstract boolean canDecodeInput(Object source) + throws IOException; + + public ImageReader createReaderInstance() + throws IOException + { + return createReaderInstance(null); + } + + public abstract ImageReader createReaderInstance(Object extension) + throws IOException; + + public String[] getImageWriterSpiNames() + { + return writerSpiNames; + } + + public Class[] getInputTypes() + { + return inputTypes; + } + + public boolean isOwnReader(ImageReader reader) + { + if (reader == null) + throw new IllegalArgumentException("reader may not be null"); + + return pluginClassName.equals(reader.getClass().getName()); + } +} diff --git a/libjava/javax/imageio/spi/ImageWriterSpi.java b/libjava/javax/imageio/spi/ImageWriterSpi.java new file mode 100644 index 0000000..306408d --- /dev/null +++ b/libjava/javax/imageio/spi/ImageWriterSpi.java @@ -0,0 +1,135 @@ +/* ImageWriterSpi.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.spi; + +import java.awt.image.RenderedImage; +import java.io.IOException; + +import javax.imageio.ImageTypeSpecifier; +import javax.imageio.ImageWriter; +import javax.imageio.stream.ImageOutputStream; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public abstract class ImageWriterSpi extends ImageReaderWriterSpi +{ + public static final Class[] STANDARD_OUTPUT_TYPE = + { ImageOutputStream.class }; + + protected Class[] outputTypes; + protected String[] readerSpiNames; + + protected ImageWriterSpi() + { + // Do nothing here. + } + + public ImageWriterSpi(String vendorName, String version, String[] names, + String[] suffixes, String[] MIMETypes, + String writerClassName, Class[] outputTypes, + String[] readerSpiNames, + boolean supportsStandardStreamMetadataFormat, + String nativeStreamMetadataFormatName, + String nativeStreamMetadataFormatClassName, + String[] extraStreamMetadataFormatNames, + String[] extraStreamMetadataFormatClassNames, + boolean supportsStandardImageMetadataFormat, + String nativeImageMetadataFormatName, + String nativeImageMetadataFormatClassName, + String[] extraImageMetadataFormatNames, + String[] extraImageMetadataFormatClassNames) + { + super(vendorName, version, names, suffixes, MIMETypes, writerClassName, + supportsStandardStreamMetadataFormat, nativeStreamMetadataFormatName, + nativeStreamMetadataFormatClassName, extraStreamMetadataFormatNames, + extraStreamMetadataFormatClassNames, supportsStandardImageMetadataFormat, + nativeImageMetadataFormatName, nativeImageMetadataFormatClassName, + extraImageMetadataFormatNames, extraImageMetadataFormatClassNames); + + if (writerClassName == null) + throw new IllegalArgumentException("writerClassName is null"); + + if (outputTypes == null + || outputTypes.length == 0) + throw new IllegalArgumentException("outputTypes may not be null or empty"); + + this.outputTypes = outputTypes; + this.readerSpiNames = readerSpiNames; + } + + public abstract boolean canEncodeImage(ImageTypeSpecifier type); + + public boolean canEncodeImage(RenderedImage image) + { + return canEncodeImage (new ImageTypeSpecifier(image)); + } + + public ImageWriter createWriterInstance() + throws IOException + { + return createWriterInstance(null); + } + + public abstract ImageWriter createWriterInstance(Object extension) + throws IOException; + + public String[] getImageReaderSpiNames() + { + return readerSpiNames; + } + + public Class[] getOutputTypes() + { + return outputTypes; + } + + public boolean isFormatLossless() + { + return true; + } + + public boolean isOwnWriter(ImageWriter writer) + { + if (writer == null) + throw new IllegalArgumentException("writer may not be null"); + + return pluginClassName.equals(writer.getClass().getName()); + } +} diff --git a/libjava/javax/imageio/spi/ServiceRegistry.java b/libjava/javax/imageio/spi/ServiceRegistry.java index c41e1b5..566d50f 100644 --- a/libjava/javax/imageio/spi/ServiceRegistry.java +++ b/libjava/javax/imageio/spi/ServiceRegistry.java @@ -38,9 +38,19 @@ exception statement from your version. */ package javax.imageio.spi; -import java.util.*; import gnu.classpath.ServiceFactory; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Set; /** * A registry for service providers. @@ -100,6 +110,8 @@ public class ServiceRegistry /** * Constructs a <code>ServiceRegistry</code> for the specified * service categories. + * + * @param categories the categories to support * * @throws IllegalArgumentException if <code>categories</code> is * <code>null</code>, or if its {@link Iterator#next()} method @@ -141,7 +153,7 @@ public class ServiceRegistry * might make sense to install only the frequently needed service * providers on the local machine. More exotic providers can be put * onto a server; the server will only be contacted when no suitable - * service could be found locally. + * service could be found locally.</p> * * <p><b>Security considerations:</b> Any loaded service providers * are loaded through the specified ClassLoader, or the system @@ -150,7 +162,7 @@ public class ServiceRegistry * the current {@link java.security.AccessControlContext} gets * recorded. This captured security context will determine the * permissions when services get loaded via the <code>next()</code> - * method of the returned <code>Iterator</code>. + * method of the returned <code>Iterator</code>.</p> * * @param spi the service provider interface which must be * implemented by any loaded service providers. @@ -474,7 +486,7 @@ public class ServiceRegistry * invoked in order to inform the provider about the removal from * this registry. If <code>provider</code> implements several * service categories, <code>onDeregistration</code> gets called - * multiple times. + * multiple times.</p> * * @param provider the service provider to be de-registered. * diff --git a/libjava/javax/imageio/stream/FileCacheImageInputStream.java b/libjava/javax/imageio/stream/FileCacheImageInputStream.java new file mode 100644 index 0000000..49827d4 --- /dev/null +++ b/libjava/javax/imageio/stream/FileCacheImageInputStream.java @@ -0,0 +1,93 @@ +/* FileCacheImageInputStream.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.stream; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public class FileCacheImageInputStream +{ + private InputStream stream; + private File cacheDir; + + public FileCacheImageInputStream(InputStream stream, File cacheDir) + throws IOException + { + super(); + this.stream = stream; + // FIXME: We do not support caching yet. + this.cacheDir = cacheDir; + } + + public void close() + throws IOException + { + if (stream != null) + { + stream.close(); + stream = null; + } + } + + private void checkStreamClosed() + throws IOException + { + if (stream == null) + throw new IOException("stream closed"); + } + + public boolean isCached() + { + return true; + } + + public boolean isCachedFile() + { + return true; + } + + public boolean isCachedMemory() + { + return false; + } +} diff --git a/libjava/javax/imageio/stream/FileCacheImageOutputStream.java b/libjava/javax/imageio/stream/FileCacheImageOutputStream.java new file mode 100644 index 0000000..f8bb310 --- /dev/null +++ b/libjava/javax/imageio/stream/FileCacheImageOutputStream.java @@ -0,0 +1,93 @@ +/* FileCacheImageOutputStream.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.stream; + +import java.io.File; +import java.io.IOException; +import java.io.OutputStream; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public class FileCacheImageOutputStream +{ + private OutputStream stream; + private File cacheDir; + + public FileCacheImageOutputStream(OutputStream stream, File cacheDir) + throws IOException + { + super(); + this.stream = stream; + // FIXME: We do not support caching yet. + this.cacheDir = cacheDir; + } + + public void close() + throws IOException + { + if (stream != null) + { + stream.close(); + stream = null; + } + } + + private void checkStreamClosed() + throws IOException + { + if (stream == null) + throw new IOException("stream closed"); + } + + public boolean isCached() + { + return true; + } + + public boolean isCachedFile() + { + return true; + } + + public boolean isCachedMemory() + { + return false; + } +} diff --git a/libjava/javax/imageio/stream/FileImageInputStream.java b/libjava/javax/imageio/stream/FileImageInputStream.java new file mode 100644 index 0000000..67fd075 --- /dev/null +++ b/libjava/javax/imageio/stream/FileImageInputStream.java @@ -0,0 +1,87 @@ +/* FileImageInputStream.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.stream; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public class FileImageInputStream +{ + private RandomAccessFile file; + + public FileImageInputStream(File file) + throws FileNotFoundException, IOException + { + if (file == null) + throw new IllegalArgumentException ("file may not be null"); + + this.file = new RandomAccessFile(file, "r"); + } + + public FileImageInputStream(RandomAccessFile file) + { + if (file == null) + throw new IllegalArgumentException ("file may not be null"); + + this.file = file; + } + + public void close() + throws IOException + { + file.close(); + } + + public long length() + { + try + { + return file.length(); + } + catch (IOException e) + { + return -1L; + } + } +} diff --git a/libjava/javax/imageio/stream/FileImageOutputStream.java b/libjava/javax/imageio/stream/FileImageOutputStream.java new file mode 100644 index 0000000..073faed --- /dev/null +++ b/libjava/javax/imageio/stream/FileImageOutputStream.java @@ -0,0 +1,90 @@ +/* FileImageOutputStream.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.stream; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public class FileImageOutputStream +{ + private RandomAccessFile file; + + public FileImageOutputStream(File file) + throws FileNotFoundException, IOException + { + if (file == null) + throw new IllegalArgumentException("file may not be null"); + + // Do security check. + file.canRead(); + + this.file = new RandomAccessFile(file, "r"); + } + + public FileImageOutputStream(RandomAccessFile file) + { + if (file == null) + throw new IllegalArgumentException("file may not be null"); + + this.file = file; + } + + public void close() + throws IOException + { + file.close(); + } + + public long length() + { + try + { + return file.length(); + } + catch (IOException e) + { + return -1L; + } + } +} diff --git a/libjava/javax/imageio/stream/ImageInputStream.java b/libjava/javax/imageio/stream/ImageInputStream.java index d37231d..39296a7 100644 --- a/libjava/javax/imageio/stream/ImageInputStream.java +++ b/libjava/javax/imageio/stream/ImageInputStream.java @@ -626,8 +626,7 @@ public interface ImageInputStream void seek(long pos) throws IOException; - void mark() - throws IOException; + void mark(); void reset() throws IOException; diff --git a/libjava/javax/imageio/stream/ImageInputStreamImpl.java b/libjava/javax/imageio/stream/ImageInputStreamImpl.java new file mode 100644 index 0000000..27cb6c5 --- /dev/null +++ b/libjava/javax/imageio/stream/ImageInputStreamImpl.java @@ -0,0 +1,157 @@ +/* ImageInputStream.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.stream; + +import java.io.IOException; +import java.nio.ByteOrder; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public abstract class ImageInputStreamImpl implements ImageInputStream +{ + private boolean closed; + + protected int bitOffset; + protected ByteOrder byteOrder; + protected long flushedPos; + protected long streamPos; + + public ImageInputStreamImpl() + { + // Do nothing here. + } + + protected void checkClosed() + throws IOException + { + if (closed) + throw new IOException("stream closed"); + } + + public void close() + throws IOException + { + checkClosed(); + closed = true; + } + + protected void finalize() + throws Throwable + { + close(); + } + + public void flush() + throws IOException + { + flushBefore(getStreamPosition()); + } + + public void flushBefore(long position) + throws IOException + { + if (position < flushedPos) + throw new IndexOutOfBoundsException(); + + if (position > streamPos) + throw new IndexOutOfBoundsException(); + + flushedPos = position; + } + + public int getBitOffset() + throws IOException + { + return bitOffset; + } + + public ByteOrder getByteOrder() + { + return byteOrder; + } + + public long getFlushedPosition() + { + return flushedPos; + } + + public long getStreamPosition() + throws IOException + { + return streamPos; + } + + public boolean isCached() + { + return false; + } + + public boolean isCachedFile() + { + return false; + } + + public boolean isCachedMemory() + { + return false; + } + + public long length() + { + return -1L; + } + + public abstract int read() + throws IOException; + + public int read(byte[] data) + throws IOException + { + return read(data, 0, data.length); + } + + public abstract int read(byte[] data, int offset, int len) + throws IOException; + + public void setByteOrder (ByteOrder byteOrder) + { + this.byteOrder = byteOrder; + } +} diff --git a/libjava/javax/imageio/stream/ImageOutputStream.java b/libjava/javax/imageio/stream/ImageOutputStream.java index 58a6594..f53feab 100644 --- a/libjava/javax/imageio/stream/ImageOutputStream.java +++ b/libjava/javax/imageio/stream/ImageOutputStream.java @@ -39,6 +39,7 @@ exception statement from your version. */ package javax.imageio.stream; import java.io.DataOutput; +import java.io.IOException; /** @@ -52,7 +53,217 @@ import java.io.DataOutput; public interface ImageOutputStream extends ImageInputStream, DataOutput { - // FIXME: Incomplete. This interface is merely present in order to - // allow compilation of the javax.imageio.spi package, for which GNU - // Classpath does provide an implementation. + /** + * @param postion + * + * @throws IOException if an errror occurs + */ + void flushBefore(long position) throws IOException; + + /** + * Writes an array into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void write(byte[] data) throws IOException; + + /** + * Writes a region of data from an array into the stream. + * + * @param data the data to be written + * @param offset the offset in the array + * @param len the length in the array + * + * @throws IOException if an errror occurs + */ + void write(byte[] data, int offset, int len) throws IOException; + + /** + * Writes an <code>int</code> into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void write(int data) throws IOException; + + /** + * Writes a bit value to the stream. + * + * @throws IOException if an error occurs + */ + void writeBit(int bit) throws IOException; + + /** + * Writes a number of bit values to the stream. + * + * @throws IOException if an errror occurs + */ + void writeBits(long bits, int numBits) throws IOException; + + /** + * Writes a <code>boolean</code> value into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void writeBoolean(boolean data) throws IOException; + + /** + * Writes a <code>byte</code> value into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void writeByte(int data) throws IOException; + + /** + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void writeBytes(String data) throws IOException; + + /** + * Writes a character into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void writeChar(int data) throws IOException; + + /** + * Writes characters to the stream. + * + * @param data the data to be written + * @param offset the offset in the array + * @param len the lenth in the array + * + * @throws IOException if an errror occurs + */ + void writeChars(char[] data, int offset, int len) throws IOException; + + /** + * Writes characters from a given <code>String</code> into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void writeChars(String data) throws IOException; + + /** + * Writes a <code>double</code> into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void writeDouble(double data) throws IOException; + + /** + * Writes an array of <code>double</code> into the stream. + * + * @param data the data to be written + * @param offset the offset in the array + * @param len the lenth in the array + * + * @throws IOException if an errror occurs + */ + void writeDoubles(double[] data, int offset, int len) + throws IOException; + + /** + * Writes a <code>float</code> into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void writeFloat(float data) throws IOException; + + /** + * Writes an array of <code>float</code> into the stream. + * + * @param data the data to be written + * @param offset the offset in the array + * @param len the lenth in the array + * + * @throws IOException if an errror occurs + */ + void writeFloats(float[] data, int offset, int len) throws IOException; + + /** + * Writes a <code>int</code> into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void writeInt(int data) throws IOException; + + /** + * Writes an array of <code>int</code> into the stream. + * + * @param data the data to be written + * @param offset the offset in the array + * @param len the lenth in the array + * + * @throws IOException if an errror occurs + */ + void writeInts(int[] data, int offset, int len) throws IOException; + + /** + * Writes a <code>long</code> into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void writeLong(long data) throws IOException; + + /** + * Writes an array of <code>long</code> into the stream. + * + * @param data the data to be written + * @param offset the offset in the array + * @param len the lenth in the array + * + * @throws IOException if an errror occurs + */ + void writeLongs(long[] data, int offset, int len) throws IOException; + + /** + * Writes a <code>short</code> into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void writeShort(int data) throws IOException; + + /** + * Writes an array of <code>short</code> into the stream. + * + * @param data the data to be written + * @param offset the offset in the array + * @param len the lenth in the array + * + * @throws IOException if an errror occurs + */ + void writeShorts(short[] data, int offset, int len) throws IOException; + + /** + * Writes a <code>String</code> into the stream. + * + * @param data the data to be written + * + * @throws IOException if an errror occurs + */ + void writeUTF(String data) throws IOException; } diff --git a/libjava/javax/imageio/stream/ImageOutputStreamImpl.java b/libjava/javax/imageio/stream/ImageOutputStreamImpl.java new file mode 100644 index 0000000..d600943 --- /dev/null +++ b/libjava/javax/imageio/stream/ImageOutputStreamImpl.java @@ -0,0 +1,65 @@ +/* ImageOutputStream.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.stream; + +import java.io.IOException; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public abstract class ImageOutputStreamImpl extends ImageInputStreamImpl + implements ImageOutputStream +{ + public ImageOutputStreamImpl() + { + // Do nothing here. + } + + public void write(byte[] data) + throws IOException + { + write(data, 0, data.length); + } + + public abstract void write(byte[] data, int offset, int len) + throws IOException; + + public abstract void write(int value) + throws IOException; +} diff --git a/libjava/javax/imageio/stream/MemoryCacheImageInputStream.java b/libjava/javax/imageio/stream/MemoryCacheImageInputStream.java new file mode 100644 index 0000000..c7ca6d6 --- /dev/null +++ b/libjava/javax/imageio/stream/MemoryCacheImageInputStream.java @@ -0,0 +1,60 @@ +/* MemoryCacheImageInputStream.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.stream; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public class MemoryCacheImageInputStream +{ + public boolean isCached() + { + return true; + } + + public boolean isCachedFile() + { + return false; + } + + public boolean isCachedMemory() + { + return true; + } +} diff --git a/libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java b/libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java new file mode 100644 index 0000000..b91fd66 --- /dev/null +++ b/libjava/javax/imageio/stream/MemoryCacheImageOutputStream.java @@ -0,0 +1,60 @@ +/* MemoryCacheImageOutputStream.java -- + Copyright (C) 2004 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath 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 for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + + +package javax.imageio.stream; + +/** + * @author Michael Koch (konqueror@gmx.de) + */ +public class MemoryCacheImageOutputStream +{ + public boolean isCached() + { + return true; + } + + public boolean isCachedFile() + { + return false; + } + + public boolean isCachedMemory() + { + return true; + } +} |