svn commit: r12771 - branches/gsoc2007/maurelio1234/argouml: ext org/argouml/i18n org/argouml/uml/diagram/static_structure/ui org/argouml/uml/diagram/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: maurelio1234
Date: 2007-06-07 08:21:54-0700
New Revision: 12771

Added:
   branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java
   branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java
   branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java
Modified:
   branches/gsoc2007/maurelio1234/argouml/ext/profile-javabeans.jar
   branches/gsoc2007/maurelio1234/argouml/org/argouml/i18n/menu.properties
   branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java
   branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java
   branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java
   branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigProfileIcon.java

Log:
trying to implement a popup menu to switch representation

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

Modified: branches/gsoc2007/maurelio1234/argouml/org/argouml/i18n/menu.properties
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/org/argouml/i18n/menu.properties?view=diff&rev=12771&p1=branches/gsoc2007/maurelio1234/argouml/org/argouml/i18n/menu.properties&p2=branches/gsoc2007/maurelio1234/argouml/org/argouml/i18n/menu.properties&r1=12770&r2=12771
==============================================================================
--- branches/gsoc2007/maurelio1234/argouml/org/argouml/i18n/menu.properties	(original)
+++ branches/gsoc2007/maurelio1234/argouml/org/argouml/i18n/menu.properties	2007-06-07 08:21:54-0700
@@ -267,4 +267,11 @@
 menu.popup.uses = {0} Uses {1}
 menu.popup.visibility = Visibility
 menu.popup.visibility.mnemonic = V
-
+menu.popup.stereotype-view = Stereotype Visualization
+menu.popup.stereotype-view.mnemonic = S
+menu.popup.stereotype-view.textual = Textual
+menu.popup.stereotype-view.textual.mnemonic = T
+menu.popup.stereotype-view.big-icon = Big Icon
+menu.popup.stereotype-view.big-icon.mnemonic = B
+menu.popup.stereotype-view.small-icon = Small Icons
+menu.popup.stereotype-view.small-icon.mnemonic = S
\ No newline at end of file

Modified: branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java?view=diff&rev=12771&p1=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java&p2=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java&r1=12770&r2=12771
==============================================================================
--- branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java	(original)
+++ branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java	2007-06-07 08:21:54-0700
@@ -589,7 +589,7 @@
 	    getBigPort().setBounds(x, y, w, h);	    
 	    borderFig.setBounds(x, y, w, h);
 
-	    stereotypeFigProfileIcon.setBounds(x, y, w, h);
+	    super.updateProfileBounds(x,y,w,h);
 	} else {
 	        // set bounds of big box
 	        getBigPort().setBounds(x, y, w, h);

Modified: branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java?view=diff&rev=12771&p1=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java&p2=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java&r1=12770&r2=12771
==============================================================================
--- branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java	(original)
+++ branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClassifierBox.java	2007-06-07 08:21:54-0700
@@ -321,4 +321,5 @@
     protected Object buildModifierPopUp() {
         return buildModifierPopUp(ABSTRACT | LEAF | ROOT);
     }
+
 }

Added: branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java?view=auto&rev=12771
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewBigIcon.java	2007-06-07 08:21:54-0700
@@ -0,0 +1,60 @@
+// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.diagram.ui;

+

+public class ActionStereotypeViewBigIcon extends AbstractActionRadioMenuItem {

+

+    private FigNodeModelElement node;

+    

+    public ActionStereotypeViewBigIcon(FigNodeModelElement node) {

+	super("menu.popup.stereotype-view.big-icon", false);

+

+	this.node = node;

+	updateSelection();

+    }

+    private void updateSelection() {

+	System.out.println("NODE SSVW: " + node.getStereotypeView());

+	putValue("SELECTED",

+		  Boolean.valueOf(

+			  node.getStereotypeView() == 

+			      FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON));

+    }

+

+    @Override

+    void toggleValueOfTarget(Object t) {

+	node.setStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_BIG_ICON);

+	updateSelection();

+    }

+

+    @Override

+    Object valueOfTarget(Object t) {

+	if (t instanceof FigNodeModelElement) {

+	    return ((FigNodeModelElement) t).getStereotypeView();

+	} else {

+	    return t;

+	}

+    }

+

+}


Added: branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java?view=auto&rev=12771
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewSmallIcon.java	2007-06-07 08:21:54-0700
@@ -0,0 +1,62 @@
+// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.diagram.ui;

+

+public class ActionStereotypeViewSmallIcon extends AbstractActionRadioMenuItem {

+

+    private FigNodeModelElement node;

+    

+

+    public ActionStereotypeViewSmallIcon(FigNodeModelElement node) {

+	super("menu.popup.stereotype-view.small-icon", false);

+

+	this.node = node;

+	updateSelection();

+    }

+

+    private void updateSelection() {

+	System.out.println("NODE SSVW: " + node.getStereotypeView());

+	putValue("SELECTED",

+		  Boolean.valueOf(

+			  node.getStereotypeView() == 

+			      FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON));

+    }

+

+    @Override

+    void toggleValueOfTarget(Object t) {

+	node.setStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_SMALL_ICON);

+	updateSelection();

+    }

+

+    @Override

+    Object valueOfTarget(Object t) {

+	if (t instanceof FigNodeModelElement) {

+	    return ((FigNodeModelElement) t).getStereotypeView();

+	} else {

+	    return t;

+	}

+    }

+

+}


Added: branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java?view=auto&rev=12771
==============================================================================
--- (empty file)
+++ branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/ActionStereotypeViewTextual.java	2007-06-07 08:21:54-0700
@@ -0,0 +1,61 @@
+// $Id: eclipse-argo-codetemplates.xml 11347 2006-10-26 22:37:44Z linus $

+// Copyright (c) 2007 The Regents of the University of California. All

+// Rights Reserved. Permission to use, copy, modify, and distribute this

+// software and its documentation without fee, and without a written

+// agreement is hereby granted, provided that the above copyright notice

+// and this paragraph appear in all copies. This software program and

+// documentation are copyrighted by The Regents of the University of

+// California. The software program and documentation are supplied "AS

+// IS", without any accompanying services from The Regents. The Regents

+// does not warrant that the operation of the program will be

+// uninterrupted or error-free. The end-user understands that the program

+// was developed for research purposes and is advised not to rely

+// exclusively on the program for any reason. IN NO EVENT SHALL THE

+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,

+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,

+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF

+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF

+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY

+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF

+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE

+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF

+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,

+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

+

+package org.argouml.uml.diagram.ui;

+

+public class ActionStereotypeViewTextual extends AbstractActionRadioMenuItem {

+

+    private FigNodeModelElement node;

+    

+    public ActionStereotypeViewTextual(FigNodeModelElement node) {

+	super("menu.popup.stereotype-view.textual", false);

+

+	this.node = node;

+	updateSelection();

+    }

+

+    private void updateSelection() {

+	System.out.println("NODE SSVW: " + node.getStereotypeView());

+	putValue("SELECTED",

+		  Boolean.valueOf(

+			  node.getStereotypeView() == 

+			      FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL));

+    }

+

+    @Override

+    void toggleValueOfTarget(Object t) {

+	node.setStereotypeView(FigNodeModelElement.STEREOTYPE_VIEW_TEXTUAL);

+	updateSelection();

+    }

+

+    @Override

+    Object valueOfTarget(Object t) {

+	if (t instanceof FigNodeModelElement) {

+	    return ((FigNodeModelElement) t).getStereotypeView();

+	} else {

+	    return t;

+	}

+    }

+

+}


Modified: branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=12771&p1=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=12770&r2=12771
==============================================================================
--- branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java	(original)
+++ branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java	2007-06-07 08:21:54-0700
@@ -30,6 +30,7 @@
 import java.awt.Graphics;
 import java.awt.Image;
 import java.awt.Rectangle;
+import java.awt.event.ActionEvent;
 import java.awt.event.InputEvent;
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
@@ -93,6 +94,7 @@
 import org.tigris.gef.graph.MutableGraphSupport;
 import org.tigris.gef.presentation.Fig;
 import org.tigris.gef.presentation.FigGroup;
+import org.tigris.gef.presentation.FigImage;
 import org.tigris.gef.presentation.FigNode;
 import org.tigris.gef.presentation.FigRect;
 import org.tigris.gef.presentation.FigText;
@@ -204,6 +206,21 @@
      */
     protected static final int ACTIVE = 8;
 
+    /**
+     * Used for #setStereotypeView().
+     */
+    public static final int STEREOTYPE_VIEW_TEXTUAL = 0;
+
+    /**
+     * Used for #setStereotypeView().
+     */
+    public static final int STEREOTYPE_VIEW_BIG_ICON = 1;
+
+    /**
+     * Used for #setStereotypeView().
+     */
+    public static final int STEREOTYPE_VIEW_SMALL_ICON = 2;
+    
     ////////////////////////////////////////////////////////////////
     // instance variables
 
@@ -226,6 +243,9 @@
     /**
      */
     protected FigProfileIcon stereotypeFigProfileIcon;
+    private   Vector floatingStereotypes = new Vector();
+    public int stereotypeView = STEREOTYPE_VIEW_TEXTUAL;   
+    private static final int ICON_WIDTH = 16;
     
     private FigText originalNameFig;
     
@@ -491,8 +511,9 @@
             // Add stereotypes submenu
             Action[] stereoActions =
                 StereotypeUtility.getApplyStereotypeActions(getOwner());
+
+            popUpActions.insertElementAt(new JSeparator(), 0);
             if (stereoActions != null) {
-                popUpActions.insertElementAt(new JSeparator(), 0);
                 ArgoJMenu stereotypes =
                     new ArgoJMenu("menu.popup.apply-stereotypes");
                 for (int i = 0; i < stereoActions.length; ++i) {
@@ -500,8 +521,18 @@
                 }
                 popUpActions.insertElementAt(stereotypes, 0);
             }
+            
+            // add stereotype view submenu
+            ArgoJMenu stereotypesView =
+                new ArgoJMenu("menu.popup.stereotype-view");
+            
+            stereotypesView.addRadioItem(new ActionStereotypeViewTextual(this));
+            stereotypesView.addRadioItem(new ActionStereotypeViewBigIcon(this));
+            stereotypesView.addRadioItem(new ActionStereotypeViewSmallIcon(this));
+            
+            System.out.println("BUILDING!!! STVIEW: " + getStereotypeView());
+            popUpActions.insertElementAt(stereotypesView, 0);
         }
-
         return popUpActions;
     }
 
@@ -1422,59 +1453,107 @@
 
     private void updateStereotypeIcon() {
 	if (getOwner() == null) {
-            LOG.warn("Owner of [" + this.toString() + "/" + this.getClass()
-                    + "] is null.");
-            LOG.warn("I return...");
-            return;
-        }
+	    LOG.warn("Owner of [" + this.toString() + "/" + this.getClass()
+		    + "] is null.");
+	    LOG.warn("I return...");
+	    return;
+	}
 
 	if (stereotypeFigProfileIcon != null) {
 	    this.removeFig(stereotypeFigProfileIcon);
-	}	
-	if (originalNameFig != null) {
-	    this.setNameFig(originalNameFig);        	    
+	    stereotypeFigProfileIcon = null;
 	}
 	
-        Object modelElement = getOwner();
-        Collection stereos = Model.getFacade().getStereotypes(modelElement);
+	if (originalNameFig != null) {
+	    this.setNameFig(originalNameFig);
+	    originalNameFig = null;
+	}
 
-        if (stereos != null) {
-            Image replaceIcon = null;
-            for (Object stereo : stereos) {
-		replaceIcon = ProjectManager.getManager().getCurrentProject()
-			.getProfileConfiguration().getFigNodeStrategy()
-			.getIconForStereotype(stereo);
+	if (!floatingStereotypes.isEmpty()) {
+	    for (Object icon : floatingStereotypes) {
+		this.removeFig((Fig) icon);
+	    }
+	    floatingStereotypes.clear();
+	}
+
+	Object modelElement = getOwner();
+	Collection stereos = Model.getFacade().getStereotypes(modelElement);
+	if (getStereotypeView() != STEREOTYPE_VIEW_BIG_ICON) {
+	    stereotypeFigProfileIcon = null;
+	    for (Object fig : getFigs()) {
+		((Fig) fig).setVisible(fig != stereotypeFigProfileIcon);
+	    }
+	}	
+	 
+	if (getStereotypeView() == STEREOTYPE_VIEW_BIG_ICON) {
+
+	    if (stereos != null) {
+		Image replaceIcon = null;
+
+		if (stereos.size() == 1) {
+		    Object stereo = stereos.iterator().next();
+		    replaceIcon = ProjectManager.getManager()
+			    .getCurrentProject().getProfileConfiguration()
+			    .getFigNodeStrategy().getIconForStereotype(stereo);
+		}
+		
 		if (replaceIcon != null) {
-		    break;
+		    stereotypeFigProfileIcon = new FigProfileIcon(replaceIcon,
+			    getName());
+		    stereotypeFigProfileIcon.setOwner(getOwner());
+
+		    stereotypeFigProfileIcon.setLocation(getBigPort()
+			    .getLocation());
+		    this.addFig(stereotypeFigProfileIcon);
+
+		    originalNameFig = this.getNameFig();
+		    this.setNameFig(stereotypeFigProfileIcon.getLabelFig());
+
+		    for (Object fig : getFigs()) {
+			((Fig) fig).setVisible(fig == stereotypeFigProfileIcon);
+		    }
 		}
 	    }
-            
-            if (replaceIcon != null) {        	
-        	stereotypeFigProfileIcon = new FigProfileIcon(replaceIcon, getName());
-            	stereotypeFigProfileIcon.setOwner(getOwner());
-            	
-            	stereotypeFigProfileIcon.setLocation(getBigPort().getLocation());
-        	this.addFig(stereotypeFigProfileIcon);
-
-        	originalNameFig = this.getNameFig();
-        	this.setNameFig(stereotypeFigProfileIcon.getLabelFig());
-
-        	for (Object fig : getFigs()) {
-		    ((Fig) fig).setVisible(fig==stereotypeFigProfileIcon);
-            	}		
-	    } else {
-		stereotypeFigProfileIcon = null;
-                for (Object fig : getFigs()) {
-		    ((Fig) fig).setVisible(fig!=stereotypeFigProfileIcon);
-            	}
+	} else if (getStereotypeView() == STEREOTYPE_VIEW_SMALL_ICON) {
+	    int i = this.getWidth();
+	    
+	    for (Object stereo : stereos) {
+		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;
+		}
 	    }
-    	    this.redraw();
-        }
+	}
+	    
+	this.redraw();
+    }
+    
+    public void updateProfileBounds(int x, int y, int w, int h) {
+	if (getStereotypeView() == STEREOTYPE_VIEW_BIG_ICON) {
+	    stereotypeFigProfileIcon.setBounds(x, y, w, h);
+	} else if (getStereotypeView() == STEREOTYPE_VIEW_BIG_ICON) {
+	    int i = this.getWidth();
+	    
+       	    for (Object ficon : this.floatingStereotypes) {
+        	((FigImage)ficon).setLocation(i, this.getBigPort().getY()+2);
+        	i -= ICON_WIDTH - 2;
+            }   
+	}
     }
     
     /*
-     * @see org.tigris.gef.presentation.Fig#calcBounds()
-     */
+         * @see org.tigris.gef.presentation.Fig#calcBounds()
+         */
     public void calcBounds() {
         if (suppressCalcBounds) {
             return;
@@ -1832,5 +1911,15 @@
 	return TargetManager.getInstance().getSingleModelTarget()
 		== getOwner();
     }
+
+    public int getStereotypeView() {
+        return stereotypeView;
+    }
+
+    public void setStereotypeView(int s) {
+	System.out.println("SETSSSVIEW: " + s);
+        this.stereotypeView = s;
+        renderingChanged();
+    }
     
 } /* end class FigNodeModelElement */

Modified: branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigProfileIcon.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigProfileIcon.java?view=diff&rev=12771&p1=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigProfileIcon.java&p2=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigProfileIcon.java&r1=12770&r2=12771
==============================================================================
--- branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigProfileIcon.java	(original)
+++ branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigProfileIcon.java	2007-06-07 08:21:54-0700
@@ -25,6 +25,8 @@
 package org.argouml.uml.diagram.ui;

 

 import java.awt.Image;

+import java.awt.event.MouseEvent;

+import java.util.Vector;

 

 import org.tigris.gef.presentation.FigImage;

 import org.tigris.gef.presentation.FigNode;

@@ -49,7 +51,7 @@
 	image.setResizable(false);

 	image.setLocked(true);

     }

-        

+    

     protected void setBoundsImpl(int x, int y, int w, int h) {	

 	int width = Math.max(image.getWidth(), label.getWidth());
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.