svn commit: r13191 - branches/gsoc2007/maurelio1234/src_new: ext org/argouml/kernel org/argouml/uml/diagram/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: maurelio1234
Date: 2007-07-31 04:24:14-0700
New Revision: 13191

Modified:
   branches/gsoc2007/maurelio1234/src_new/ext/javabeans.jar
   branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectImpl.java
   branches/gsoc2007/maurelio1234/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java

Log:
solving #13

Modified: branches/gsoc2007/maurelio1234/src_new/ext/javabeans.jar
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/ext/javabeans.jar?view=diff&rev=13191&p1=branches/gsoc2007/maurelio1234/src_new/ext/javabeans.jar&p2=branches/gsoc2007/maurelio1234/src_new/ext/javabeans.jar&r1=13190&r2=13191
==============================================================================
Binary files. No diff available.

Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectImpl.java?view=diff&rev=13191&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectImpl.java&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectImpl.java&r1=13190&r2=13191
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectImpl.java	(original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectImpl.java	2007-07-31 04:24:14-0700
@@ -59,6 +59,7 @@
 import org.argouml.uml.generator.GenerationPreferences;
 import org.argouml.uml.profile.Profile;
 import org.argouml.uml.profile.ProfileConfiguration;
+import org.argouml.uml.profile.ProfileJava;
 import org.argouml.uml.profile.ProfileManagerImpl;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.undo.Memento;
@@ -185,6 +186,8 @@
 
         LOG.info("making empty project with empty model");
         addSearchPath("PROJECT_DIR");
+        
+//        models.add(ProfileJava.getInstance().getModel());
     }
 
 

Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=13191&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=13190&r2=13191
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java	(original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java	2007-07-31 04:24:14-0700
@@ -1580,27 +1580,30 @@
 		}
 	    }
 	} else if (practicalView == STEREOTYPE_VIEW_SMALL_ICON) {
-	    int i = this.getX() + this.getWidth() - ICON_WIDTH - 2;
-	    
-	    Iterator it = stereos.iterator();
-	    while (it.hasNext()) {
-		Object stereo = it.next();
-		Image icon = ProjectManager.getManager().getCurrentProject()
-			.getProfileConfiguration().getFigNodeStrategy()
-			.getIconForStereotype(stereo);
-		if (icon != null) {
-		    FigImage fimg = new FigImage(i, this.getBigPort().getY()+2, icon);
-		    fimg.setSize(ICON_WIDTH,
-			    (icon.getHeight(null) * ICON_WIDTH)
-				    / icon.getWidth(null));
-		    
-		    addFig(fimg);
-		    floatingStereotypes.add(fimg);
-		    
-		    i -= ICON_WIDTH - 2;
-		}
-	    }	    
-	}
+            int i = this.getX() + this.getWidth() - ICON_WIDTH - 2;
+
+            Iterator it = stereos.iterator();
+            while (it.hasNext()) {
+                Object stereo = it.next();
+                Image icon = ProjectManager.getManager().getCurrentProject()
+                        .getProfileConfiguration().getFigNodeStrategy()
+                        .getIconForStereotype(stereo);
+                if (icon != null) {
+                    FigImage fimg = new FigImage(i,
+                            this.getBigPort().getY() + 2, icon);
+                    fimg.setSize(ICON_WIDTH,
+                            (icon.getHeight(null) * ICON_WIDTH)
+                                    / icon.getWidth(null));
+
+                    addFig(fimg);
+                    floatingStereotypes.add(fimg);
+
+                    i -= ICON_WIDTH - 2;
+                }
+            }
+
+            updateSmallIcons(this.getWidth());
+        }
 
 	updateStereotypeText();
 	
@@ -2057,36 +2060,33 @@
 	} else {
 	    setStandardBounds(x, y, w, h);
 	    if (getStereotypeView() == STEREOTYPE_VIEW_SMALL_ICON) {
-		int i = w + x - ICON_WIDTH - 2;
-
-		Iterator it = this.floatingStereotypes.iterator();
-		while (it.hasNext()) {
-		    Object ficon = it.next();
-		    ((FigImage) ficon).setLocation(i,
-			    y + 2);
-		    i -= ICON_WIDTH - 2;
-		}
+	        updateSmallIcons(w);
 	    }
 	}
     }
-    
+
+    private void updateSmallIcons(int wid) {
+        int i = this.getX() + wid - ICON_WIDTH - 2;
+
+        Iterator it = floatingStereotypes.iterator();
+        while (it.hasNext()) {
+            FigImage ficon = (FigImage) it.next();
+            ficon.setLocation(i, this.getBigPort().getY() + 2);
+            i -= ICON_WIDTH - 2;
+        }
+
+        getNameFig().setRightMargin(
+                floatingStereotypes.size() * (ICON_WIDTH + 5));
+    }
+
     /**
      * Replaces {@link #setBoundsImpl(int, int, int, int)}.
      * 
-     * @param x
-     *                Desired X coordinate of upper left corner
-     * 
-     * @param y
-     *                Desired Y coordinate of upper left corner
-     * 
-     * @param w
-     *                Desired width of the FigClass
-     * 
-     * @param h
-     *                Desired height of the FigClass
-     * 
-     * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int,
-     *      int)
+     * @param x Desired X coordinate of upper left corner
+     * @param y Desired Y coordinate of upper left corner
+     * @param w Desired width of the FigClass
+     * @param h Desired height of the FigClass
+     * @see org.tigris.gef.presentation.Fig#setBoundsImpl(int, int, int, int)
      */
     protected void setStandardBounds(final int x, final int y,
             final int w, final int h) {
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.