summaryrefslogtreecommitdiffstats
path: root/libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
diff options
context:
space:
mode:
authordoko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-03 23:18:43 +0000
committerdoko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-03 23:18:43 +0000
commit5bf762459121cc397663d22498d62d71fa179ef6 (patch)
treea9c9e7d91c484d53fe154f9285fc57325572ce50 /libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
parent6d7301dc346a198a89ac987c1008aac09f191ee6 (diff)
downloadppe42-gcc-5bf762459121cc397663d22498d62d71fa179ef6.tar.gz
ppe42-gcc-5bf762459121cc397663d22498d62d71fa179ef6.zip
libjava/classpath/ChangeLog.gcj:
2007-05-31 Matthias Klose <doko@ubuntu.com> * javax/management/NotificationBroadcasterSupport.java (getNotificationInfo): Add cast. * native/jni/qt-peer/Makefile.am (AM_CXXFLAGS): Add libstdc++ include directories. * native/jni/qt-peer/Makefile.in: Regenerate. libjava/ChangeLog: 2007-06-03 Matthias Klose <doko@ubuntu.com> * java/io/natFileWin32.cc (setFilePermissions): New (stub only). _access: Handle EXEC query, stub only. 2007-06-03 Matthias Klose <doko@ubuntu.com> Merged from classpath: * gnu/java/nio/SelectorProviderImpl.java: Whitespace merge. * java/lang/System.java(inheritedChannel): New. * java/lang/Character.java: Remove stray`;'. * java/net/MulticastSocket.java: Merged. * java/text/DateFormatSymbols.java(getInstance): New, comment updates. * java/text/Collator.java(getInstance): Merged. * java/util/Calendar.java: New attributes ALL_STYLES, SHORT, LONG. getDisplayName, getDisplayNames: New. * java/util/logging/Logger.java: Merged. * Regenerate .class and .h files. 2007-06-03 Matthias Klose <doko@ubuntu.com> * java/io/File.java: Merge with classpath-0.95, new method setFilePermissions, new attribute EXEC. * java/io/natFilePosix.cc (setFilePermissions): New. _access: Handle EXEC query. * classpath/lib/java/io/File.class, java/io/File.h: Regenerate. 2007-06-03 Matthias Klose <doko@ubuntu.com> Imported GNU Classpath 0.95. * classpath/Makefile.in, classpath/native/jni/midi-dssi/Makefile.in, classpath/native/jni/classpath/Makefile.in, classpath/native/jni/Makefile.in, classpath/native/jni/gconf-peer/Makefile.in, classpath/native/jni/java-io/Makefile.in, classpath/native/jni/native-lib/Makefile.in, classpath/native/jni/java-util/Makefile.in, classpath/native/jni/midi-alsa/Makefile.in, classpath/native/jni/java-lang/Makefile.in, classpath/native/jni/java-nio/Makefile.in, classpath/native/jni/java-net/Makefile.in, classpath/native/jni/xmlj/Makefile.in, classpath/native/jni/qt-peer/Makefile.in, classpath/native/jni/gtk-peer/Makefile.in, classpath/native/Makefile.in, classpath/native/jawt/Makefile.in, classpath/native/fdlibm/Makefile.in, classpath/native/plugin/Makefile.in, classpath/resource/Makefile.in, classpath/scripts/Makefile.in, classpath/tools/Makefile.in, classpath/doc/Makefile.in, classpath/doc/api/Makefile.in, classpath/lib/Makefile.in, classpath/external/Makefile.in, classpath/external/jsr166/Makefile.in, classpath/external/sax/Makefile.in, classpath/external/w3c_dom/Makefile.in, classpath/external/relaxngDatatype/Makefile.in, classpath/include/Makefile.in, classpath/examples/Makefile.in: Regenerate. * classpath/config.guess, classpath/config.sub, classpath/ltmain.sh : Update. * classpath/configure, classpath/depcomp, classpath/missing, classpath/aclocal.m4, classpath/install-sh: Regenerate. * gnu/classpath/Configuration.java (CLASSPATH_VERSION): Now 0.95. * sources.am: Regenerate. * Makefile.in: Regenerate. * Update the .class files and generated CNI header files, add new .class and generated CNI header files. * Remove generated files for removed java source files: classpath/gnu/java/net/BASE64.java, classpath/gnu/java/security/util/Base64.java, classpath/gnu/java/awt/peer/gtk/GThreadMutex.java, classpath/gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java, classpath/gnu/java/awt/font/autofit/Scaler.java, classpath/gnu/classpath/jdwp/util/Value.java, classpath/gnu/javax/net/ssl/Base64.java. * Remove empty directories. * Makefile.am(nat_source_files): Add natVMOperatingSystemMXBeanImpl.cc. * java/lang/Class.java(setAccessible): Merge from classpath. * java/util/Locale.java: Remove. * gnu/java/lang/management/VMOperatingSystemMXBeanImpl.java, gnu/java/lang/management/natVMOperatingSystemMXBeanImpl.cc: New. * gcj/javaprims.h: Update class declarations. * scripts/classes.pl: Update usage. * HACKING: Mention to build all peers. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125302 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java')
-rw-r--r--libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java137
1 files changed, 64 insertions, 73 deletions
diff --git a/libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java b/libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
index 6d0a52b91be..6f6ea560db7 100644
--- a/libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
+++ b/libjava/classpath/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
@@ -184,22 +184,22 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
int len = 0;
synchronized(pixbufLock)
{
- initState();
+ initState();
}
needsClose = true;
// Note: We don't want the pixbufLock while reading from the InputStream.
while ((len = is.read (bytes)) != -1)
{
- synchronized(pixbufLock)
- {
- pumpBytes (bytes, len);
- }
+ synchronized(pixbufLock)
+ {
+ pumpBytes (bytes, len);
+ }
}
synchronized(pixbufLock)
{
- pumpDone();
+ pumpDone();
}
needsClose = false;
@@ -217,7 +217,7 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
{
synchronized(pixbufLock)
{
- finish(needsClose);
+ finish(needsClose);
}
}
@@ -226,8 +226,8 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
{
public String name;
public boolean writable = false;
- public ArrayList mimeTypes = new ArrayList();
- public ArrayList extensions = new ArrayList();
+ public ArrayList<String> mimeTypes = new ArrayList<String>();
+ public ArrayList<String> extensions = new ArrayList<String>();
public ImageFormatSpec(String name, boolean writable)
{
@@ -246,7 +246,7 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
}
}
- static ArrayList imageFormatSpecs;
+ static ArrayList<ImageFormatSpec> imageFormatSpecs;
public static ImageFormatSpec registerFormat(String name, boolean writable)
{
@@ -254,7 +254,7 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
synchronized(GdkPixbufDecoder.class)
{
if (imageFormatSpecs == null)
- imageFormatSpecs = new ArrayList();
+ imageFormatSpecs = new ArrayList<ImageFormatSpec>();
imageFormatSpecs.add(ifs);
}
return ifs;
@@ -262,13 +262,13 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
static String[] getFormatNames(boolean writable)
{
- ArrayList names = new ArrayList();
+ ArrayList<String> names = new ArrayList<String>();
synchronized (imageFormatSpecs)
{
- Iterator i = imageFormatSpecs.iterator();
+ Iterator<ImageFormatSpec> i = imageFormatSpecs.iterator();
while (i.hasNext())
{
- ImageFormatSpec ifs = (ImageFormatSpec) i.next();
+ ImageFormatSpec ifs = i.next();
if (writable && !ifs.writable)
continue;
names.add(ifs.name);
@@ -279,62 +279,50 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
* This generally means "all the extensions people might use".
*/
- Iterator j = ifs.extensions.iterator();
+ Iterator<String> j = ifs.extensions.iterator();
while (j.hasNext())
- names.add((String) j.next());
+ names.add(j.next());
}
}
- Object[] objs = names.toArray();
- String[] strings = new String[objs.length];
- for (int i = 0; i < objs.length; ++i)
- strings[i] = (String) objs[i];
- return strings;
+ return names.toArray(new String[names.size()]);
}
static String[] getFormatExtensions(boolean writable)
{
- ArrayList extensions = new ArrayList();
+ ArrayList<String> extensions = new ArrayList<String>();
synchronized (imageFormatSpecs)
{
- Iterator i = imageFormatSpecs.iterator();
+ Iterator<ImageFormatSpec> i = imageFormatSpecs.iterator();
while (i.hasNext())
{
- ImageFormatSpec ifs = (ImageFormatSpec) i.next();
+ ImageFormatSpec ifs = i.next();
if (writable && !ifs.writable)
continue;
- Iterator j = ifs.extensions.iterator();
+ Iterator<String> j = ifs.extensions.iterator();
while (j.hasNext())
- extensions.add((String) j.next());
+ extensions.add(j.next());
}
}
- Object[] objs = extensions.toArray();
- String[] strings = new String[objs.length];
- for (int i = 0; i < objs.length; ++i)
- strings[i] = (String) objs[i];
- return strings;
+ return extensions.toArray(new String[extensions.size()]);
}
static String[] getFormatMimeTypes(boolean writable)
{
- ArrayList mimeTypes = new ArrayList();
+ ArrayList<String> mimeTypes = new ArrayList<String>();
synchronized (imageFormatSpecs)
{
- Iterator i = imageFormatSpecs.iterator();
+ Iterator<ImageFormatSpec> i = imageFormatSpecs.iterator();
while (i.hasNext())
{
- ImageFormatSpec ifs = (ImageFormatSpec) i.next();
+ ImageFormatSpec ifs = i.next();
if (writable && !ifs.writable)
continue;
- Iterator j = ifs.mimeTypes.iterator();
+ Iterator<String> j = ifs.mimeTypes.iterator();
while (j.hasNext())
- mimeTypes.add((String) j.next());
+ mimeTypes.add(j.next());
}
}
- Object[] objs = mimeTypes.toArray();
- String[] strings = new String[objs.length];
- for (int i = 0; i < objs.length; ++i)
- strings[i] = (String) objs[i];
- return strings;
+ return mimeTypes.toArray(new String[mimeTypes.size()]);
}
@@ -348,10 +336,10 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
String str = (String) ext;
- Iterator i = imageFormatSpecs.iterator();
+ Iterator<ImageFormatSpec> i = imageFormatSpecs.iterator();
while (i.hasNext())
{
- ImageFormatSpec ifs = (ImageFormatSpec) i.next();
+ ImageFormatSpec ifs = i.next();
if (needWritable && !ifs.writable)
continue;
@@ -359,10 +347,10 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
if (ifs.name.equals(str))
return str;
- Iterator j = ifs.extensions.iterator();
+ Iterator<String> j = ifs.extensions.iterator();
while (j.hasNext())
{
- String extension = (String)j.next();
+ String extension = j.next();
if (extension.equals(str))
return ifs.name;
}
@@ -370,7 +358,7 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
j = ifs.mimeTypes.iterator();
while (j.hasNext())
{
- String mimeType = (String)j.next();
+ String mimeType = j.next();
if (mimeType.equals(str))
return ifs.name;
}
@@ -510,10 +498,10 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
if (pixels == null)
{
- BufferedImage img;
- if(model != null && model.hasAlpha())
- img = CairoSurface.getBufferedImage(width, height);
- img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
+ BufferedImage img;
+ if(model != null && model.hasAlpha())
+ img = CairoSurface.getBufferedImage(width, height);
+ img = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
int[] pix = new int[4];
for (int y = 0; y < height; ++y)
for (int x = 0; x < width; ++x)
@@ -527,10 +515,10 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
workerThread.start();
processImageStarted(1);
synchronized(pixbufLock)
- {
- streamImage(pixels, this.ext, width, height, model.hasAlpha(),
- this);
- }
+ {
+ streamImage(pixels, this.ext, width, height, model.hasAlpha(),
+ this);
+ }
synchronized(data)
{
data.add(DATADONE);
@@ -539,18 +527,18 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
while (workerThread.isAlive())
{
- try
- {
- workerThread.join();
- }
- catch (InterruptedException ioe)
- {
- // Ignored.
- }
+ try
+ {
+ workerThread.join();
+ }
+ catch (InterruptedException ioe)
+ {
+ // Ignored.
+ }
}
if (exception != null)
- throw exception;
+ throw exception;
processImageComplete();
}
@@ -566,7 +554,7 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
* Needs to be synchronized for access.
* The special object DATADONE is added when all data has been delivered.
*/
- private ArrayList data = new ArrayList();
+ private ArrayList<Object> data = new ArrayList<Object>();
/**
* Holds any IOException thrown by the run method that needs
@@ -643,7 +631,8 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
this.ext = findFormatName(ext, false);
}
- public GdkPixbufReader(GdkPixbufReaderSpi ownerSpi, Object ext, GdkPixbufDecoder d)
+ public GdkPixbufReader(GdkPixbufReaderSpi ownerSpi, Object ext,
+ GdkPixbufDecoder d)
{
this(ownerSpi, ext);
dec = d;
@@ -680,10 +669,12 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
if (bufferedImage == null)
{
- if(model != null && model.hasAlpha())
- bufferedImage = new BufferedImage (width, height, BufferedImage.TYPE_INT_ARGB);
- else
- bufferedImage = new BufferedImage (width, height, BufferedImage.TYPE_INT_RGB);
+ if(model != null && model.hasAlpha())
+ bufferedImage = new BufferedImage (width, height,
+ BufferedImage.TYPE_INT_ARGB);
+ else
+ bufferedImage = new BufferedImage (width, height,
+ BufferedImage.TYPE_INT_RGB);
}
int pixels2[];
@@ -735,11 +726,11 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
return null;
}
- public Iterator getImageTypes(int imageIndex)
+ public Iterator<ImageTypeSpecifier> getImageTypes(int imageIndex)
throws IOException
{
BufferedImage img = getBufferedImage();
- Vector vec = new Vector();
+ Vector<ImageTypeSpecifier> vec = new Vector<ImageTypeSpecifier>();
vec.add(new ImageTypeSpecifier(img));
return vec.iterator();
}
@@ -767,8 +758,8 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
else if (get instanceof DataInput)
dec = new GdkPixbufDecoder((DataInput) get);
else
- throw new IllegalArgumentException("input object not supported: "
- + get);
+ throw new IllegalArgumentException("input object not supported: "
+ + get);
}
public BufferedImage read(int imageIndex, ImageReadParam param)
OpenPOWER on IntegriCloud