Author: maurelio1234
Date: 2007-05-30 08:01:27-0700
New Revision: 12716
Modified:
branches/gsoc2007/maurelio1234/argouml/ext/profile-javabeans.jar
branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/UmlDiagramRenderer.java
branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FigNodeStrategy.java
branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileConfiguration.java
Log:
trying to implement figures support. it seems my code is just not being called :(
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=12716&p1=branches/gsoc2007/maurelio1234/argouml/ext/profile-javabeans.jar&p2=branches/gsoc2007/maurelio1234/argouml/ext/profile-javabeans.jar&r1=12715&r2=12716
==============================================================================
Binary files. No diff available.
Modified: branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/UmlDiagramRenderer.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/UmlDiagramRenderer.java?view=diff&rev=12716&p1=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/UmlDiagramRenderer.java&p2=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/UmlDiagramRenderer.java&r1=12715&r2=12716
==============================================================================
--- branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/UmlDiagramRenderer.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/diagram/UmlDiagramRenderer.java 2007-05-30 08:01:27-0700
@@ -92,6 +92,7 @@
import org.tigris.gef.graph.GraphNodeRenderer;
import org.tigris.gef.presentation.Fig;
import org.tigris.gef.presentation.FigEdge;
+import org.tigris.gef.presentation.FigImage;
import org.tigris.gef.presentation.FigNode;
/**
@@ -120,16 +121,11 @@
}
FigNode figNode = null;
-// figNode = ProjectManager.getManager().getCurrentProject()
-// .getProfileConfiguration().getFigNodeStrategy()
-// .getFigNodelForElement(node, x, y, styleAttributes);
-//
- if (figNode != null) {
-
- } else if (Model.getFacade().isAComment(node)) {
+ if (Model.getFacade().isAComment(node)) {
figNode = new FigComment();
} else if (Model.getFacade().isAStubState(node)) {
- return new FigStubState();
+ //return new FigStubState();
+ figNode = new FigStubState();
} else if (Model.getFacade().isAAssociationClass(node)) {
figNode = new FigClassAssociationClass(node, x, y, 10, 10);
} else if (Model.getFacade().isAClass(node)) {
@@ -222,8 +218,17 @@
throw new IllegalArgumentException(
"Failed to construct a FigNode for " + node);
}
- setStyleAttributes(figNode, styleAttributes);
+ Fig[] fig = ProjectManager.getManager().getCurrentProject()
+ .getProfileConfiguration().getFigNodeStrategy()
+ .getExtraFiguresForNode(node);
+
+ for(int i=0;i<fig.length;++i) {
+ figNode.addFig(fig[i]);
+ }
+
+ setStyleAttributes(figNode, styleAttributes);
+
return figNode;
}
Modified: branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FigNodeStrategy.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FigNodeStrategy.java?view=diff&rev=12716&p1=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FigNodeStrategy.java&p2=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FigNodeStrategy.java&r1=12715&r2=12716
==============================================================================
--- branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FigNodeStrategy.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/FigNodeStrategy.java 2007-05-30 08:01:27-0700
@@ -24,6 +24,10 @@
package org.argouml.uml.profile;
-public interface FigNodeStrategy {
+import org.tigris.gef.presentation.Fig;
+public interface FigNodeStrategy {
+
+ Fig[] getExtraFiguresForNode(Object element);
+
}
Modified: branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileConfiguration.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileConfiguration.java?view=diff&rev=12716&p1=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileConfiguration.java&p2=branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileConfiguration.java&r1=12715&r2=12716
==============================================================================
--- branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileConfiguration.java (original)
+++ branches/gsoc2007/maurelio1234/argouml/org/argouml/uml/profile/ProfileConfiguration.java 2007-05-30 08:01:27-0700
@@ -26,11 +26,11 @@
package org.argouml.uml.profile;
import java.util.Iterator;
-import java.util.Map;
import java.util.Vector;
+import org.apache.log4j.Logger;
import org.argouml.uml.profile.java.ProfileJava;
-import org.tigris.gef.presentation.FigNode;
+import org.tigris.gef.presentation.Fig;
/**
* This class captures the configurable behavior of Argo.
*
@@ -45,6 +45,11 @@
private Vector profiles = new Vector();
private Vector profileModels = new Vector();
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = Logger.getLogger(ProfileConfiguration.class);
+
public ProfileConfiguration() {
defaultProfile = new ProfileJava();
@@ -100,21 +105,25 @@
}
}
+ @SuppressWarnings("unchecked")
private FigNodeStrategy compositeFigNodeStrategy = new FigNodeStrategy() {
-// public FigNode getFigNodelForElement(Object element, int x, int y, Map styleAttributes) {
-// FigNode res = null;
-//
-// Iterator it = figNodeStrategies.iterator();
-// while(it.hasNext()) {
-// FigNodeStrategy strat = (FigNodeStrategy) it.next();
-// res = strat.getFigNodelForElement(element, x, y, styleAttributes);
-// if (res != null) {
-// break;
-// }
-// }
-// return res;
-// }
+ public Fig[] getExtraFiguresForNode(Object element) {
+ Iterator it = figNodeStrategies.iterator();
+ Vector cont = new Vector();
+
+ while(it.hasNext()) {
+ FigNodeStrategy strat = (FigNodeStrategy) it.next();
+ Fig[] extra = strat.getExtraFiguresForNode(element);
+
+ for(int i=0;i<extra.length;++i) {
+ cont.add(extra[i]);
+ }
+ }
+
+ LOG.info("RETURNING " + cont.size() + " elements");
+ return (Fig[])cont.toArray(new Fig[0]);
+ }
};
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.