svn commit: r12769 - branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: maurelio1234
Date: 2007-06-07 05:15:57-0700
New Revision: 12769

Modified:
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeans.xmi
   branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeansFigNodeStrategy.java

Log:
figures work only for classes

Modified: branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeans.xmi
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeans.xmi?view=diff&rev=12769&p1=branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeans.xmi&p2=branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeans.xmi&r1=12768&r2=12769
==============================================================================
--- branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeans.xmi	(original)
+++ branches/gsoc2007/maurelio1234/examples/javabeans/src/org/argouml/uml/profile/javabeans/JavaBeans.xmi	2007-06-07 05:15:57-0700
@@ -1,8 +1,8 @@
 <?xml version = '1.0' encoding = 'UTF-8' ?>

-<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Thu May 10 11:40:18 BRT 2007'>

+<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp = 'Thu Jun 07 08:15:31 BRT 2007'>

   <XMI.header>    <XMI.documentation>
       <XMI.exporter>ArgoUML (using Netbeans XMI Writer version 1.0)</XMI.exporter>
-      <XMI.exporterVersion>PRE-0.25.3(5) revised on $Date: 2006-11-06 16:55:22 -0200 (seg, 06 nov 2006) $ </XMI.exporterVersion>
+      <XMI.exporterVersion>PRE-0.25.4(5) revised on $Date: 2007-05-12 03:08:08 -0300 $ </XMI.exporterVersion>
     </XMI.documentation>
     <XMI.metamodel xmi.name="UML" xmi.version="1.4"/></XMI.header>

   <XMI.content>

@@ -20,6 +20,11 @@
           isAbstract = 'false'>

           <UML:Stereotype.baseClass>Attribute</UML:Stereotype.baseClass>

         </UML:Stereotype>

+        <UML:Stereotype xmi.id = '10-1-1-3--1493a662:11305da89f4:-8000:00000000000008B1'

+          name = 'Event' isSpecification = 'false' isRoot = 'false' isLeaf = 'false'

+          isAbstract = 'false'>

+          <UML:Stereotype.baseClass>Class</UML:Stereotype.baseClass>

+        </UML:Stereotype>

       </UML:Namespace.ownedElement>

     </UML:Model>

   </XMI.content>


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=12769&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=12768&r2=12769
==============================================================================
--- 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-06-07 05:15:57-0700
@@ -10,23 +10,32 @@
 

 public class JavaBeansFigNodeStrategy implements FigNodeStrategy {

 

-    private Image icon = null;

+    private Image iconBean = null;

+    private Image iconRay  = null;

     

     public JavaBeansFigNodeStrategy() {

+	iconBean = readImage("bean.GIF");

+	iconRay  = readImage("raio.gif");

+    }

+

+    private final byte[] buf = new byte[10000];

+    

+    private Image readImage(String fileName) {

 	BufferedInputStream bis = new BufferedInputStream(this.getClass()

-		.getResourceAsStream("bean.GIF"));

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

+		.getResourceAsStream(fileName));

 	try {

 	    bis.read(buf);

 	} catch (IOException e) {

 	    e.printStackTrace();

 	}

-	icon = Toolkit.getDefaultToolkit().createImage(buf);

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

     }

     

     public Image getIconForStereotype(Object stereotype) {

 	if ("Bean".equals(Model.getFacade().getName(stereotype))) {

-	    return icon;

+	    return iconBean;

+	} else 	if ("Event".equals(Model.getFacade().getName(stereotype))) {

+	    return iconRay;

 	} else {

 	    return null;

 	}
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.