API clean-up.

This commit is contained in:
Harald Kuhr
2018-03-06 23:22:45 +01:00
parent 15e39bce3f
commit ee299ee577
6 changed files with 35 additions and 33 deletions

View File

@@ -1239,16 +1239,19 @@ public final class JPEGImageReader extends ImageReaderBase {
}
private class ThumbnailProgressDelegate implements ThumbnailReadProgressListener {
public void processThumbnailStarted(int imageIndex, int thumbnailIndex) {
JPEGImageReader.this.processThumbnailStarted(imageIndex, thumbnailIndex);
@Override
public void thumbnailStarted(int imageIndex, int thumbnailIndex) {
processThumbnailStarted(imageIndex, thumbnailIndex);
}
public void processThumbnailProgress(float percentageDone) {
JPEGImageReader.this.processThumbnailProgress(percentageDone);
@Override
public void thumbnailProgress(float percentageDone) {
processThumbnailProgress(percentageDone);
}
public void processThumbnailComplete() {
JPEGImageReader.this.processThumbnailComplete();
@Override
public void thumbnailComplete() {
processThumbnailComplete();
}
}

View File

@@ -36,9 +36,9 @@ package com.twelvemonkeys.imageio.plugins.jpeg;
* @version $Id: ThumbnailReadProgressListener.java,v 1.0 07.05.12 10:15 haraldk Exp$
*/
interface ThumbnailReadProgressListener {
void processThumbnailStarted(int imageIndex, int thumbnailIndex);
void thumbnailStarted(int imageIndex, int thumbnailIndex);
void processThumbnailProgress(float percentageDone);
void thumbnailProgress(float percentageDone);
void processThumbnailComplete();
void thumbnailComplete();
}

View File

@@ -55,15 +55,15 @@ abstract class ThumbnailReader {
}
protected final void processThumbnailStarted() {
progressListener.processThumbnailStarted(imageIndex, thumbnailIndex);
progressListener.thumbnailStarted(imageIndex, thumbnailIndex);
}
protected final void processThumbnailProgress(float percentageDone) {
progressListener.processThumbnailProgress(percentageDone);
progressListener.thumbnailProgress(percentageDone);
}
protected final void processThumbnailComplete() {
progressListener.processThumbnailComplete();
progressListener.thumbnailComplete();
}
static protected BufferedImage readJPEGThumbnail(final ImageReader reader, final ImageInputStream stream) throws IOException {
@@ -96,13 +96,16 @@ abstract class ThumbnailReader {
public abstract int getHeight() throws IOException;
private static class NullProgressListener implements ThumbnailReadProgressListener {
public void processThumbnailStarted(int imageIndex, int thumbnailIndex) {
@Override
public void thumbnailStarted(int imageIndex, int thumbnailIndex) {
}
public void processThumbnailProgress(float percentageDone) {
@Override
public void thumbnailProgress(float percentageDone) {
}
public void processThumbnailComplete() {
@Override
public void thumbnailComplete() {
}
}
}