diff options
Diffstat (limited to 'libjava/classpath/gnu/java/awt/image')
4 files changed, 83 insertions, 83 deletions
diff --git a/libjava/classpath/gnu/java/awt/image/AsyncImage.java b/libjava/classpath/gnu/java/awt/image/AsyncImage.java index 935601a8898..4fa33740e19 100644 --- a/libjava/classpath/gnu/java/awt/image/AsyncImage.java +++ b/libjava/classpath/gnu/java/awt/image/AsyncImage.java @@ -159,9 +159,9 @@ public class AsyncImage g = r.getGraphics(); // Should we return some dummy graphics instead? return g; } - + public boolean isComplete() { - return complete; + return complete; } public int getHeight(ImageObserver observer) diff --git a/libjava/classpath/gnu/java/awt/image/ImageConverter.java b/libjava/classpath/gnu/java/awt/image/ImageConverter.java index f607b349630..f9c6268c3d2 100644 --- a/libjava/classpath/gnu/java/awt/image/ImageConverter.java +++ b/libjava/classpath/gnu/java/awt/image/ImageConverter.java @@ -55,7 +55,7 @@ import java.util.Hashtable; /** * Convert an Image to a BufferedImage. - * + * * @author Roman Kennke (kennke@aicas.com) */ public class ImageConverter implements ImageConsumer @@ -121,7 +121,7 @@ public class ImageConverter implements ImageConsumer scansize, transparency); } else if (model instanceof IndexColorModel - && targetColorModel.equals(ColorModel.getRGBdefault())) + && targetColorModel.equals(ColorModel.getRGBdefault())) { transparency = convertIndexColorModelToSRGB(x, y, w, h, (IndexColorModel) model, @@ -246,7 +246,7 @@ public class ImageConverter implements ImageConsumer * @param offset the offset in the pixel array * @param scansize the scanline size * @param transparency the assumed transparency - * + * * @return the determined transparency */ private int transferPixels(int x, int y, int w, int h, ColorModel model, @@ -281,7 +281,7 @@ public class ImageConverter implements ImageConsumer * @param offset the offset in the pixel array * @param scansize the scanline size * @param transparency the assumed transparency - * + * * @return the determined transparency */ private int transferPixels(int x, int y, int w, int h, ColorModel model, @@ -317,7 +317,7 @@ public class ImageConverter implements ImageConsumer * @param offset the offset in the pixel array * @param scansize the scanline size * @param transparency the assumed transparency - * + * * @return the determined transparency */ private int convertPixels(int x, int y, int w, int h, ColorModel model, @@ -356,7 +356,7 @@ public class ImageConverter implements ImageConsumer * @param offset the offset in the pixel array * @param scansize the scanline size * @param transparency the assumed transparency - * + * * @return the determined transparency */ private int convertPixels(int x, int y, int w, int h, ColorModel model, @@ -394,7 +394,7 @@ public class ImageConverter implements ImageConsumer * @param offset the offset in the pixel array * @param scansize the scanline size * @param transparency the assumed transparency - * + * * @return the determined transparency */ private int convertIndexColorModelToSRGB(int x, int y, int w, int h, @@ -447,7 +447,7 @@ public class ImageConverter implements ImageConsumer * @param offset the offset in the pixel array * @param scansize the scanline size * @param transparency the assumed transparency - * + * * @return the determined transparency */ private int convertIndexColorModelToSRGB(int x, int y, int w, int h, diff --git a/libjava/classpath/gnu/java/awt/image/ImageDecoder.java b/libjava/classpath/gnu/java/awt/image/ImageDecoder.java index 8e8eecb2599..a572ea33b97 100644 --- a/libjava/classpath/gnu/java/awt/image/ImageDecoder.java +++ b/libjava/classpath/gnu/java/awt/image/ImageDecoder.java @@ -48,7 +48,7 @@ import java.io.InputStream; import java.net.URL; import java.util.Vector; -public abstract class ImageDecoder implements ImageProducer +public abstract class ImageDecoder implements ImageProducer { Vector consumers = new Vector (); String filename; @@ -94,7 +94,7 @@ public abstract class ImageDecoder implements ImageProducer length = imagelength; } - public void addConsumer (ImageConsumer ic) + public void addConsumer (ImageConsumer ic) { consumers.addElement (ic); } @@ -103,7 +103,7 @@ public abstract class ImageDecoder implements ImageProducer { return consumers.contains (ic); } - + public void removeConsumer (ImageConsumer ic) { consumers.removeElement (ic); @@ -115,20 +115,20 @@ public abstract class ImageDecoder implements ImageProducer addConsumer(ic); Vector list = (Vector) consumers.clone (); - try + try { - // Create the input stream here rather than in the - // ImageDecoder constructors so that exceptions cause - // imageComplete to be called with an appropriate error - // status. + // Create the input stream here rather than in the + // ImageDecoder constructors so that exceptions cause + // imageComplete to be called with an appropriate error + // status. if (input == null) { - try + try { if (url != null) input = url.openStream(); - else if (datainput != null) - input = new DataInputStreamWrapper(datainput); + else if (datainput != null) + input = new DataInputStreamWrapper(datainput); else { if (filename != null) @@ -137,8 +137,8 @@ public abstract class ImageDecoder implements ImageProducer input = new ByteArrayInputStream (data, offset, length); } produce (list, input); - } - finally + } + finally { input = null; } @@ -150,16 +150,16 @@ public abstract class ImageDecoder implements ImageProducer } catch (Exception e) { - for (int i = 0; i < list.size (); i++) - { - ImageConsumer ic2 = (ImageConsumer) list.elementAt (i); - ic2.imageComplete (ImageConsumer.IMAGEERROR); - } + for (int i = 0; i < list.size (); i++) + { + ImageConsumer ic2 = (ImageConsumer) list.elementAt (i); + ic2.imageComplete (ImageConsumer.IMAGEERROR); + } } } - public void requestTopDownLeftRightResend (ImageConsumer ic) - { + public void requestTopDownLeftRightResend (ImageConsumer ic) + { } public abstract void produce (Vector v, InputStream is) throws IOException; @@ -176,13 +176,13 @@ public abstract class ImageDecoder implements ImageProducer public int read() throws IOException { try - { - return datainput.readByte() & 0xFF; - } + { + return datainput.readByte() & 0xFF; + } catch (EOFException eofe) - { - return -1; - } + { + return -1; + } } } } diff --git a/libjava/classpath/gnu/java/awt/image/XBMDecoder.java b/libjava/classpath/gnu/java/awt/image/XBMDecoder.java index 0793d8ee749..35a3568b844 100644 --- a/libjava/classpath/gnu/java/awt/image/XBMDecoder.java +++ b/libjava/classpath/gnu/java/awt/image/XBMDecoder.java @@ -55,8 +55,8 @@ public class XBMDecoder extends ImageDecoder static final ColorModel cm = ColorModel.getRGBdefault (); static final int black = 0xff000000; static final int transparent = 0x00000000; - static final int masktable[] = { 0x01, 0x02, 0x04, 0x08, - 0x10, 0x20, 0x40, 0x80 }; + static final int masktable[] = { 0x01, 0x02, 0x04, 0x08, + 0x10, 0x20, 0x40, 0x80 }; public XBMDecoder (String filename) { @@ -75,27 +75,27 @@ public class XBMDecoder extends ImageDecoder for (int i = 0; i < 2; i++) { - String line = reader.readLine (); - StringTokenizer st = new StringTokenizer (line); - - st.nextToken (); // #define - st.nextToken (); // name_[width|height] - if (i == 0) - width = Integer.parseInt (st.nextToken (), 10); - else - height = Integer.parseInt (st.nextToken (), 10); + String line = reader.readLine (); + StringTokenizer st = new StringTokenizer (line); + + st.nextToken (); // #define + st.nextToken (); // name_[width|height] + if (i == 0) + width = Integer.parseInt (st.nextToken (), 10); + else + height = Integer.parseInt (st.nextToken (), 10); } for (int i = 0; i < v.size (); i++) { - ImageConsumer ic = (ImageConsumer) v.elementAt (i); - - ic.setDimensions (width, height); - ic.setColorModel (cm); - ic.setHints (ImageConsumer.COMPLETESCANLINES - | ImageConsumer.SINGLEFRAME - | ImageConsumer.SINGLEPASS - | ImageConsumer.TOPDOWNLEFTRIGHT); + ImageConsumer ic = (ImageConsumer) v.elementAt (i); + + ic.setDimensions (width, height); + ic.setColorModel (cm); + ic.setHints (ImageConsumer.COMPLETESCANLINES + | ImageConsumer.SINGLEFRAME + | ImageConsumer.SINGLEPASS + | ImageConsumer.TOPDOWNLEFTRIGHT); } /* skip to the byte array */ @@ -104,22 +104,22 @@ public class XBMDecoder extends ImageDecoder /* loop through each scanline */ for (int line = 0; line < height; line++) { - int scanline[] = getScanline (reader, width); + int scanline[] = getScanline (reader, width); - for (int i = 0; i < v.size (); i++) - { - ImageConsumer ic = (ImageConsumer) v.elementAt (i); - ic.setPixels (0, 0 + line, width, 1, cm, scanline, 0, width); - } + for (int i = 0; i < v.size (); i++) + { + ImageConsumer ic = (ImageConsumer) v.elementAt (i); + ic.setPixels (0, 0 + line, width, 1, cm, scanline, 0, width); + } } /* tell each ImageConsumer that we're finished */ for (int i = 0; i < v.size (); i++) { - ImageConsumer ic = (ImageConsumer) v.elementAt (i); - ic.imageComplete (ImageConsumer.STATICIMAGEDONE); + ImageConsumer ic = (ImageConsumer) v.elementAt (i); + ic.imageComplete (ImageConsumer.STATICIMAGEDONE); } - } + } public static int[] getScanline (Reader in, int len) throws IOException { @@ -129,25 +129,25 @@ public class XBMDecoder extends ImageDecoder while (x < len) { - int ch = in.read (); - if (ch == '0') - { - in.read (); // 'x' - - byteStr[0] = (char) in.read (); - byteStr[1] = (char) in.read (); - - int byteVal = Integer.parseInt (new String (byteStr), 16); - - for (int i = 0; i < 8; i++, x++) - { - if (x == len) // condition occurs if bitmap is padded - return scanline; - - scanline[x] = ((byteVal & masktable[i]) != 0) ? - black : transparent; - } - } + int ch = in.read (); + if (ch == '0') + { + in.read (); // 'x' + + byteStr[0] = (char) in.read (); + byteStr[1] = (char) in.read (); + + int byteVal = Integer.parseInt (new String (byteStr), 16); + + for (int i = 0; i < 8; i++, x++) + { + if (x == len) // condition occurs if bitmap is padded + return scanline; + + scanline[x] = ((byteVal & masktable[i]) != 0) ? + black : transparent; + } + } } return scanline; |