< prev index next >

src/java.desktop/share/classes/com/sun/imageio/plugins/gif/GIFImageWriter.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2005, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 265,274 **** --- 265,275 ---- if (DEBUG) { System.err.println("GIF Writer is created"); } } + @Override public boolean canWriteSequence() { return true; } /**
*** 315,324 **** --- 316,326 ---- /** * Creates a default stream metadata object and merges in the * supplied metadata. */ + @Override public IIOMetadata convertStreamMetadata(IIOMetadata inData, ImageWriteParam param) { if (inData == null) { throw new IllegalArgumentException("inData == null!"); }
*** 332,341 **** --- 334,344 ---- /** * Creates a default image metadata object and merges in the * supplied metadata. */ + @Override public IIOMetadata convertImageMetadata(IIOMetadata inData, ImageTypeSpecifier imageType, ImageWriteParam param) { if (inData == null) { throw new IllegalArgumentException("inData == null!");
*** 362,371 **** --- 365,375 ---- } return im; } + @Override public void endWriteSequence() throws IOException { if (stream == null) { throw new IllegalStateException("output == null!"); } if (!isWritingSequence) {
*** 373,382 **** --- 377,387 ---- } writeTrailer(); resetLocal(); } + @Override public IIOMetadata getDefaultImageMetadata(ImageTypeSpecifier imageType, ImageWriteParam param) { GIFWritableImageMetadata imageMetadata = new GIFWritableImageMetadata();
*** 420,440 **** --- 425,448 ---- } return imageMetadata; } + @Override public IIOMetadata getDefaultStreamMetadata(ImageWriteParam param) { GIFWritableStreamMetadata streamMetadata = new GIFWritableStreamMetadata(); streamMetadata.version = "89a"; return streamMetadata; } + @Override public ImageWriteParam getDefaultWriteParam() { return new GIFImageWriteParam(getLocale()); } + @Override public void prepareWriteSequence(IIOMetadata streamMetadata) throws IOException { if (stream == null) { throw new IllegalStateException("Output is not set.");
*** 453,462 **** --- 461,471 ---- } this.isWritingSequence = true; } + @Override public void reset() { super.reset(); resetLocal(); }
*** 468,477 **** --- 477,487 ---- this.wroteSequenceHeader = false; this.theStreamMetadata = null; this.imageIndex = 0; } + @Override public void setOutput(Object output) { super.setOutput(output); if (output != null) { if (!(output instanceof ImageOutputStream)) { throw new
*** 482,491 **** --- 492,502 ---- } else { this.stream = null; } } + @Override public void write(IIOMetadata sm, IIOImage iioimage, ImageWriteParam p) throws IOException { if (stream == null) { throw new IllegalStateException("output == null!");
*** 509,518 **** --- 520,530 ---- } write(true, true, streamMetadata, iioimage, p); } + @Override public void writeToSequence(IIOImage image, ImageWriteParam param) throws IOException { if (stream == null) { throw new IllegalStateException("output == null!"); }
*** 1317,1326 **** --- 1329,1339 ---- this.canWriteProgressive = true; this.compressionTypes = new String[] {"LZW"}; this.compressionType = compressionTypes[0]; } + @Override public void setCompressionMode(int mode) { if (mode == MODE_DISABLED) { throw new UnsupportedOperationException("MODE_DISABLED is not supported."); } super.setCompressionMode(mode);
< prev index next >