svn commit: r17209 - trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram
Bob Tarling <[email protected]>
| Newsgroups | gmane.comp.lang.uml.argouml.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: bobtarling
Date: 2009-08-02 03:30:20-0700
New Revision: 17209
Added:
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAbstraction2.java
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociation2.java
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociationClass2.java
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociationEnd2.java
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigClassAssociationClass2.java
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigDependency2.java
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigEdgeAssociationClass2.java
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigGeneralization2.java
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigLink2.java
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigNodeAssociation2.java
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigPermission2.java
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigUsage2.java
Modified:
trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/ClassDiagram2Renderer.java
Log:
Modified: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/ClassDiagram2Renderer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/ClassDiagram2Renderer.java?view=diff&pathrev=17209&r1=17208&r2=17209
==============================================================================
--- trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/ClassDiagram2Renderer.java (original)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/ClassDiagram2Renderer.java 2009-08-02 03:30:20-0700
@@ -35,17 +35,7 @@
import org.argouml.uml.diagram.DiagramSettings;
import org.argouml.uml.diagram.GraphChangeAdapter;
import org.argouml.uml.diagram.UmlDiagramRenderer;
-import org.argouml.uml.diagram.static_structure.ui.FigEdgeNote;
-import org.argouml.uml.diagram.static_structure.ui.FigLink;
-import org.argouml.uml.diagram.ui.FigAbstraction;
-import org.argouml.uml.diagram.ui.FigAssociation;
-import org.argouml.uml.diagram.ui.FigAssociationClass;
-import org.argouml.uml.diagram.ui.FigAssociationEnd;
-import org.argouml.uml.diagram.ui.FigDependency;
-import org.argouml.uml.diagram.ui.FigGeneralization;
import org.argouml.uml.diagram.ui.FigNodeModelElement;
-import org.argouml.uml.diagram.ui.FigPermission;
-import org.argouml.uml.diagram.ui.FigUsage;
import org.argouml.uml.diagram.ui.UMLDiagram;
import org.tigris.gef.base.Diagram;
import org.tigris.gef.base.Layer;
@@ -85,7 +75,7 @@
*
* @author jrobbins
*/
-public class ClassDiagram2Renderer extends UmlDiagramRenderer {
+class ClassDiagram2Renderer extends UmlDiagramRenderer {
/**
* The UID.
@@ -156,9 +146,9 @@
FigEdge newEdge = null;
if (Model.getFacade().isAAssociationClass(edge)) {
- newEdge = new FigAssociationClass(edge, settings);
+ newEdge = new FigAssociationClass2(edge, settings);
} else if (Model.getFacade().isAAssociationEnd(edge)) {
- FigAssociationEnd asend = new FigAssociationEnd(edge, settings);
+ FigAssociationEnd2 asend = new FigAssociationEnd2(edge, settings);
Model.getFacade().getAssociation(edge);
FigNode associationFN =
(FigNode) lay.presentationFor(
@@ -172,9 +162,9 @@
asend.setDestFigNode(classifierFN);
newEdge = asend;
} else if (Model.getFacade().isAAssociation(edge)) {
- newEdge = new FigAssociation(edge, settings);
+ newEdge = new FigAssociation2(edge, settings);
} else if (Model.getFacade().isALink(edge)) {
- FigLink lnkFig = new FigLink(edge, settings);
+ FigLink2 lnkFig = new FigLink2(edge, settings);
Collection linkEndsColn = Model.getFacade().getConnections(edge);
Object[] linkEnds = linkEndsColn.toArray();
@@ -190,13 +180,13 @@
lnkFig.getFig().setLayer(lay);
newEdge = lnkFig;
} else if (Model.getFacade().isAGeneralization(edge)) {
- newEdge = new FigGeneralization(edge, settings);
+ newEdge = new FigGeneralization2(edge, settings);
} else if (Model.getFacade().isAPackageImport(edge)) {
- newEdge = new FigPermission(edge, settings);
+ newEdge = new FigPermission2(edge, settings);
} else if (Model.getFacade().isAUsage(edge)) {
- newEdge = new FigUsage(edge, settings);
+ newEdge = new FigUsage2(edge, settings);
} else if (Model.getFacade().isAAbstraction(edge)) {
- newEdge = new FigAbstraction(edge, settings);
+ newEdge = new FigAbstraction2(edge, settings);
} else if (Model.getFacade().isADependency(edge)) {
String name = "";
@@ -211,7 +201,7 @@
// any abstraction/realization is going to take the
// isAAbstraction leg of the if before it gets to this more
// general case. - tfm 20080508
- FigAbstraction realFig = new FigAbstraction(edge, settings);
+ FigAbstraction2 realFig = new FigAbstraction2(edge, settings);
Object supplier =
((Model.getFacade().getSuppliers(edge).toArray())[0]);
@@ -228,11 +218,11 @@
realFig.getFig().setLayer(lay);
newEdge = realFig;
} else {
- FigDependency depFig = new FigDependency(edge, settings);
+ FigDependency2 depFig = new FigDependency2(edge, settings);
newEdge = depFig;
}
} else if (edge instanceof CommentEdge) {
- newEdge = new FigEdgeNote(edge, settings);
+ newEdge = new FigEdgeNote2(edge, settings);
}
if (newEdge == null) {
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAbstraction2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAbstraction2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAbstraction2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,62 @@
+// $Id: FigAbstraction.java 17045 2009-04-05 16:52:52Z mvw $
+// 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
+// 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.class2.diagram;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.ArrowHead;
+import org.tigris.gef.presentation.ArrowHeadTriangle;
+
+/**
+ * Fig representing a UML Abstraction.
+ * <p>
+
+ * Graphical representation is a dashed line and a triangle arrow-head.
+ *
+ * @author agauthie
+ */
+public class FigAbstraction2 extends FigDependency2 {
+
+ /**
+ * Create the arrow head for the abstraction. This overrides the
+ * superclass to create a filled arrow head.
+ * @return the arrow head.
+ */
+ protected ArrowHead createEndArrow() {
+ final ArrowHead arrow = new ArrowHeadTriangle();
+ arrow.setFillColor(FILL_COLOR);
+ return arrow;
+ }
+
+ /**
+ * Construct a Fig.
+ *
+ * @param owner owning UML element
+ * @param settings render settings
+ */
+ public FigAbstraction2(Object owner, DiagramSettings settings) {
+ super(owner, settings);
+ }
+}
+
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociation2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociation2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociation2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,46 @@
+// $Id: FigAssociation.java 17107 2009-04-13 18:28:43Z tfmorris $
+// 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
+// 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.class2.diagram;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.FigAssociation;
+
+
+/**
+ * This class represents the Fig of a binary association on a diagram.
+ *
+ */
+public class FigAssociation2 extends FigAssociation {
+
+ /**
+ * Constructor used by PGML parser.
+ *
+ * @param owner owning uml element
+ * @param settings rendering settings
+ */
+ public FigAssociation2(Object owner, DiagramSettings settings) {
+ super(owner, settings);
+ }
+}
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociationClass2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociationClass2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociationClass2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,340 @@
+// $Id: FigAssociationClass.java 17045 2009-04-05 16:52:52Z mvw $
+// 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
+// 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.class2.diagram;
+
+import java.awt.Color;
+import java.awt.Rectangle;
+import java.util.Iterator;
+import java.util.List;
+
+import org.argouml.uml.diagram.AttributesCompartmentContainer;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.OperationsCompartmentContainer;
+import org.argouml.uml.diagram.PathContainer;
+import org.argouml.uml.diagram.ui.FigEdgePort;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigNode;
+import org.tigris.gef.presentation.FigPoly;
+import org.tigris.gef.presentation.FigText;
+
+/**
+ * An Association Class is represented by 3 separate Figs:
+ * <nl>
+ * <li>FigAssociationClass is the association edge drawn between two
+ * classifiers this displays that association properties of the association
+ * class.</li>
+ * <li>FigClassAssociationClass is the classifier box that displays the class
+ * properties of the association class.</li>
+ * </li>
+ * FigEdgeAssociationClass is the dashed line that joins these two.</li>
+ * </nl>
+ *
+ * Whenever the user attempts to remove or delete one of these parts then all
+ * parts must go. Delete would be handled because the model element is deleted
+ * and all parts are listening for such an event and will remove themselves.
+ * However if the user attempts to just remove from diagram one of these parts
+ * then there is no such event. Hence the removeFromDiagram method is overridden
+ * to delegate removal from a single removeFromDiagram method on
+ * FigAssociationClass.
+ *
+ * @author [email protected]
+ */
+public class FigAssociationClass2 extends FigAssociation2 implements
+ AttributesCompartmentContainer, PathContainer,
+ OperationsCompartmentContainer {
+
+ private static final long serialVersionUID = 3643715304027095083L;
+
+ /**
+ * Construct an association class figure for the given AssociationClass
+ * model element using the rendering settings.
+ *
+ * @param element model element
+ * @param settings rendering settings
+ */
+ public FigAssociationClass2(Object element, DiagramSettings settings) {
+ super(element, settings);
+ setBetweenNearestPoints(true);
+ ((FigPoly) getFig()).setRectilinear(false);
+ setDashed(false);
+ }
+
+ /**
+ * This overrides the parent class to do nothing here. An association class
+ * has no name label but instead has the name and stereotype editable in
+ * the association-classes class box.
+ *
+ * @param owner owning uml element
+ * @param settings rendering settings
+ */
+ protected void createNameLabel(Object owner, DiagramSettings settings) {
+ }
+
+ /**
+ * Remove entire composite Fig from Diagram. Discover the attached
+ * FigEdgeAssociationClass and the FigClassAssociationClass attached to
+ * that. Remove them from the diagram before removing this.
+ */
+ @Override
+ protected void removeFromDiagramImpl() {
+ FigEdgeAssociationClass2 figEdgeLink = null;
+ List edges = null;
+
+ FigEdgePort figEdgePort = getEdgePort();
+ if (figEdgePort != null) {
+ edges = figEdgePort.getFigEdges();
+ }
+
+ if (edges != null) {
+ for (Iterator it = edges.iterator(); it.hasNext()
+ && figEdgeLink == null;) {
+ Object o = it.next();
+ if (o instanceof FigEdgeAssociationClass2) {
+ figEdgeLink = (FigEdgeAssociationClass2) o;
+ }
+ }
+ }
+
+ if (figEdgeLink != null) {
+ FigNode figClassBox = figEdgeLink.getDestFigNode();
+ if (!(figClassBox instanceof FigClassAssociationClass2)) {
+ figClassBox = figEdgeLink.getSourceFigNode();
+ }
+ figEdgeLink.removeFromDiagramImpl();
+ ((FigClassAssociationClass2) figClassBox).removeFromDiagramImpl();
+ }
+
+ super.removeFromDiagramImpl();
+ }
+
+ /*
+ * TODO: Is this required? Why would the fig already be dashed?
+ *
+ * @see org.tigris.gef.presentation.FigEdge#setFig(
+ * org.tigris.gef.presentation.Fig)
+ */
+ @Override
+ public void setFig(Fig f) {
+ super.setFig(f);
+ getFig().setDashed(false);
+ }
+
+ /*
+ * @see org.argouml.uml.diagram.ui.FigEdgeModelElement#getNameFig()
+ */
+ @Override
+ protected FigText getNameFig() {
+ return null;
+ }
+
+ /**
+ * @return the bounds of the operations compartment for the associated
+ * FigClassAssociationClass.
+ * @see org.argouml.uml.diagram.AttributesCompartmentContainer#getAttributesBounds()
+ */
+ public Rectangle getAttributesBounds() {
+ if (getAssociationClass() != null) {
+ return getAssociationClass().getAttributesBounds();
+ } else {
+ return new Rectangle(0, 0, 0, 0);
+ }
+ }
+
+ /*
+ * Overridden in order to implement AttributesCompartmentContainer.
+ */
+ public boolean isAttributesVisible() {
+ if (getAssociationClass() != null) {
+ return getAssociationClass().isAttributesVisible();
+ } else {
+ return true;
+ }
+ }
+
+ /*
+ * Overridden in order to implement AttributesCompartmentContainer.
+ */
+ public void setAttributesVisible(boolean visible) {
+ if (getAssociationClass() != null) {
+ getAssociationClass().setAttributesVisible(visible);
+ }
+ }
+
+ /*
+ * Overridden in order to implement PathCompartmentContainer.
+ */
+ public boolean isPathVisible() {
+ if (getAssociationClass() != null) {
+ return getAssociationClass().isPathVisible();
+ } else {
+ return false;
+ }
+ }
+
+ /*
+ * Overridden in order to implement PathCompartmentContainer.
+ */
+ public void setPathVisible(boolean visible) {
+ if (getAssociationClass() != null) {
+ getAssociationClass().setPathVisible(visible);
+ }
+ }
+
+ /*
+ * Overridden in order to implement OperationsCompartmentContainer.
+ */
+ public Rectangle getOperationsBounds() {
+ if (getAssociationClass() != null) {
+ return getAssociationClass().getOperationsBounds();
+ } else {
+ return new Rectangle(0, 0, 0, 0);
+ }
+ }
+
+ /*
+ * Overridden in order to implement OperationsCompartmentContainer.
+ */
+ public boolean isOperationsVisible() {
+ if (getAssociationClass() != null) {
+ return getAssociationClass().isOperationsVisible();
+ } else {
+ return true;
+ }
+ }
+
+ /*
+ * Overridden in order to implement OperationsCompartmentContainer.
+ */
+ public void setOperationsVisible(boolean visible) {
+ if (getAssociationClass() != null) {
+ getAssociationClass().setOperationsVisible(visible);
+ }
+ }
+
+ /**
+ * Set fill color of contained FigClassAssociationClass.
+ *
+ * @param color new fill color
+ */
+ @Override
+ public void setFillColor(Color color) {
+ if (getAssociationClass() != null) {
+ getAssociationClass().setFillColor(color);
+ }
+ }
+
+ /**
+ * @return fill color of contained FigClassAssociationClass.
+ */
+ @Override
+ public Color getFillColor() {
+ if (getAssociationClass() != null) {
+ return getAssociationClass().getFillColor();
+ } else {
+ return FILL_COLOR;
+ }
+ }
+
+ /**
+ * Set line color of contained FigClassAssociationClass.
+ *
+ * @param arg0 new line color
+ */
+ @Override
+ public void setLineColor(Color arg0) {
+ super.setLineColor(arg0);
+ if (getAssociationClass() != null) {
+ getAssociationClass().setLineColor(arg0);
+ }
+ if (getFigEdgeAssociationClass() != null) {
+ getFigEdgeAssociationClass().setLineColor(arg0);
+ }
+ }
+
+ /**
+ * Gets FigClassAssociationClass that is contained in this
+ * FigAssociationClass.
+ *
+ * @return FigClassAssociationClass that is contained in this
+ * FigAssociationClass.
+ */
+ public FigClassAssociationClass2 getAssociationClass() {
+ FigEdgeAssociationClass2 figEdgeLink = null;
+ List edges = null;
+
+ FigEdgePort figEdgePort = this.getEdgePort();
+ if (figEdgePort != null) {
+ edges = figEdgePort.getFigEdges();
+ }
+
+ if (edges != null) {
+ for (Iterator it = edges.iterator(); it.hasNext()
+ && figEdgeLink == null;) {
+ Object o = it.next();
+ if (o instanceof FigEdgeAssociationClass2) {
+ figEdgeLink = (FigEdgeAssociationClass2) o;
+ }
+ }
+ }
+
+ FigNode figClassBox = null;
+ if (figEdgeLink != null) {
+ figClassBox = figEdgeLink.getDestFigNode();
+ if (!(figClassBox instanceof FigClassAssociationClass2)) {
+ figClassBox = figEdgeLink.getSourceFigNode();
+ }
+ }
+ return (FigClassAssociationClass2) figClassBox;
+ }
+
+ /**
+ * Gets FigEdgeAssociationClass that is contained in this
+ * FigAssociationClass.
+ *
+ * @return FigEdgeAssociationClass that is contained in this
+ * FigAssociationClass
+ */
+ public FigEdgeAssociationClass2 getFigEdgeAssociationClass() {
+ FigEdgeAssociationClass2 figEdgeLink = null;
+ List edges = null;
+
+ FigEdgePort figEdgePort = this.getEdgePort();
+ if (figEdgePort != null) {
+ edges = figEdgePort.getFigEdges();
+ }
+
+ if (edges != null) {
+ for (Iterator it = edges.iterator(); it.hasNext()
+ && figEdgeLink == null;) {
+ Object o = it.next();
+ if (o instanceof FigEdgeAssociationClass2) {
+ figEdgeLink = (FigEdgeAssociationClass2) o;
+ }
+ }
+ }
+
+ return figEdgeLink;
+ }
+}
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociationEnd2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociationEnd2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigAssociationEnd2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,53 @@
+// $Id: FigAssociationEnd.java 17045 2009-04-05 16:52:52Z mvw $
+// Copyright (c) 2005-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
+// 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.class2.diagram;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.FigAssociationEnd;
+
+/**
+ * Class to display graphics for N-ary association edges (association ends).<p>
+ *
+ * This class represents an association End Fig on a diagram,
+ * i.e. the line between the diamond and a node (like a class). <p>
+ *
+ * The direction of the lines is from the diamond outwards,
+ * hence the destination is the side of the classifier,
+ * where the labels are shown. <p>
+ *
+ * There is no support for arrows indicating navigability. <p>
+ *
+ * Showing qualifiers or aggregation is not permitted
+ * according the UML 1.4.2 standard.
+ *
+ * @author Bob Tarling
+ */
+public class FigAssociationEnd2 extends FigAssociationEnd {
+
+ public FigAssociationEnd2(Object owner, DiagramSettings settings) {
+ super(owner, settings);
+ }
+
+}
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigClassAssociationClass2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigClassAssociationClass2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigClassAssociationClass2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,72 @@
+// $Id: FigClassAssociationClass.java 17045 2009-04-05 16:52:52Z mvw $
+// 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
+// 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.class2.diagram;
+
+import java.awt.Rectangle;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.tigris.gef.presentation.Fig;
+
+/**
+ * Class to display the Class box fig piece of an Association Class.
+ * <em>NOTE:</em> It must be used only from a FigAssociationClass
+ *
+ * @author pepargouml
+ */
+public class FigClassAssociationClass2 extends FigClass2 {
+
+ private static final long serialVersionUID = -4101337246957593739L;
+
+ /**
+ * Construct the Class box piece of a complex association class fig.
+ *
+ * @param owner owning model element
+ * @param bounds position and size
+ * @param settings rendering settings
+ */
+ public FigClassAssociationClass2(Object owner, Rectangle bounds,
+ DiagramSettings settings) {
+ super(owner, bounds, settings);
+ enableSizeChecking(true);
+ }
+
+ protected Fig getRemoveDelegate() {
+ // Look for the dashed edge
+ for (Object fig : getFigEdges()) {
+ if (fig instanceof FigEdgeAssociationClass2) {
+ // We have the dashed edge now find the opposite FigNode
+ FigEdgeAssociationClass2 dashedEdge =
+ (FigEdgeAssociationClass2) fig;
+ return dashedEdge.getRemoveDelegate();
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected void removeFromDiagramImpl() {
+ super.removeFromDiagramImpl();
+ }
+}
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigDependency2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigDependency2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigDependency2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,128 @@
+// $Id: FigDependency.java 17045 2009-04-05 16:52:52Z mvw $
+// 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
+// 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.class2.diagram;
+
+import java.awt.Color;
+
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.FigEdgeModelElement;
+import org.argouml.uml.diagram.ui.FigTextGroup;
+import org.argouml.uml.diagram.ui.PathItemPlacement;
+import org.tigris.gef.presentation.ArrowHead;
+import org.tigris.gef.presentation.ArrowHeadGreater;
+import org.tigris.gef.presentation.Fig;
+
+/**
+ * This class represents a Fig for a Dependency.
+ * It has a dashed line and a V-shaped arrow-head.
+ *
+ * @author ics 125b course, spring 1998
+ */
+public class FigDependency2 extends FigEdgeModelElement {
+
+ /**
+ * Serial version generated by Eclipse for rev. 1.22
+ */
+ private static final long serialVersionUID = -1779182458484724448L;
+
+ /*
+ * Text group to contain name & stereotype
+ */
+ private FigTextGroup middleGroup;
+
+ private void constructFigs() {
+ middleGroup.addFig(getNameFig());
+ middleGroup.addFig(getStereotypeFig());
+ addPathItem(middleGroup,
+ new PathItemPlacement(this, middleGroup, 50, 25));
+
+ setDestArrowHead(createEndArrow());
+
+ setBetweenNearestPoints(true);
+ getFig().setDashed(true);
+ }
+
+ /**
+ * Create the arrow head for the dependency. By default this is a
+ * stick figure arrow head with no fill. Descendants may override this as
+ * required.
+ * @return the arrow head.
+ */
+ protected ArrowHead createEndArrow() {
+ return new ArrowHeadGreater();
+ }
+
+ /**
+ * Construct a FigDependency.
+ *
+ * @param owner owning UML Dependency
+ * @param settings render settings
+ */
+ public FigDependency2(Object owner, DiagramSettings settings) {
+ super(owner, settings);
+ middleGroup = new FigTextGroup(owner, settings);
+ constructFigs();
+ }
+
+ /*
+ * @see org.tigris.gef.presentation.FigEdge#setFig(org.tigris.gef.presentation.Fig)
+ */
+ @Override
+ public void setFig(Fig f) {
+ super.setFig(f);
+ getFig().setDashed(true);
+ // computeRoute();
+ // this recomputes the route if you reload the diagram.
+ }
+
+ /*
+ * @see org.argouml.uml.diagram.ui.FigEdgeModelElement#canEdit(org.tigris.gef.presentation.Fig)
+ */
+ @Override
+ protected boolean canEdit(Fig f) {
+ return false;
+ }
+
+ public void setLineColor(Color color) {
+ ArrowHead arrow = getDestArrowHead();
+ if (arrow != null) {
+ arrow.setLineColor(getLineColor());
+ }
+ }
+
+ @Override
+ protected void updateNameText() {
+ super.updateNameText();
+ middleGroup.calcBounds();
+ }
+
+ @Override
+ protected void updateStereotypeText() {
+ super.updateStereotypeText();
+ middleGroup.calcBounds();
+ }
+
+}
+
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigEdgeAssociationClass2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigEdgeAssociationClass2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigEdgeAssociationClass2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,214 @@
+// $Id: FigEdgeAssociationClass.java 17050 2009-04-06 16:55:59Z mvw $
+// 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
+// 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.class2.diagram;
+
+import java.awt.event.KeyListener;
+import java.awt.event.MouseListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.beans.VetoableChangeListener;
+
+import org.apache.log4j.Logger;
+import org.argouml.kernel.DelayedVChangeListener;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.FigEdgeModelElement;
+import org.argouml.uml.diagram.ui.FigEdgePort;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigNode;
+
+
+/**
+ * Class to display the dashed line connecting the class box figure and the
+ * association line pieces of a composite Association Class group. This should
+ * not be confused with the primary edge that forms the Association. That is
+ * {@link FigAssociationClass2}.
+ * <em>NOTE:</em> It must be used only from a FigAssociationClass.
+ *
+ * @author pepargouml
+ */
+public class FigEdgeAssociationClass2
+ extends FigEdgeModelElement
+ implements VetoableChangeListener,
+ DelayedVChangeListener,
+ MouseListener,
+ KeyListener,
+ PropertyChangeListener {
+
+ /**
+ * Serial version generated by Eclipse for rev 1.9
+ */
+ private static final long serialVersionUID = 4627163341288968877L;
+
+ private static final Logger LOG =
+ Logger.getLogger(FigEdgeAssociationClass2.class);
+
+ private void constructFigs(FigClassAssociationClass2 classBoxFig,
+ Fig ownerFig) {
+ LOG.info("FigEdgeAssociationClass constructor");
+ if (classBoxFig == null) {
+ throw new IllegalArgumentException("No class box found while "
+ + "creating FigEdgeAssociationClass");
+ }
+ if (ownerFig == null) {
+ throw new IllegalArgumentException("No association edge found "
+ + "while creating FigEdgeAssociationClass");
+ }
+ setDestFigNode(classBoxFig);
+ setDestPortFig(classBoxFig);
+ final FigNode port;
+ if (ownerFig instanceof FigEdgeModelElement) {
+ ((FigEdgeModelElement) ownerFig).makeEdgePort();
+ port = ((FigEdgeModelElement) ownerFig).getEdgePort();
+ } else {
+ port = (FigNode) ownerFig;
+ }
+ setSourcePortFig(port);
+ setSourceFigNode(port);
+ computeRoute();
+ }
+
+ /**
+ * The constructor for the AssociationClass fig.
+ *
+ * @param classBoxFig the figure representing the Class
+ * @param ownerFig the owner fig
+ * @param settings render settings
+ */
+ FigEdgeAssociationClass2(FigClassAssociationClass2 classBoxFig,
+ FigAssociationClass2 ownerFig, DiagramSettings settings) {
+ super(ownerFig.getOwner(), settings);
+ constructFigs(classBoxFig, ownerFig);
+ }
+
+ /**
+ * The constructor for the AssociationClass fig.
+ *
+ * @param classBoxFig the figure representing the Class
+ * @param ownerFig the owner fig
+ * @param settings render settings
+ */
+ public FigEdgeAssociationClass2(FigClassAssociationClass2 classBoxFig,
+ FigNodeAssociation2 ownerFig, DiagramSettings settings) {
+ super(ownerFig.getOwner(), settings);
+ constructFigs(classBoxFig, ownerFig);
+ }
+
+ /**
+ * @param owner the owner
+ * @param settings the render settings
+ */
+ public FigEdgeAssociationClass2(Object owner,
+ DiagramSettings settings) {
+ super(owner, settings);
+ setBetweenNearestPoints(true);
+ }
+
+ /*
+ * @see org.tigris.gef.presentation.FigEdge#setFig(org.tigris.gef.presentation.Fig)
+ */
+ @Override
+ public void setFig(Fig f) {
+ super.setFig(f);
+ getFig().setDashed(true);
+ }
+
+ /*
+ * @see org.argouml.uml.diagram.ui.FigEdgeModelElement#canEdit(org.tigris.gef.presentation.Fig)
+ */
+ @Override
+ protected boolean canEdit(Fig f) {
+ return false;
+ }
+
+ /*
+ * @see org.argouml.uml.diagram.ui.FigEdgeModelElement#modelChanged(java.beans.PropertyChangeEvent)
+ */
+ @Override
+ protected void modelChanged(PropertyChangeEvent e) {
+ // TODO: are we intentionally eating all events? - tfm 20060203
+ // document!
+ }
+
+ /**
+ * If the user requests deletion of this Fig then delegate to the attached
+ * FigAssociationClass.
+ * @return the attached FigAssociationClass
+ */
+ @Override
+ protected Fig getRemoveDelegate() {
+ FigNode node = getDestFigNode();
+ if (!(node instanceof FigEdgePort || node instanceof FigNodeAssociation2)) {
+ node = getSourceFigNode();
+ }
+ if (!(node instanceof FigEdgePort || node instanceof FigNodeAssociation2)) {
+ LOG.warn("The is no FigEdgePort attached"
+ + " to the association class link");
+ return null;
+ }
+
+ final Fig delegate;
+ // Actually return the FigEdge that the FigEdgePort is part of.
+ if (node instanceof FigEdgePort) {
+ delegate = node.getGroup();
+ } else {
+ delegate = node;
+ }
+ if (LOG.isInfoEnabled()) {
+ LOG.info("Delegating remove to " + delegate.getClass().getName());
+// throw new IllegalArgumentException();
+ }
+ return delegate;
+ }
+
+
+ @Override
+ public void setDestFigNode(FigNode fn) {
+ if (!(fn instanceof FigClassAssociationClass2)) {
+ throw new IllegalArgumentException(
+ "The dest of an association class dashed link can "
+ + "only be a FigClassAssociationClass");
+ }
+ super.setDestFigNode(fn);
+ }
+
+ @Override
+ public void setSourceFigNode(FigNode fn) {
+ if (!(fn instanceof FigEdgePort || fn instanceof FigNodeAssociation2)) {
+ throw new IllegalArgumentException(
+ "The source of an association class dashed link can "
+ + "only be a FigEdgePort");
+ }
+ super.setSourceFigNode(fn);
+ }
+
+ @Override
+ protected void removeFromDiagramImpl() {
+ // TODO Auto-generated method stub
+ super.removeFromDiagramImpl();
+ }
+
+
+
+}
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigGeneralization2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigGeneralization2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigGeneralization2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,208 @@
+// $Id: FigGeneralization.java 17046 2009-04-05 17:36:02Z mvw $
+// 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
+// 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.class2.diagram;
+
+import java.awt.Font;
+import java.awt.Graphics;
+import java.awt.Rectangle;
+import java.beans.PropertyChangeEvent;
+
+import org.argouml.model.AttributeChangeEvent;
+import org.argouml.model.Model;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.ArgoFigText;
+import org.argouml.uml.diagram.ui.FigEdgeModelElement;
+import org.argouml.uml.diagram.ui.FigTextGroup;
+import org.argouml.uml.diagram.ui.PathItemPlacement;
+import org.tigris.gef.presentation.ArrowHeadTriangle;
+import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigText;
+
+/**
+ * The Fig for a Generalization.
+ *
+ * @author [email protected], [email protected]
+ */
+public class FigGeneralization2 extends FigEdgeModelElement {
+
+ private static final int TEXT_HEIGHT = 20;
+
+ private static final int DISCRIMINATOR_WIDTH = 90;
+
+ /*
+ * The serialVersionUID (generated by Eclipse)
+ */
+ private static final long serialVersionUID = 3983170503390943894L;
+
+
+ /**
+ * Group for the FigTexts concerning the name and stereotype of the
+ * association itself.
+ */
+ private FigTextGroup middleGroup;
+
+ /**
+ * Text box for discriminator.
+ */
+ private FigText discriminator;
+
+ private ArrowHeadTriangle endArrow;
+
+ private void initialize() {
+ // UML spec for Generalizations doesn't call for name
+
+ discriminator.setFilled(false);
+ discriminator.setLineWidth(0);
+ discriminator.setReturnAction(FigText.END_EDITING);
+ discriminator.setTabAction(FigText.END_EDITING);
+
+ middleGroup.addFig(discriminator);
+ middleGroup.addFig(getStereotypeFig());
+
+ addPathItem(middleGroup,
+ new PathItemPlacement(this, middleGroup, 50, -10));
+
+ endArrow = new ArrowHeadTriangle();
+ endArrow.setFillColor(FILL_COLOR);
+ setDestArrowHead(endArrow);
+
+ setBetweenNearestPoints(true);
+ }
+
+ /**
+ * Construct a new generalization edge with the given model element as the
+ * owner.
+ *
+ * @param owner owning model element
+ * @param settings render settings
+ */
+ public FigGeneralization2(Object owner, DiagramSettings settings) {
+ super(owner, settings);
+ discriminator = new ArgoFigText(owner, new Rectangle(X0, Y0,
+ DISCRIMINATOR_WIDTH, TEXT_HEIGHT), settings, false);
+ middleGroup = new FigTextGroup(owner, settings);
+
+
+ initialize();
+ fixup(owner);
+ addListener(owner);
+ }
+
+ /*
+ * @see org.argouml.uml.diagram.ui.FigEdgeModelElement#canEdit(org.tigris.gef.presentation.Fig)
+ */
+ @Override
+ protected boolean canEdit(Fig f) {
+ return false;
+ }
+
+ /*
+ * @see org.argouml.uml.diagram.ui.FigEdgeModelElement#modelChanged(java.beans.PropertyChangeEvent)
+ */
+ @Override
+ protected void modelChanged(PropertyChangeEvent e) {
+ // Name & stereotypes get updated by superclass
+ super.modelChanged(e);
+ // Update the discriminator if it changed
+ if (e instanceof AttributeChangeEvent
+ && "discriminator".equals(e.getPropertyName())) {
+ updateDiscriminatorText();
+ }
+ }
+
+ /*
+ * @see org.argouml.uml.diagram.ui.FigEdgeModelElement#updateListeners(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ protected void updateListeners(Object oldOwner, Object newOwner) {
+ if (oldOwner != null) {
+ removeElementListener(oldOwner);
+ }
+ if (newOwner != null) {
+ addListener(newOwner);
+ }
+ }
+
+ private void addListener(Object owner) {
+ addElementListener(owner, new String[] {"remove", "discriminator"});
+ }
+
+ /**
+ * Updates the discriminator text. Called if the model is changed
+ * and on construction time.
+ */
+ public void updateDiscriminatorText() {
+ Object generalization = getOwner();
+ if (generalization == null) {
+ return;
+ }
+ String disc =
+ (String) Model.getFacade().getDiscriminator(generalization);
+ if (disc == null) {
+ disc = "";
+ }
+ discriminator.setFont(getSettings().getFont(Font.PLAIN));
+ discriminator.setText(disc);
+ }
+
+ /*
+ * @see org.tigris.gef.presentation.Fig#paint(java.awt.Graphics)
+ */
+ @Override
+ public void paint(Graphics g) {
+ endArrow.setLineColor(getLineColor());
+ super.paint(g);
+ }
+
+ /**
+ * Fix up bad figs.
+ * <p>
+ * Due to errors in earlier releases of argouml it can happen that there is
+ * a generalization without a child or parent.
+ * <p>
+ * TODO: Move into XSL. We should not remove from the graph model while
+ * we're writing to it or we have a possible cause of concurrent
+ * modification exception.
+ *
+ * @param owner
+ */
+ private void fixup(Object owner) {
+ if (Model.getFacade().isAGeneralization(owner)) {
+ Object subType = Model.getFacade().getSpecific(owner);
+ Object superType = Model.getFacade().getGeneral(owner);
+
+ if (subType == null || superType == null) {
+ // TODO: We should warn the user we have removed something - tfm
+ removeFromDiagram();
+ return;
+ }
+ updateDiscriminatorText(); // show it
+ } else if (owner != null) {
+ throw new IllegalStateException(
+ "FigGeneralization has an illegal owner of "
+ + owner.getClass().getName());
+ }
+ }
+}
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigLink2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigLink2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigLink2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,151 @@
+// $Id: FigLink.java 17045 2009-04-05 16:52:52Z mvw $
+// 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
+// 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.class2.diagram;
+
+import org.argouml.model.Model;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.FigEdgeModelElement;
+import org.argouml.uml.diagram.ui.FigTextGroup;
+import org.argouml.uml.diagram.ui.PathItemPlacement;
+import org.tigris.gef.presentation.Fig;
+
+/**
+ * Class to display graphics for a UML Link in a diagram. <p>
+ *
+ * The underlined association name is shown next to the middle of the path.
+ *
+ * TODO: Show more notation as described in the standard:
+ * "A rolename may be shown at each end of the link. An association
+ * name may be shown near the path. If present, it is underlined
+ * to indicate an instance. Links do not have instance names,
+ * they take their identity from the instances that they relate.
+ * Multiplicity is not shown for links because they are instances.
+ * Other association adornments (aggregation, composition,
+ * navigation) may be shown on the link ends."
+ */
+public class FigLink2 extends FigEdgeModelElement {
+
+ /*
+ * Text group to contain name & stereotype
+ */
+ private FigTextGroup middleGroup;
+
+ private void initialize() {
+ middleGroup.addFig(getNameFig());
+ addPathItem(middleGroup,
+ new PathItemPlacement(this, middleGroup, 50, 25));
+ getNameFig().setUnderline(true);
+ getFig().setLineColor(LINE_COLOR);
+ setBetweenNearestPoints(true);
+ }
+
+ /**
+ * Create a Fig representing a Link
+ *
+ * @param element owning UML element
+ * @param settings render settings
+ */
+ public FigLink2(Object element, DiagramSettings settings) {
+ super(element, settings);
+ middleGroup = new FigTextGroup(element, settings);
+ initialize();
+ }
+
+ /*
+ * Nothing is editable, since a Link takes its identity
+ * from the Association.
+ *
+ * @see org.argouml.uml.diagram.ui.FigEdgeModelElement#canEdit(
+ * org.tigris.gef.presentation.Fig)
+ */
+ protected boolean canEdit(Fig f) { return false; }
+
+ /*
+ * Listen also to the association, of which the link is an instantiation,
+ * since we want to update the rendering when
+ * the association name changes.
+ *
+ * @see org.argouml.uml.diagram.ui.FigEdgeModelElement#updateListeners(
+ * java.lang.Object, java.lang.Object)
+ */
+ protected void updateListeners(Object oldOwner, Object newOwner) {
+ if (oldOwner != null) {
+ removeElementListener(oldOwner);
+ Object oldAssociation = Model.getFacade().getAssociation(oldOwner);
+ if (oldAssociation != null) {
+ removeElementListener(oldAssociation);
+ }
+ }
+ if (newOwner != null) {
+ addElementListener(newOwner,
+ new String[] {"remove", "name", "association"});
+ Object newAssociation = Model.getFacade().getAssociation(newOwner);
+ if (newAssociation != null) {
+ addElementListener(newAssociation, "name");
+ }
+ }
+ }
+
+ /**
+ * Generate the notation for the modelelement and stuff it into the text Fig
+ */
+ protected void updateNameText() {
+ if (getOwner() == null) {
+ return;
+ }
+ String nameString = "";
+ Object association = Model.getFacade().getAssociation(getOwner());
+ if (association != null) {
+ nameString = Model.getFacade().getName(association);
+ if (nameString == null) {
+ nameString = "";
+ }
+ }
+ getNameFig().setText(nameString);
+ calcBounds();
+ setBounds(getBounds());
+ }
+
+ /*
+ * @see org.argouml.uml.diagram.ui.FigEdgeModelElement#getDestination()
+ */
+ protected Object getDestination() {
+ if (getOwner() != null) {
+ return Model.getCommonBehaviorHelper().getDestination(getOwner());
+ }
+ return null;
+ }
+
+ /*
+ * @see org.argouml.uml.diagram.ui.FigEdgeModelElement#getSource()
+ */
+ protected Object getSource() {
+ if (getOwner() != null) {
+ return Model.getCommonBehaviorHelper().getSource(getOwner());
+ }
+ return null;
+ }
+
+} /* end class FigLink */
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigNodeAssociation2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigNodeAssociation2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigNodeAssociation2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,339 @@
+// $Id: FigNodeAssociation.java 17045 2009-04-05 16:52:52Z mvw $
+// Copyright (c) 2005-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
+// 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.class2.diagram;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Rectangle;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.argouml.model.Model;
+import org.argouml.model.RemoveAssociationEvent;
+import org.argouml.model.UmlChangeEvent;
+import org.argouml.uml.diagram.DiagramSettings;
+import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.tigris.gef.base.LayerPerspective;
+import org.tigris.gef.graph.GraphEdgeRenderer;
+import org.tigris.gef.graph.MutableGraphModel;
+import org.tigris.gef.presentation.FigDiamond;
+import org.tigris.gef.presentation.FigEdge;
+import org.tigris.gef.presentation.FigNode;
+import org.tigris.gef.presentation.FigText;
+
+/**
+ * Class to display graphics for N-ary association (association node),
+ * i.e. the diamond. <p>
+ *
+ * TODO: Improve the location of the stereotypes!
+ *
+ * @author [email protected]
+ */
+public class FigNodeAssociation2 extends FigNodeModelElement {
+
+ private static final int X = 0;
+ private static final int Y = 0;
+
+ private FigDiamond head;
+
+ private void initFigs() {
+ setEditable(false);
+ setBigPort(new FigDiamond(0, 0, 70, 70, DEBUG_COLOR, DEBUG_COLOR));
+ head = new FigDiamond(0, 0, 70, 70, LINE_COLOR, FILL_COLOR);
+
+ getNameFig().setFilled(false);
+ getNameFig().setLineWidth(0);
+// The following does not seem to work - centered the Fig instead.
+// getNameFig().setJustificationByName("center");
+
+ getStereotypeFig().setBounds(X + 10, Y + NAME_FIG_HEIGHT + 1,
+ 0, NAME_FIG_HEIGHT);
+ getStereotypeFig().setFilled(false);
+ getStereotypeFig().setLineWidth(0);
+
+ // add Figs to the FigNode in back-to-front order
+ addFig(getBigPort());
+ addFig(head);
+ if (!Model.getFacade().isAAssociationClass(getOwner())) {
+ addFig(getNameFig());
+ addFig(getStereotypeFig());
+ }
+
+ setBlinkPorts(false); //make port invisible unless mouse enters
+ Rectangle r = getBounds();
+ setBounds(r);
+ setResizable(true);
+ }
+
+ /**
+ * Construct a new FigNodeAssociation.
+ *
+ * @param owner owning UML element
+ * @param bounds position and size
+ * @param settings render settings
+ */
+ public FigNodeAssociation2(Object owner, Rectangle bounds,
+ DiagramSettings settings) {
+ super(owner, bounds, settings);
+ initFigs();
+ }
+
+ /*
+ * @see java.lang.Object#clone()
+ */
+ @Override
+ public Object clone() {
+ FigNodeAssociation2 figClone = (FigNodeAssociation2) super.clone();
+ Iterator it = figClone.getFigs().iterator();
+ figClone.setBigPort((FigDiamond) it.next());
+ figClone.head = (FigDiamond) it.next();
+ figClone.setNameFig((FigText) it.next());
+ return figClone;
+ }
+
+
+ /**
+ * Called when a model event is received from model subsystem.
+ * handles when a n-ary association becomes a binary association.
+ *
+ * @param mee the event
+ */
+ @Override
+ protected void updateLayout(UmlChangeEvent mee) {
+ super.updateLayout(mee);
+ if (mee.getSource() == getOwner()
+ && mee instanceof RemoveAssociationEvent
+ && "connection".equals(mee.getPropertyName())
+ && Model.getFacade().getConnections(getOwner()).size() == 2) {
+ reduceToBinary();
+ }
+ }
+
+ /**
+ * Called when deletion of an association end reduces the number of ends
+ * of an association down to only two. This Fig which represent the diamond
+ * node of a n-ary association needs to be replaced by a FigAssociation
+ * representing the binary relationship.
+ */
+ private void reduceToBinary() {
+ final Object association = getOwner();
+ assert (Model.getFacade().getConnections(association).size() == 2);
+
+ // Detach any non-associationend edges (such as comment edges) already
+ // attached before this association node is removed.
+ // They'll later be re-attached to the new FigAssociation
+ final Collection<FigEdge> existingEdges = getEdges();
+ for (Iterator<FigEdge> it = existingEdges.iterator(); it.hasNext(); ) {
+ FigEdge edge = it.next();
+ if (edge instanceof FigAssociationEnd2) {
+ it.remove();
+ } else {
+ removeFigEdge(edge);
+ }
+ }
+
+ // Now we can remove ourself (which will also remove the
+ // attached association ends edges)
+ final LayerPerspective lay = (LayerPerspective) getLayer();
+ final MutableGraphModel gm = (MutableGraphModel) lay.getGraphModel();
+ gm.removeNode(association);
+ removeFromDiagram();
+
+ // Create the new FigAssociation edge to replace the node
+ final GraphEdgeRenderer renderer =
+ lay.getGraphEdgeRenderer();
+ final FigAssociation2 figEdge = (FigAssociation2) renderer.getFigEdgeFor(
+ gm, lay, association, null);
+ lay.add(figEdge);
+ gm.addEdge(association);
+
+ // Add the non-associationend edges (such as comment edges) that were
+ // originally attached to this and attach them to the new
+ // FigAssociation and make sure they are positioned correctly.
+ for (FigEdge edge : existingEdges) {
+ figEdge.makeEdgePort();
+ if (edge.getDestFigNode() == this) {
+ edge.setDestFigNode(figEdge.getEdgePort());
+ edge.setDestPortFig(figEdge.getEdgePort());
+ }
+ if (edge.getSourceFigNode() == this) {
+ edge.setSourceFigNode(figEdge.getEdgePort());
+ edge.setSourcePortFig(figEdge.getEdgePort());
+ }
+ }
+ figEdge.computeRoute();
+ }
+
+ /*
+ * Makes sure that the edges stick to the outline of the fig.
+ * @see org.tigris.gef.presentation.Fig#getGravityPoints()
+ */
+ @Override
+ public List getGravityPoints() {
+ return getBigPort().getGravityPoints();
+ }
+
+ /*
+ * @see org.tigris.gef.presentation.Fig#setLineColor(java.awt.Color)
+ */
+ @Override
+ public void setLineColor(Color col) {
+ head.setLineColor(col);
+ }
+
+ /*
+ * @see org.tigris.gef.presentation.Fig#getLineColor()
+ */
+ @Override
+ public Color getLineColor() {
+ return head.getLineColor();
+ }
+
+ /*
+ * @see org.tigris.gef.presentation.Fig#setFillColor(java.awt.Color)
+ */
+ @Override
+ public void setFillColor(Color col) {
+ head.setFillColor(col);
+ }
+
+ /*
+ * @see org.tigris.gef.presentation.Fig#getFillColor()
+ */
+ @Override
+ public Color getFillColor() {
+ return head.getFillColor();
+ }
+
+ /*
+ * @see org.tigris.gef.presentation.Fig#setFilled(boolean)
+ */
+ @Override
+ public void setFilled(boolean f) {
+ }
+
+ @Override
+ public boolean isFilled() {
+ return true;
+ }
+
+ /*
+ * @see org.tigris.gef.presentation.Fig#setLineWidth(int)
+ */
+ @Override
+ public void setLineWidth(int w) {
+ head.setLineWidth(w);
+ }
+
+ /*
+ * @see org.tigris.gef.presentation.Fig#getLineWidth()
+ */
+ @Override
+ public int getLineWidth() {
+ return head.getLineWidth();
+ }
+
+ @Override
+ protected void setStandardBounds(int x, int y, int w, int h) {
+ Rectangle oldBounds = getBounds();
+
+ Rectangle nm = getNameFig().getBounds();
+ /* Center the NameFig, since center justification
+ * does not seem to work. */
+ getNameFig().setBounds(x + (w - nm.width) / 2,
+ y + h / 2 - nm.height / 2,
+ nm.width, nm.height);
+ // TODO: Replace magic numbers with constants
+ if (getStereotypeFig().isVisible()) {
+ /* TODO: Test this. */
+ getStereotypeFig().setBounds(x, y + h / 2 - 20, w, 15);
+ int stereotypeHeight = getStereotypeFig().getMinimumSize().height;
+ getStereotypeFig().setBounds(
+ x,
+ y,
+ w,
+ stereotypeHeight);
+ }
+
+ head.setBounds(x, y, w, h);
+ getBigPort().setBounds(x, y, w, h);
+
+ calcBounds(); //_x = x; _y = y; _w = w; _h = h;
+ firePropChange("bounds", oldBounds, getBounds());
+ updateEdges();
+ }
+
+ @Override
+ public Dimension getMinimumSize() {
+ Dimension aSize = getNameFig().getMinimumSize();
+ if (getStereotypeFig().isVisible()) {
+ Dimension stereoMin = getStereotypeFig().getMinimumSize();
+ aSize.width = Math.max(aSize.width, stereoMin.width);
+ aSize.height += stereoMin.height;
+ }
+ aSize.width = Math.max(70, aSize.width);
+ int size = Math.max(aSize.width, aSize.height);
+ aSize.width = size;
+ aSize.height = size;
+
+ return aSize;
+ }
+
+
+ /**
+ * Remove entire composite Fig from Diagram. Discover the attached
+ * FigEdgeAssociationClass and the FigClassAssociationClass attached to
+ * that. Remove them from the diagram before removing this.
+ */
+ @Override
+ protected void removeFromDiagramImpl() {
+ FigEdgeAssociationClass2 figEdgeLink = null;
+ final List edges = getFigEdges();
+
+ if (edges != null) {
+ for (Iterator it = edges.iterator(); it.hasNext()
+ && figEdgeLink == null;) {
+ Object o = it.next();
+ if (o instanceof FigEdgeAssociationClass2) {
+ figEdgeLink = (FigEdgeAssociationClass2) o;
+ }
+ }
+ }
+
+ if (figEdgeLink != null) {
+ FigNode figClassBox = figEdgeLink.getDestFigNode();
+ if (!(figClassBox instanceof FigClassAssociationClass2)) {
+ figClassBox = figEdgeLink.getSourceFigNode();
+ }
+ figEdgeLink.removeFromDiagramImpl();
+ ((FigClassAssociationClass2) figClassBox).removeFromDiagramImpl();
+ }
+
+ super.removeFromDiagramImpl();
+ }
+
+}
+
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigPermission2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigPermission2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigPermission2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,53 @@
+// $Id: FigPermission.java 17045 2009-04-05 16:52:52Z mvw $
+// 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
+// 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.class2.diagram;
+
+import org.argouml.uml.diagram.DiagramSettings;
+
+/**
+ * The Fig for a permission, which is a form of dependency.
+ * <p>
+ * TODO: In UML 2.x, the import and access Permissions have become
+ * PackageImports with public visibility and non-public visibility respectively.
+ * (ArgoUML only supports the <<import>> Permission currently). The friend
+ * Permission has been dropped. Also the type hierarchy has been reorganized so
+ * that PackageImport is not a subtype of Dependency.
+ *
+ * @author Markus Klink
+ */
+public class FigPermission2 extends FigDependency2 {
+
+ /**
+ * Construct a Fig.
+ *
+ * @param owner owning UML element
+ * @param settings render settings
+ */
+ public FigPermission2(Object owner, DiagramSettings settings) {
+ super(owner, settings);
+ }
+
+}
+
Added: trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigUsage2.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigUsage2.java?view=markup&pathrev=17209
==============================================================================
--- (empty file)
+++ trunk/src/argouml-core-diagrams-class2/src/org/argouml/class2/diagram/FigUsage2.java 2009-08-02 03:30:20-0700
@@ -0,0 +1,47 @@
+// $Id: FigUsage.java 17045 2009-04-05 16:52:52Z mvw $
+// 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
+// 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.class2.diagram;
+
+import org.argouml.uml.diagram.DiagramSettings;
+
+/**
+ * This class represents a Fig for a Usage.
+ *
+ * @author Markus Klink
+ */
+public class FigUsage2 extends FigDependency2 {
+
+ /**
+ * Construct a Fig.
+ *
+ * @param owner owning UML element
+ * @param settings render settings
+ */
+ public FigUsage2(Object owner, DiagramSettings settings) {
+ super(owner, settings);
+ }
+
+}
+
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2378602
To unsubscribe from this discussion, e-mail: [[email protected]].