svn commit: r12863 - branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram: static_structure/ui ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: maurelio1234
Date: 2007-06-17 04:49:08-0700
New Revision: 12863

Modified:
   branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/static_structure/ui/FigClass.java
   branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/ui/FigNodeModelElement.java

Log:
solving bugs

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=12863&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=12862&r2=12863
==============================================================================
--- 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-17 04:49:08-0700
@@ -630,7 +630,7 @@
 	    getOperationsFig().setBounds(x, operationsY, w, operationsHeight);
 	}
 
-	updateStereotypeIcon();
+//	updateStereotypeIcon();
 	// Now force calculation of the bounds of the figure, update the edges
 	// and trigger anyone who's listening to see if the "bounds" property
 	// has changed.

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=12863&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=12862&r2=12863
==============================================================================
--- 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-17 04:49:08-0700
@@ -246,6 +246,7 @@
     private static final int ICON_WIDTH = 16;
     
     private FigText originalNameFig;
+    private Fig     originalBigPort;
     
     /**
      * EnclosedFigs are the Figs that are enclosed by this figure. Say that
@@ -1457,6 +1458,10 @@
 	}
 
 	if (stereotypeFigProfileIcon != null) {
+	    for (Object fig : getFigs()) {
+		((Fig) fig).setVisible(fig != stereotypeFigProfileIcon);
+	    }
+
 	    this.removeFig(stereotypeFigProfileIcon);
 	    stereotypeFigProfileIcon = null;
 	}
@@ -1466,24 +1471,35 @@
 	    originalNameFig = null;
 	}
 
+	if (originalBigPort != null) {
+	    this.setBigPort(originalBigPort);
+	    originalBigPort = null;
+	}
+	
 	if (!floatingStereotypes.isEmpty()) {
 	    for (Object icon : floatingStereotypes) {
 		this.removeFig((Fig) icon);
 	    }
 	    floatingStereotypes.clear();
 	}
-
+	
+	int practicalView = getStereotypeView();
 	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 && 
+		(stereos == null || stereos.size() != 1)) {
+	    practicalView = STEREOTYPE_VIEW_TEXTUAL;
 	}	
 	 
-	if (getStereotypeView() == STEREOTYPE_VIEW_BIG_ICON) {
+	Fig stereoFig = getStereotypeFig();
+	if (stereoFig instanceof FigStereotypesCompartment) {
+	    ((FigStereotypesCompartment) stereoFig)
+		    .setHidingStereotypesWithIcon(practicalView == STEREOTYPE_VIEW_SMALL_ICON);
+	}
 
+	if (practicalView == STEREOTYPE_VIEW_BIG_ICON) {
+	    
 	    if (stereos != null) {
 		Image replaceIcon = null;
 
@@ -1506,12 +1522,16 @@
 		    originalNameFig = this.getNameFig();
 		    this.setNameFig(stereotypeFigProfileIcon.getLabelFig());
 
+		    originalBigPort = this.getBigPort();
+		    this.setBigPort(stereotypeFigProfileIcon);
+		    
 		    for (Object fig : getFigs()) {
 			((Fig) fig).setVisible(fig == stereotypeFigProfileIcon);
 		    }
+		    
 		}
 	    }
-	} else if (getStereotypeView() == STEREOTYPE_VIEW_SMALL_ICON) {
+	} else if (practicalView == STEREOTYPE_VIEW_SMALL_ICON) {
 	    int i = this.getX() + this.getWidth() - ICON_WIDTH - 2;
 	    
 	    for (Object stereo : stereos) {
@@ -1529,11 +1549,16 @@
 		    
 		    i -= ICON_WIDTH - 2;
 		}
-	    }
+	    }	    
 	}
-	    
+
+	updateStereotypeText();
+	
 	damage();
-//	this.redraw();
+	calcBounds();
+	updateEdges();
+	this.updateBounds();
+	this.redraw();
     }
     
     /*
@@ -1902,7 +1927,6 @@
     }
 
     public void setStereotypeView(int s) {
-	System.out.println("SETSSSVIEW: " + s);
         this.stereotypeView = s;
         renderingChanged();
     }
@@ -1915,7 +1939,8 @@
 
 	if (getStereotypeView() == STEREOTYPE_VIEW_BIG_ICON) {
 	    if (stereotypeFigProfileIcon != null) {
-		    stereotypeFigProfileIcon.setBounds(x, y, w, h);
+		    stereotypeFigProfileIcon.setBounds(stereotypeFigProfileIcon
+			.getX(), stereotypeFigProfileIcon.getY(), w, h);
 		    // FigClass calls setBoundsImpl before we set 
 		    // the stereotypeFigProfileIcon
 	    }
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.