Author: tfmorris
Date: 2007-07-10 13:07:15-0700
New Revision: 13043
Added:
trunk/src_new/org/argouml/uml/diagram/IItemUID.java (contents, props changed)
Modified:
trunk/src_new/org/argouml/persistence/PrivateHandler.java
trunk/src_new/org/argouml/uml/diagram/ArgoDiagramImpl.java
Log:
Introduce interface for objects that support Item UUID methods
Modified: trunk/src_new/org/argouml/persistence/PrivateHandler.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/persistence/PrivateHandler.java?view=diff&rev=13043&p1=trunk/src_new/org/argouml/persistence/PrivateHandler.java&p2=trunk/src_new/org/argouml/persistence/PrivateHandler.java&r1=13042&r2=13043
==============================================================================
--- trunk/src_new/org/argouml/persistence/PrivateHandler.java (original)
+++ trunk/src_new/org/argouml/persistence/PrivateHandler.java 2007-07-10 13:07:15-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
@@ -27,9 +27,7 @@
import org.apache.log4j.Logger;
import org.argouml.cognitive.ItemUID;
-import org.argouml.uml.diagram.ArgoDiagram;
-import org.argouml.uml.diagram.ui.FigEdgeModelElement;
-import org.argouml.uml.diagram.ui.FigNodeModelElement;
+import org.argouml.uml.diagram.IItemUID;
import org.tigris.gef.persistence.pgml.Container;
import org.tigris.gef.persistence.pgml.FigEdgeHandler;
import org.tigris.gef.persistence.pgml.FigGroupHandler;
@@ -78,10 +76,10 @@
if (container instanceof PGMLHandler) {
Object o = getPGMLStackParser().getDiagram();
- if (o instanceof ArgoDiagram) {
+ if (o instanceof IItemUID) {
ItemUID uid = getItemUID(contents);
if (uid != null) {
- ((ArgoDiagram) o).setItemUID(uid);
+ ((IItemUID) o).setItemUID(uid);
}
}
// No other uses of string in PGMLHandler
@@ -90,20 +88,20 @@
if (container instanceof FigGroupHandler) {
Object o = ((FigGroupHandler) container).getFigGroup();
- if (o instanceof FigNodeModelElement) {
+ if (o instanceof IItemUID) {
ItemUID uid = getItemUID(contents);
if (uid != null) {
- ((FigNodeModelElement) o).setItemUID(uid);
+ ((IItemUID) o).setItemUID(uid);
}
}
}
if (container instanceof FigEdgeHandler) {
Object o = ((FigEdgeHandler) container).getFigEdge();
- if (o instanceof FigEdgeModelElement) {
+ if (o instanceof IItemUID) {
ItemUID uid = getItemUID(contents);
if (uid != null) {
- ((FigEdgeModelElement) o).setItemUID(uid);
+ ((IItemUID) o).setItemUID(uid);
}
}
}
Modified: trunk/src_new/org/argouml/uml/diagram/ArgoDiagramImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/ArgoDiagramImpl.java?view=diff&rev=13043&p1=trunk/src_new/org/argouml/uml/diagram/ArgoDiagramImpl.java&p2=trunk/src_new/org/argouml/uml/diagram/ArgoDiagramImpl.java&r1=13042&r2=13043
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/ArgoDiagramImpl.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/ArgoDiagramImpl.java 2007-07-10 13:07:15-0700
@@ -75,7 +75,7 @@
* the namespace of its statemachine.
*/
public abstract class ArgoDiagramImpl extends Diagram
- implements PropertyChangeListener, ArgoDiagram {
+ implements PropertyChangeListener, ArgoDiagram, IItemUID {
private ItemUID id;
@@ -430,7 +430,7 @@
public void setProject(Project p) {
- this.project = p;
+ project = p;
}
protected Project getProject() {
Added: trunk/src_new/org/argouml/uml/diagram/IItemUID.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/IItemUID.java?view=auto&rev=13043
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/uml/diagram/IItemUID.java 2007-07-10 13:07:15-0700
@@ -0,0 +1,50 @@
+// $Id$
+// Copyright (c) 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
+// 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.uml.diagram;
+
+import org.argouml.cognitive.ItemUID;
+
+/**
+ * Interface for objects which implement the getItemUID/setItemUID methods. It
+ * probably would have been better if ItemUID was defined as an interface to
+ * begin with, but that's history now.
+ *
+ * @author Tom Morris <[email protected]>
+ * @since 0.25.4
+ */
+public interface IItemUID {
+
+ /**
+ * Set the item UID.
+ *
+ * @param i the new id
+ */
+ public void setItemUID(ItemUID i);
+
+ /**
+ * @return the item UID
+ */
+ public ItemUID getItemUID();
+}
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.