Author: mvw
Date: 2007-06-29 12:26:40-0700
New Revision: 12924
Modified:
trunk/src_new/org/argouml/kernel/Project.java
trunk/src_new/org/argouml/ui/explorer/ExplorerTreeNode.java
trunk/src_new/org/argouml/ui/explorer/rules/GoStatemachineToDiagram.java
trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java
trunk/src_new/org/argouml/uml/diagram/DiagramFactory.java
trunk/src_new/org/argouml/uml/diagram/activity/layout/ActivityDiagramLayouter.java
trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramLayouter.java
trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java
trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java
trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java
trunk/src_new/org/argouml/uml/reveng/ImportCommon.java
trunk/src_new/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java
trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java
trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java
trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java
trunk/src_new/org/argouml/uml/ui/ActionGenerationSettings.java
trunk/src_new/org/argouml/uml/ui/ActionLayout.java
Log:
Reduce the dependencies on org.argouml.uml.diagram.ui.UMLDiagram (the center of many dependency cycles).
Modified: trunk/src_new/org/argouml/kernel/Project.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/kernel/Project.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/kernel/Project.java&p2=trunk/src_new/org/argouml/kernel/Project.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/kernel/Project.java (original)
+++ trunk/src_new/org/argouml/kernel/Project.java 2007-06-29 12:26:40-0700
@@ -60,7 +60,6 @@
import org.argouml.uml.diagram.DiagramFactory;
import org.argouml.uml.diagram.ProjectMemberDiagram;
import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.argouml.uml.generator.GenerationPreferences;
import org.tigris.gef.base.Diagram;
import org.tigris.gef.presentation.Fig;
@@ -897,15 +896,13 @@
protected void removeDiagram(ArgoDiagram d) {
d.removeVetoableChangeListener(new Vcl());
diagrams.remove(d);
- if (d instanceof UMLDiagram) {
- /* If this is a UML diagram, then remove the dependent
- * modelelements, such as the statemachine
- * for a statechartdiagram.
- */
- Object o = ((UMLDiagram) d).getDependentElement();
- if (o != null) {
- moveToTrash(o);
- }
+ /* Remove the dependent
+ * modelelements, such as the statemachine
+ * for a statechartdiagram:
+ */
+ Object o = d.getDependentElement();
+ if (o != null) {
+ moveToTrash(o);
}
}
Modified: trunk/src_new/org/argouml/ui/explorer/ExplorerTreeNode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/explorer/ExplorerTreeNode.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/ui/explorer/ExplorerTreeNode.java&p2=trunk/src_new/org/argouml/ui/explorer/ExplorerTreeNode.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/ui/explorer/ExplorerTreeNode.java (original)
+++ trunk/src_new/org/argouml/ui/explorer/ExplorerTreeNode.java 2007-06-29 12:26:40-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-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
@@ -33,7 +33,7 @@
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreePath;
-import org.argouml.uml.diagram.ui.UMLDiagram;
+import org.tigris.gef.base.Diagram;
/**
* Ensures that explorer tree nodes have a default ordering.
@@ -59,8 +59,8 @@
public ExplorerTreeNode(Object userObj, ExplorerTreeModel m) {
super(userObj);
this.model = m;
- if (userObj instanceof UMLDiagram)
- ((UMLDiagram) userObj).addPropertyChangeListener(this);
+ if (userObj instanceof Diagram)
+ ((Diagram) userObj).addPropertyChangeListener(this);
}
/*
@@ -124,7 +124,7 @@
*/
public void propertyChange(PropertyChangeEvent evt) {
// Name of the UMLDiagram represented by this node has changed.
- if (evt.getSource() instanceof UMLDiagram
+ if (evt.getSource() instanceof Diagram
&& "name".equals(evt.getPropertyName())) {
model.nodeChanged(this);
}
Modified: trunk/src_new/org/argouml/ui/explorer/rules/GoStatemachineToDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/explorer/rules/GoStatemachineToDiagram.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/ui/explorer/rules/GoStatemachineToDiagram.java&p2=trunk/src_new/org/argouml/ui/explorer/rules/GoStatemachineToDiagram.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/ui/explorer/rules/GoStatemachineToDiagram.java (original)
+++ trunk/src_new/org/argouml/ui/explorer/rules/GoStatemachineToDiagram.java 2007-06-29 12:26:40-0700
@@ -36,7 +36,6 @@
import org.argouml.model.Model;
import org.argouml.uml.diagram.activity.ui.UMLActivityDiagram;
import org.argouml.uml.diagram.state.ui.UMLStateDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
/**
* A go rule to navigate from a statemachine or activitygraph
@@ -56,7 +55,7 @@
Project proj = ProjectManager.getManager().getCurrentProject();
Iterator it = proj.getDiagrams().iterator();
while (it.hasNext()) {
- UMLDiagram diagram = (UMLDiagram) it.next();
+ Object diagram = it.next();
if (diagram instanceof UMLActivityDiagram) {
UMLActivityDiagram activityDiagram =
(UMLActivityDiagram) diagram;
Modified: trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java&p2=trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ArgoDiagram.java 2007-06-29 12:26:40-0700
@@ -476,5 +476,19 @@
public abstract void encloserChanged(
FigNode enclosed, FigNode oldEncloser, FigNode newEncloser);
// Do nothing, override in subclass.
+
+ /**
+ * This method shall return any UML modelelements
+ * that should be deleted when the diagram gets deleted,
+ * or null if there are none. The default implementation returns null;
+ * e.g. a statechart diagram should return its statemachine.
+ *
+ * @author [email protected]
+ *
+ * @return the dependent element - in the general case there aren't, so null
+ */
+ public Object getDependentElement() {
+ return null;
+ }
} /* end class ArgoDiagram */
Modified: trunk/src_new/org/argouml/uml/diagram/DiagramFactory.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/DiagramFactory.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/diagram/DiagramFactory.java&p2=trunk/src_new/org/argouml/uml/diagram/DiagramFactory.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/DiagramFactory.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/DiagramFactory.java 2007-06-29 12:26:40-0700
@@ -44,8 +44,8 @@
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.ui.UMLDiagram;
import org.argouml.uml.diagram.use_case.ui.UMLUseCaseDiagram;
+import org.tigris.gef.base.Diagram;
import org.tigris.gef.graph.GraphNodeRenderer;
import org.tigris.gef.presentation.Fig;
@@ -181,7 +181,7 @@
public Object createRenderingElement(Object diagram, Object model) {
GraphNodeRenderer rend =
- ((UMLDiagram) diagram).getLayer().getGraphNodeRenderer();
+ ((Diagram) diagram).getLayer().getGraphNodeRenderer();
Object renderingElement =
rend.getFigNodeFor(model, 0, 0, noStyleProperties);
return renderingElement;
Modified: trunk/src_new/org/argouml/uml/diagram/activity/layout/ActivityDiagramLayouter.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/activity/layout/ActivityDiagramLayouter.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/diagram/activity/layout/ActivityDiagramLayouter.java&p2=trunk/src_new/org/argouml/uml/diagram/activity/layout/ActivityDiagramLayouter.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/activity/layout/ActivityDiagramLayouter.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/activity/layout/ActivityDiagramLayouter.java 2007-06-29 12:26:40-0700
@@ -31,9 +31,9 @@
import java.util.List;
import org.argouml.model.Model;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.layout.LayoutedObject;
import org.argouml.uml.diagram.layout.Layouter;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.tigris.gef.presentation.Fig;
/**
@@ -52,7 +52,7 @@
/*
* The diagram to be laid out.
*/
- private UMLDiagram diagram;
+ private ArgoDiagram diagram;
/*
* List of objects.
@@ -84,7 +84,7 @@
* Construct a new layout engine for an ActivityDiagram.
* @param d the ActivityDiagram to be laid out.
*/
- public ActivityDiagramLayouter(UMLDiagram d) {
+ public ActivityDiagramLayouter(ArgoDiagram d) {
this.diagram = d;
}
Modified: trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramLayouter.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramLayouter.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramLayouter.java&p2=trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramLayouter.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramLayouter.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/static_structure/layout/ClassdiagramLayouter.java 2007-06-29 12:26:40-0700
@@ -34,9 +34,9 @@
import java.util.Vector;
import org.apache.log4j.Logger;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.layout.LayoutedObject;
import org.argouml.uml.diagram.layout.Layouter;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.tigris.gef.presentation.Fig;
/**
@@ -287,7 +287,7 @@
/**
* The diagram that will be layouted.
*/
- private UMLDiagram diagram;
+ private ArgoDiagram diagram;
/**
* HashMap with figures as key and Nodes as elements.
@@ -335,7 +335,7 @@
*
* @param theDiagram The diagram to layout.
*/
- public ClassdiagramLayouter(UMLDiagram theDiagram) {
+ public ClassdiagramLayouter(ArgoDiagram theDiagram) {
diagram = theDiagram;
Iterator<Fig> nodeIter = diagram.getLayer().getContents().iterator();
while (nodeIter.hasNext()) {
Modified: trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&p2=trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/static_structure/ui/FigPackage.java 2007-06-29 12:26:40-0700
@@ -633,7 +633,7 @@
Vector diags = lP.getDiagrams();
Enumeration diagEnum = diags.elements();
- UMLDiagram lFirst = null;
+ ArgoDiagram lFirst = null;
while (diagEnum.hasMoreElements()) {
UMLDiagram lDiagram =
(UMLDiagram) diagEnum.nextElement();
Modified: trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/FigNodeModelElement.java 2007-06-29 12:26:40-0700
@@ -83,6 +83,7 @@
import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.UMLMutableGraphSupport;
import org.argouml.uml.ui.ActionDeleteModelElements;
+import org.tigris.gef.base.Diagram;
import org.tigris.gef.base.Editor;
import org.tigris.gef.base.Globals;
import org.tigris.gef.base.Layer;
@@ -570,7 +571,7 @@
super.setEnclosingFig(newEncloser);
if (layer != null && newEncloser != oldEncloser) {
- ArgoDiagram diagram = (ArgoDiagram) layer.getDiagram();
+ Diagram diagram = layer.getDiagram();
if (diagram instanceof UMLDiagram) {
UMLDiagram umlDiagram = (UMLDiagram) diagram;
// Set the namespace of the enclosed model element to the
Modified: trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java&p2=trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ui/UMLDiagram.java 2007-06-29 12:26:40-0700
@@ -628,20 +628,6 @@
*/
public abstract String getLabelName();
- /**
- * This method shall return any UML modelelements
- * that should be deleted when the diagram gets deleted,
- * or null if there are none. The default implementation returns null;
- * e.g. a statechart diagram should return its statemachine.
- *
- * @author [email protected]
- *
- * @return the dependent element - in the general case there aren't, so null
- */
- public Object getDependentElement() {
- return null;
- }
-
/*
* @see org.argouml.ui.explorer.Relocatable#isRelocationAllowed(java.lang.Object)
*/
Modified: trunk/src_new/org/argouml/uml/reveng/ImportCommon.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/reveng/ImportCommon.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/reveng/ImportCommon.java&p2=trunk/src_new/org/argouml/uml/reveng/ImportCommon.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/reveng/ImportCommon.java (original)
+++ trunk/src_new/org/argouml/uml/reveng/ImportCommon.java 2007-06-29 12:26:40-0700
@@ -46,9 +46,9 @@
import org.argouml.model.Model;
import org.argouml.taskmgmt.ProgressMonitor;
import org.argouml.ui.explorer.ExplorerEventAdaptor;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.static_structure.ClassDiagramGraphModel;
import org.argouml.uml.diagram.static_structure.layout.ClassdiagramLayouter;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.argouml.uml.reveng.ImportInterface.ImportException;
import org.tigris.gef.base.Globals;
@@ -454,7 +454,7 @@
int total = startingProgress + diagrams.size()
/ 10;
for (int i = 0; i < diagrams.size(); i++) {
- UMLDiagram diagram = (UMLDiagram) diagrams.elementAt(i);
+ ArgoDiagram diagram = (ArgoDiagram) diagrams.elementAt(i);
ClassdiagramLayouter layouter = new ClassdiagramLayouter(diagram);
layouter.layout();
int act = startingProgress + (i + 1) / 10;
Modified: trunk/src_new/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java&p2=trunk/src_new/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java (original)
+++ trunk/src_new/org/argouml/uml/reveng/ui/RESequenceDiagramDialog.java 2007-06-29 12:26:40-0700
@@ -62,6 +62,7 @@
import org.argouml.ui.CheckboxTableModel;
import org.argouml.ui.explorer.ExplorerEventAdaptor;
import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.DiagramFactory;
import org.argouml.uml.diagram.sequence.MessageNode;
import org.argouml.uml.diagram.sequence.SequenceDiagramGraphModel;
@@ -69,7 +70,6 @@
import org.argouml.uml.diagram.sequence.ui.FigMessage;
import org.argouml.uml.diagram.sequence.ui.SequenceDiagramLayer;
import org.argouml.uml.diagram.sequence.ui.UMLSequenceDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.argouml.uml.reveng.ImportSettings;
import org.argouml.uml.reveng.java.JavaLexer;
import org.argouml.uml.reveng.java.JavaRecognizer;
@@ -110,7 +110,7 @@
private List calldata = new ArrayList();
private Hashtable types = new Hashtable();
private Object collaboration;
- private UMLDiagram diagram;
+ private ArgoDiagram diagram;
private SequenceDiagramGraphModel graphModel;
private CheckboxTableModel callTable;
private JComboBox modeChoice;
@@ -171,7 +171,7 @@
Project p = ProjectManager.getManager().getCurrentProject();
Iterator iter = p.getDiagrams().iterator();
while (iter.hasNext()) {
- diagram = (UMLDiagram) iter.next();
+ diagram = (ArgoDiagram) iter.next();
if (graphModel == diagram.getGraphModel()) {
break;
}
@@ -474,7 +474,7 @@
Model.getFacade().getNamespace(theClassifier),
theClassifier);
diagram =
- (UMLDiagram) DiagramFactory.getInstance().createDiagram(
+ DiagramFactory.getInstance().createDiagram(
UMLSequenceDiagram.class,
collaboration,
null);
Modified: trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java&p2=trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionAddDiagram.java 2007-06-29 12:26:40-0700
@@ -36,6 +36,7 @@
import org.argouml.model.Model;
import org.argouml.ui.explorer.ExplorerEventAdaptor;
import org.argouml.ui.targetmanager.TargetManager;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.ui.UMLDiagram;
import org.tigris.gef.undo.UndoableAction;
@@ -77,7 +78,7 @@
if (ns != null && isValidNamespace(ns)) {
super.actionPerformed(e);
- UMLDiagram diagram = createDiagram(ns);
+ ArgoDiagram diagram = createDiagram(ns);
p.addMember(diagram);
//TODO: make the explorer listen to project member property
//changes... to eliminate coupling on gui.
Modified: trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java&p2=trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionDeleteModelElements.java 2007-06-29 12:26:40-0700
@@ -47,8 +47,8 @@
import org.argouml.ui.targetmanager.TargetListener;
import org.argouml.ui.targetmanager.TargetManager;
import org.argouml.uml.CommentEdge;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.argouml.uml.diagram.ui.ActionDeleteConcurrentRegion;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.tigris.gef.base.Diagram;
import org.tigris.gef.base.Editor;
import org.tigris.gef.base.Globals;
@@ -176,9 +176,9 @@
} else if (Model.getFacade().isAUMLElement(target)) {
// It is a UML element that is not a ModelElement
sure = true;
- } else if (target instanceof UMLDiagram) {
+ } else if (target instanceof ArgoDiagram) {
// lets see if this diagram has some figs on it
- UMLDiagram diagram = (UMLDiagram) target;
+ ArgoDiagram diagram = (ArgoDiagram) target;
if (diagram.getNodes().size() + diagram.getEdges().size() != 0) {
// the diagram contains figs so lets ask the user if
// he/she is sure
Modified: trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java&p2=trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionGenerateProjectCode.java 2007-06-29 12:26:40-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-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
@@ -74,7 +74,7 @@
Vector classes = new Vector();
ArgoDiagram activeDiagram =
ProjectManager.getManager().getCurrentProject().getActiveDiagram();
- if (!(activeDiagram instanceof UMLDiagram)) {
+ if (activeDiagram == null) {
return;
}
Object ns = ((UMLDiagram) activeDiagram).getNamespace();
@@ -113,8 +113,7 @@
public boolean isEnabled() {
ArgoDiagram activeDiagram = ProjectManager.getManager()
.getCurrentProject().getActiveDiagram();
- return super.isEnabled()
- && (activeDiagram instanceof UMLDiagram);
+ return super.isEnabled() && (activeDiagram != null);
}
/**
Modified: trunk/src_new/org/argouml/uml/ui/ActionGenerationSettings.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionGenerationSettings.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/ui/ActionGenerationSettings.java&p2=trunk/src_new/org/argouml/uml/ui/ActionGenerationSettings.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionGenerationSettings.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionGenerationSettings.java 2007-06-29 12:26:40-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-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
@@ -30,7 +30,7 @@
import org.argouml.i18n.Translator;
import org.argouml.kernel.ProjectManager;
-import org.argouml.uml.diagram.ui.UMLDiagram;
+import org.argouml.uml.diagram.ArgoDiagram;
import org.tigris.gef.undo.UndoableAction;
/**
@@ -69,10 +69,10 @@
* @see org.tigris.gef.undo.UndoableAction#isEnabled()
*/
public boolean isEnabled() {
- org.argouml.uml.diagram.ArgoDiagram activeDiagram =
+ ArgoDiagram activeDiagram =
ProjectManager.getManager().getCurrentProject().getActiveDiagram();
return super.isEnabled()
- && (activeDiagram instanceof UMLDiagram);
+ && (activeDiagram != null);
}
} /* end class ActionGenerationSettings */
Modified: trunk/src_new/org/argouml/uml/ui/ActionLayout.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/ui/ActionLayout.java?view=diff&rev=12924&p1=trunk/src_new/org/argouml/uml/ui/ActionLayout.java&p2=trunk/src_new/org/argouml/uml/ui/ActionLayout.java&r1=12923&r2=12924
==============================================================================
--- trunk/src_new/org/argouml/uml/ui/ActionLayout.java (original)
+++ trunk/src_new/org/argouml/uml/ui/ActionLayout.java 2007-06-29 12:26:40-0700
@@ -1,5 +1,5 @@
// $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-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
@@ -38,7 +38,6 @@
import org.argouml.uml.diagram.layout.Layouter;
import org.argouml.uml.diagram.static_structure.layout.ClassdiagramLayouter;
import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
-import org.argouml.uml.diagram.ui.UMLDiagram;
import org.tigris.gef.base.Editor;
import org.tigris.gef.base.Globals;
import org.tigris.gef.base.SelectionManager;
@@ -99,10 +98,10 @@
.getCurrentProject().getActiveDiagram();
Layouter layouter;
if (diagram instanceof UMLClassDiagram) {
- layouter = new ClassdiagramLayouter((UMLClassDiagram) diagram);
+ layouter = new ClassdiagramLayouter(diagram);
} else if (diagram instanceof UMLActivityDiagram) {
layouter =
- new ActivityDiagramLayouter((UMLActivityDiagram) diagram);
+ new ActivityDiagramLayouter(diagram);
} else {
return;
}
@@ -114,8 +113,8 @@
Editor ce = Globals.curEditor();
SelectionManager sm = ce.getSelectionManager();
Collection nodes =
- ((UMLDiagram) ProjectManager.getManager().getCurrentProject()
- .getActiveDiagram())
+ ProjectManager.getManager().getCurrentProject()
+ .getActiveDiagram()
.getLayer().getContents();
sm.select(nodes);
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.