svn commit: r13135 - branches/gsoc2007/maurelio1234/examples/javabeans/src: . .settings META-INF org org/argouml org/argouml/i18n org/argouml/uml org/argouml/uml/profile org/argouml/uml/profile/cognitive org/argouml/uml/profile/cognitive/critics org/argouml/uml/profile/javabeans

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: maurelio1234
Date: 2007-07-24 11:38:51-0700
New Revision: 13135

Added:
   branches/gsoc2007/maurelio1234/examples/javabeans/src/
      - copied from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/
   branches/gsoc2007/maurelio1234/examples/javabeans/src/.settings/
      - copied from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/.settings/
   branches/gsoc2007/maurelio1234/examples/javabeans/src/.settings/org.eclipse.jdt.ui.prefs
      - copied unchanged from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/.settings/org.eclipse.jdt.ui.prefs
   branches/gsoc2007/maurelio1234/examples/javabeans/src/META-INF/
      - copied from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/META-INF/
   branches/gsoc2007/maurelio1234/examples/javabeans/src/META-INF/MANIFEST.MF
      - copied unchanged from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/META-INF/MANIFEST.MF
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/
      - copied from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/
      - copied from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/i18n/
      - copied from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/i18n/
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/i18n/beansprofile.properties
      - copied unchanged from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/i18n/beansprofile.properties
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/
      - copied from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/
      - copied from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/cognitive/
      - copied from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/cognitive/
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/cognitive/critics/
      - copied from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/cognitive/critics/
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/cognitive/critics/CrJavaBeanPropertyApplication.java
      - copied unchanged from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/cognitive/critics/CrJavaBeanPropertyApplication.java
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/
      - copied from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeans.xmi
      - copied unchanged from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeans.xmi
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeansProfileModule.java
      - copied unchanged from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeansProfileModule.java
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/ProfileJavaBeans.java
      - copied unchanged from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/ProfileJavaBeans.java
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/bean.GIF
      - copied unchanged from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/bean.GIF
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/event.gif
      - copied unchanged from r13016, /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/event.gif
Modified:
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeansFigNodeStrategy.java

Log:
solving big icon rendering problem

Modified: branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeansFigNodeStrategy.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeansFigNodeStrategy.java?view=diff&rev=13135&p1=/branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeansFigNodeStrategy.java&p2=branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeansFigNodeStrategy.java&r1=13016&r2=13135
==============================================================================
--- /branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeansFigNodeStrategy.java	(original)
+++ branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeansFigNodeStrategy.java	2007-07-24 11:38:51-0700
@@ -1,10 +1,12 @@
 package org.argouml.uml.profile.javabeans;

 

 import java.awt.Image;

-import java.awt.Toolkit;

 import java.io.BufferedInputStream;

 import java.io.IOException;

 

+import javax.swing.ImageIcon;

+

+import org.apache.log4j.Logger;

 import org.argouml.model.Model;

 import org.argouml.uml.profile.FigNodeStrategy;

 

@@ -15,22 +17,28 @@
  *

  */

 public class JavaBeansFigNodeStrategy implements FigNodeStrategy {

+    /**

+     * Logger.

+     */

+    private static final Logger LOG = Logger.getLogger(JavaBeansFigNodeStrategy.class);

 

     private static  final Image iconBean = readImage("bean.GIF", 2904);

     private static final Image iconRay  = readImage("event.gif", 243);

-       

+

+

     private static Image readImage(String fileName, int fileSize) {

-	BufferedInputStream bis = new BufferedInputStream(JavaBeansFigNodeStrategy.class

-		.getResourceAsStream(fileName));

-	

-	byte[] buf = new byte[fileSize];

-	try {

-	    bis.read(buf);

-	} catch (IOException e) {

-	    e.printStackTrace();

+		BufferedInputStream bis = new BufferedInputStream(

+				JavaBeansFigNodeStrategy.class.getResourceAsStream(fileName));

+

+		byte[] buf = new byte[fileSize];

+		try {

+			bis.read(buf);

+		} catch (IOException e) {

+			e.printStackTrace();

+		}

+		LOG.info("IMAGE READ: " + fileName);

+		return new ImageIcon(buf).getImage();//Toolkit.getDefaultToolkit().createImage(buf);

 	}

-	return Toolkit.getDefaultToolkit().createImage(buf);

-    }

     

     /**

      * @see org.argouml.uml.profile.FigNodeStrategy#getIconForStereotype(java.lang.Object)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.