svn commit: r17135 - trunk/src/argouml-app: . META-INF src/org/argouml/uml/diagram src/org/argouml/uml/ui
Tom Morris <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: tfmorris
Date: 2009-04-26 13:24:11-0700
New Revision: 17135
Modified:
trunk/src/argouml-app/.classpath
trunk/src/argouml-app/META-INF/MANIFEST.MF
trunk/src/argouml-app/build.xml
trunk/src/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java
trunk/src/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java
trunk/src/argouml-app/src/org/argouml/uml/ui/ActionCollaborationDiagram.java
trunk/src/argouml-app/src/org/argouml/uml/ui/ActionNewDiagram.java
trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSequenceDiagram.java
trunk/src/argouml-app/src/org/argouml/uml/ui/ActionStateDiagram.java
Log:
Issue 5780: Remove old sequence diagram references and deprecated diagram factory methods
http://argouml.tigris.org/issues/show_bug.cgi?id=5780
Modified: trunk/src/argouml-app/.classpath
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/.classpath?view=diff&pathrev=17135&r1=17134&r2=17135
==============================================================================
--- trunk/src/argouml-app/.classpath (original)
+++ trunk/src/argouml-app/.classpath 2009-04-26 13:24:11-0700
@@ -1,16 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" output="build-eclipse-tests" path="tests"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.2.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/gef-0.13.jar" sourcepath="/gef/src"/>
- <classpathentry exported="true" kind="lib" path="lib/ocl-argo-1.1.jar"/>
- <classpathentry exported="true" kind="lib" path="lib/swidgets-0.1.4.jar" sourcepath="/swidgets/src"/>
- <classpathentry exported="true" kind="lib" path="lib/toolbar-1.4.1-20071227.jar" sourcepath="/toolbar/src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
- <classpathentry kind="lib" path="/argouml-core-tools/lib/easymock12.jar"/>
- <classpathentry kind="lib" path="/argouml-core-tools/jdepend-2.9/lib/jdepend-2.9.jar"/>
- <classpathentry kind="output" path="build-eclipse"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry excluding="org/argouml/uml/diagram/sequence/|org/argouml/uml/diagram/sequence/ui/|org/argouml/uml/diagram/ui/ActionSetAddMessageMode.java" kind="src" path="src"/>
+ <classpathentry excluding="org/argouml/uml/diagram/sequence/|org/argouml/uml/diagram/sequence/ui/" kind="src" output="build-eclipse-tests" path="tests"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry exported="true" kind="lib" path="lib/commons-logging-1.0.2.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/gef-0.13.jar" sourcepath="/gef/src"/>
+ <classpathentry exported="true" kind="lib" path="lib/ocl-argo-1.1.jar"/>
+ <classpathentry exported="true" kind="lib" path="lib/swidgets-0.1.4.jar" sourcepath="/swidgets/src"/>
+ <classpathentry exported="true" kind="lib" path="lib/toolbar-1.4.1-20071227.jar" sourcepath="/toolbar/src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+ <classpathentry kind="lib" path="/argouml-core-tools/lib/easymock12.jar"/>
+ <classpathentry kind="lib" path="/argouml-core-tools/jdepend-2.9/lib/jdepend-2.9.jar"/>
+ <classpathentry kind="output" path="build-eclipse"/>
+</classpath>
Modified: trunk/src/argouml-app/META-INF/MANIFEST.MF
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/META-INF/MANIFEST.MF?view=diff&pathrev=17135&r1=17134&r2=17135
==============================================================================
--- trunk/src/argouml-app/META-INF/MANIFEST.MF (original)
+++ trunk/src/argouml-app/META-INF/MANIFEST.MF 2009-04-26 13:24:11-0700
@@ -67,8 +67,6 @@
org.argouml.uml.diagram.deployment,
org.argouml.uml.diagram.deployment.ui,
org.argouml.uml.diagram.layout,
- org.argouml.uml.diagram.sequence,
- org.argouml.uml.diagram.sequence.ui,
org.argouml.uml.diagram.state,
org.argouml.uml.diagram.state.ui,
org.argouml.uml.diagram.static_structure,
Modified: trunk/src/argouml-app/build.xml
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/build.xml?view=diff&pathrev=17135&r1=17134&r2=17135
==============================================================================
--- trunk/src/argouml-app/build.xml (original)
+++ trunk/src/argouml-app/build.xml 2009-04-26 13:24:11-0700
@@ -252,7 +252,7 @@
deprecation="${deprecation}"
destdir="${build.classes}"
includes="org/argouml/**/*.java"
- excludes="org/argouml/model/uml/**"
+ excludes="org/argouml/model/uml/**,org/argouml/uml/diagram/sequence/**,**/ActionSetAddMessageMode.java"
optimize="${optimize}"
includeAntRuntime="no"
bootclasspath="${bundleBootClasspath}"
@@ -349,7 +349,6 @@
destdir="${tests.classes}"
srcdir="tests"
includes="org/argouml/uml/reveng/TestJavaImportUnicode.java"
- excludes="org/argouml/model/uml/**"
encoding="iso8859-1"
source="1.5"
target="1.5">
@@ -365,7 +364,7 @@
optimize="false"
destdir="${tests.classes}"
srcdir="tests"
- excludes="org/argouml/model/uml/**"
+ excludes="org/argouml/model/uml/**,org/argouml/uml/diagram/sequence/**,**/ActionSetAddMessageMode.java"
source="1.5"
target="1.5">
<compilerarg compiler="javac1.5" line="-Xlint:unchecked"/>
@@ -386,7 +385,6 @@
<cobertura-instrument todir="${build.dir}/instrumented" datafile="${cobertura.datafile}">
<fileset dir="${build.classes}">
<include name="**/*.class" />
- <exclude name="**/JavaLexer.class **/JavaRecognizer.class **/JavaTokenTypes.class" />
</fileset>
</cobertura-instrument>
</target>
Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java?view=diff&pathrev=17135&r1=17134&r2=17135
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/DiagramFactory.java 2009-04-26 13:24:11-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2008 The Regents of the University of California. All
+// Copyright (c) 1996-2009 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
@@ -25,7 +25,6 @@
package org.argouml.uml.diagram;
import java.util.EnumMap;
-import java.util.HashMap;
import java.util.Map;
import org.argouml.kernel.ProjectManager;
@@ -35,18 +34,14 @@
import org.argouml.model.DeploymentDiagram;
import org.argouml.model.DiDiagram;
import org.argouml.model.Model;
-import org.argouml.model.SequenceDiagram;
import org.argouml.model.StateDiagram;
import org.argouml.model.UseCaseDiagram;
import org.argouml.uml.diagram.activity.ui.UMLActivityDiagram;
import org.argouml.uml.diagram.collaboration.ui.UMLCollaborationDiagram;
import org.argouml.uml.diagram.deployment.ui.UMLDeploymentDiagram;
-import org.argouml.uml.diagram.sequence.ui.UMLSequenceDiagram;
import org.argouml.uml.diagram.state.ui.UMLStateDiagram;
import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
import org.argouml.uml.diagram.use_case.ui.UMLUseCaseDiagram;
-import org.tigris.gef.base.Diagram;
-import org.tigris.gef.graph.GraphNodeRenderer;
/**
* Provide a factory method to create different UML diagrams.
@@ -55,8 +50,6 @@
*/
public final class DiagramFactory {
- private final Map noStyleProperties = new HashMap();
-
/**
* Map from our public enum to our internal implementation classes.
* This allows use to hide the implementation classes from users of
@@ -79,11 +72,8 @@
Class, UseCase, State, Deployment, Collaboration, Activity, Sequence
}
- private Map<DiagramType, Object> factories =
- new EnumMap<DiagramType, Object>(DiagramType.class);
- // TODO: This can be typed again when the deprecation period has expired
-// private Map<DiagramType, DiagramFactoryInterface2> factories =
-// new EnumMap<DiagramType, DiagramFactoryInterface2>(DiagramType.class);
+ private Map<DiagramType, DiagramFactoryInterface2> factories =
+ new EnumMap<DiagramType, DiagramFactoryInterface2>(DiagramType.class);
private DiagramFactory() {
super();
@@ -96,7 +86,6 @@
diagramClasses.put(DiagramType.Collaboration,
UMLCollaborationDiagram.class);
diagramClasses.put(DiagramType.Activity, UMLActivityDiagram.class);
- diagramClasses.put(DiagramType.Sequence, UMLSequenceDiagram.class);
}
/**
@@ -228,7 +217,7 @@
* 'namespace' for all others.
*/
@Deprecated
- public ArgoDiagram createDiagram(Class type, Object namespace,
+ private ArgoDiagram createDiagram(Class type, Object namespace,
Object machine) {
ArgoDiagram diagram = null;
@@ -253,9 +242,6 @@
} else if (type == UMLActivityDiagram.class) {
diagram = new UMLActivityDiagram(namespace, machine);
diType = ActivityDiagram.class;
- } else if (type == UMLSequenceDiagram.class) {
- diagram = new UMLSequenceDiagram(namespace);
- diType = SequenceDiagram.class;
}
if (diagram == null) {
@@ -295,42 +281,19 @@
return diagram;
}
- /**
- * @deprecated for 0.27.2 by tfmorris. Undocumented and unused internally.
- */
- @Deprecated
- public Object createRenderingElement(Object diagram, Object model) {
- GraphNodeRenderer rend =
- ((Diagram) diagram).getLayer().getGraphNodeRenderer();
- Object renderingElement =
- rend.getFigNodeFor(model, 0, 0, noStyleProperties);
- return renderingElement;
- }
-
- /**
- * Register a specific factory class to create diagram instances for a
- * specific diagram type
- * @param type the diagram type
- * @param factory the factory instance
- * @deprecated for 0.27.3 by tfmorris. Use
- * {@link #registerDiagramFactory(DiagramType, DiagramFactoryInterface2)}.
- */
- @Deprecated
- public void registerDiagramFactory(
- final DiagramType type,
- final DiagramFactoryInterface factory) {
- factories.put(type, factory);
- }
/**
* Register a specific factory class to create diagram instances for a
* specific diagram type
+ *
* @param type the diagram type
* @param factory the factory instance
*/
public void registerDiagramFactory(
final DiagramType type,
final DiagramFactoryInterface2 factory) {
+ // TODO: This uses a "last one wins" algorithm for registration
+ // We should warn if a factory is being overwritten.
factories.put(type, factory);
}
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java?view=diff&pathrev=17135&r1=17134&r2=17135
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/ActionActivityDiagram.java 2009-04-26 13:24:11-0700
@@ -28,6 +28,7 @@
import org.argouml.ui.targetmanager.TargetManager;
import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.DiagramFactory;
+import org.argouml.uml.diagram.DiagramSettings;
/**
* Action to trigger creation of a new activity diagram.<p>
@@ -49,28 +50,29 @@
super("action.activity-diagram");
}
- /**
- * Create the diagram.
- * @param namespace the namespace in which to create the diagram
- * @return the newly created and initialized diagram
- */
- protected ArgoDiagram createDiagram(Object namespace) {
+ @Override
+ protected ArgoDiagram createDiagram(Object namespace,
+ DiagramSettings settings) {
+ Object context = getContext(namespace);
+ Object graph =
+ Model.getActivityGraphsFactory().buildActivityGraph(context);
+
+ return DiagramFactory.getInstance().create(
+ DiagramFactory.DiagramType.Activity,
+ graph, settings);
+ }
+
+ private Object getContext(Object namespace) {
Object context = TargetManager.getInstance().getModelTarget();
if (!Model.getActivityGraphsHelper().isAddingActivityGraphAllowed(
context)
|| Model.getModelManagementHelper().isReadOnly(context)) {
context = namespace;
- }
- Object graph =
- Model.getActivityGraphsFactory().buildActivityGraph(context);
-
- return DiagramFactory.getInstance().createDiagram(
- DiagramFactory.DiagramType.Activity,
- Model.getFacade().getNamespace(graph),
- graph);
+ }
+ return context;
}
-
+
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/ActionCollaborationDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/ActionCollaborationDiagram.java?view=diff&pathrev=17135&r1=17134&r2=17135
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/ActionCollaborationDiagram.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/ActionCollaborationDiagram.java 2009-04-26 13:24:11-0700
@@ -24,8 +24,9 @@
package org.argouml.uml.ui;
-import org.argouml.uml.diagram.DiagramFactory;
import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramFactory;
+import org.argouml.uml.diagram.DiagramSettings;
/**
* Action to trigger creation of new collaboration diagram.
@@ -42,6 +43,9 @@
/*
* @see org.argouml.uml.ui.ActionNewDiagram#createDiagram()
*/
+ @SuppressWarnings("deprecation")
+ @Deprecated
+ @Override
public ArgoDiagram createDiagram(Object namespace) {
return DiagramFactory.getInstance().createDiagram(
DiagramFactory.DiagramType.Collaboration,
@@ -49,6 +53,12 @@
null);
}
+ public ArgoDiagram createDiagram(Object namespace,
+ DiagramSettings settings) {
+ return DiagramFactory.getInstance().create(
+ DiagramFactory.DiagramType.Collaboration,
+ createCollaboration(namespace), settings);
+ }
/**
* The UID.
*/
Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/ActionNewDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/ActionNewDiagram.java?view=diff&pathrev=17135&r1=17134&r2=17135
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/ActionNewDiagram.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/ActionNewDiagram.java 2009-04-26 13:24:11-0700
@@ -37,6 +37,7 @@
import org.argouml.ui.explorer.ExplorerEventAdaptor;
import org.argouml.ui.targetmanager.TargetManager;
import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramSettings;
import org.tigris.gef.undo.UndoableAction;
/**
@@ -50,11 +51,7 @@
*/
public abstract class ActionNewDiagram extends UndoableAction {
- /**
- * Logger.
- */
- private static final Logger LOG =
- Logger.getLogger(ActionNewDiagram.class);
+ private static final Logger LOG = Logger.getLogger(ActionNewDiagram.class);
/**
* The constructor.
@@ -76,6 +73,9 @@
public void actionPerformed(ActionEvent e) {
super.actionPerformed(e);
+ // TODO: Get Project or other necessary context from source??
+ // e.getSource();
+
// TODO: Since there may be multiple top level elements in
// a project, this should be using the default Namespace (currently
// undefined) or something similar
@@ -83,7 +83,8 @@
Object ns = findNamespace();
if (ns != null && isValidNamespace(ns)) {
- ArgoDiagram diagram = createDiagram(ns);
+ ArgoDiagram diagram = createDiagram(ns,
+ p.getProjectSettings().getDefaultDiagramSettings());
assert (diagram != null)
: "No diagram was returned by the concrete class";
@@ -112,8 +113,26 @@
/**
* @param namespace the namespace in which to create the diagram
* @return the new diagram
+ * @deprecated for 0.29.1 by tfmorris. Use
+ * {@link #createDiagram(Object, DiagramSettings)}/
+ */
+ @SuppressWarnings("deprecation")
+ @Deprecated
+ protected ArgoDiagram createDiagram(Object namespace) {
+ DiagramSettings settings = ProjectManager.getManager()
+ .getCurrentProject().getProjectSettings()
+ .getDefaultDiagramSettings();
+
+ return createDiagram(namespace, settings);
+ }
+
+ /**
+ * @param namespace the namespace in which to create the diagram
+ * @param settings the render settings for the diagram
+ * @return the new diagram
*/
- protected abstract ArgoDiagram createDiagram(Object namespace);
+ protected abstract ArgoDiagram createDiagram(Object namespace,
+ DiagramSettings settings);
/**
* Test if the given namespace is a valid namespace to add the diagram to.
Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSequenceDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSequenceDiagram.java?view=diff&pathrev=17135&r1=17134&r2=17135
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSequenceDiagram.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/ActionSequenceDiagram.java 2009-04-26 13:24:11-0700
@@ -24,8 +24,9 @@
package org.argouml.uml.ui;
-import org.argouml.uml.diagram.DiagramFactory;
import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramFactory;
+import org.argouml.uml.diagram.DiagramSettings;
/**
* Action to add a new sequence diagram.
@@ -39,14 +40,11 @@
super("action.sequence-diagram");
}
- /*
- * @see org.argouml.uml.ui.ActionNewDiagram#createDiagram()
- */
- public ArgoDiagram createDiagram(Object namespace) {
- return DiagramFactory.getInstance().createDiagram(
+ public ArgoDiagram createDiagram(Object namespace,
+ DiagramSettings settings) {
+ return DiagramFactory.getInstance().create(
DiagramFactory.DiagramType.Sequence,
- createCollaboration(namespace),
- null);
+ createCollaboration(namespace), settings);
}
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/ActionStateDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/ActionStateDiagram.java?view=diff&pathrev=17135&r1=17134&r2=17135
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/ActionStateDiagram.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/ActionStateDiagram.java 2009-04-26 13:24:11-0700
@@ -30,6 +30,7 @@
import org.argouml.ui.targetmanager.TargetManager;
import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.DiagramFactory;
+import org.argouml.uml.diagram.DiagramSettings;
import org.argouml.uml.diagram.state.ui.UMLStateDiagram;
/**
@@ -44,15 +45,26 @@
super("action.state-diagram");
}
- /*
- * @see org.argouml.uml.ui.ActionNewDiagram#createDiagram()
- */
- protected ArgoDiagram createDiagram(Object namespace) {
+ protected ArgoDiagram createDiagram(Object namespace,
+ DiagramSettings settings) {
+ Object machine = buildMachine(namespace, getTarget(namespace));
+
+ return DiagramFactory.getInstance().create(
+ DiagramFactory.DiagramType.State,
+ machine, settings);
+ }
+
+
+ private Object getTarget(Object namespace) {
Object target = TargetManager.getInstance().getModelTarget();
if (Model.getFacade().isAUMLElement(target)
&& Model.getModelManagementHelper().isReadOnly(target)) {
target = namespace;
}
+ return target;
+ }
+
+ private Object buildMachine(Object namespace, Object target) {
Object machine = null;
if (Model.getStateMachinesHelper().isAddingStatemachineAllowed(
target)) {
@@ -75,11 +87,7 @@
Model.getStateMachinesFactory()
.buildCompositeStateOnStateMachine(machine);
}
-
- return DiagramFactory.getInstance().createDiagram(
- DiagramFactory.DiagramType.State,
- Model.getFacade().getNamespace(machine),
- machine);
+ return machine;
}
private boolean hasNoDiagramYet(Object machine) {
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=1933920
To unsubscribe from this discussion, e-mail: [[email protected]].