[archstudio-commits] svn commit: r7102 - in /archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu/uci/isr/archstudio4/comp/copypaste: CopyPasteManagerImpl.java CopyPasteMyxComponent.java

archstudio-commits-owner at uci.edu archstudio-commits-owner at uci.edu
Wed May 7 19:53:06 PDT 2008


Author: ssubrama
Date: Wed May  7 19:53:05 2008
New Revision: 7102

Log:
Changes to Copy/Paste functionality to ensure that "Hints" are not duplicat=
ed.

Modified:
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu/uci/i=
sr/archstudio4/comp/copypaste/CopyPasteManagerImpl.java
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu/uci/i=
sr/archstudio4/comp/copypaste/CopyPasteMyxComponent.java

Modified: archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu=
/uci/isr/archstudio4/comp/copypaste/CopyPasteManagerImpl.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu/uci/i=
sr/archstudio4/comp/copypaste/CopyPasteManagerImpl.java (original)
+++ archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu/uci/i=
sr/archstudio4/comp/copypaste/CopyPasteManagerImpl.java Wed May  7 19:53:05=
 2008
@@ -10,6 +10,7 @@
 =

 import edu.uci.isr.archstudio4.comp.relatedelements.IRelatedElement;
 import edu.uci.isr.archstudio4.comp.relatedelements.IRelatedElementsManage=
r;
+import edu.uci.isr.archstudio4.comp.xarchcs.eventmanager.IEventManager;
 import edu.uci.isr.sysutils.UIDGenerator;
 import edu.uci.isr.xarchflat.IXArchPropertyMetadata;
 import edu.uci.isr.xarchflat.IXArchTypeMetadata;
@@ -43,7 +44,9 @@
 =

 =

 	final protected IRelatedElementsManager relatedElementsManager;
-
+	=

+	final protected IEventManager eventManager;
+	=

 	static ObjRef copiedXArchRef =3D null;
 =

 	static ObjRef xArchRef =3D null;
@@ -68,9 +71,10 @@
 =

 	static Object copiedLock =3D new Object();
 =

-	public CopyPasteManagerImpl(XArchFlatInterface xarch, IRelatedElementsMan=
ager relatedElementsManager){
+	public CopyPasteManagerImpl(XArchFlatInterface xarch, IRelatedElementsMan=
ager relatedElementsManager,IEventManager eventManager){
 		this.xarch =3D xarch;
 		this.relatedElementsManager =3D relatedElementsManager;
+		this.eventManager =3D eventManager;
 	}
 =

 	public void copy(ObjRef[] objRefs,ObjRef diagramRef){
@@ -162,6 +166,7 @@
 	=

 	public void paste(ObjRef parentRef,ICopiedElementNode[] nodes){
 		synchronized(copiedLock){
+			eventManager.closeValve();
 			Map<String,ObjRef> oldXArchIDToNewObjRefMap =3D new HashMap<String,ObjR=
ef>();
 			oldXArchIDToNewObjRefMap.putAll(copiedIdObjRefs);
 			oldXArchIDToNewObjRefMap.put(copyContextXArchID,null);
@@ -202,6 +207,7 @@
 					pasteRelatedElements(parentRef,node,oldXArchIDToNewObjRefMap,newIdSuf=
fix);
 				}
 			}
+			eventManager.openValve();
 		}
 	}
 =


Modified: archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu=
/uci/isr/archstudio4/comp/copypaste/CopyPasteMyxComponent.java
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu/uci/i=
sr/archstudio4/comp/copypaste/CopyPasteMyxComponent.java (original)
+++ archstudio4/branches/enhancements/edu.uci.isr.archstudio4/src/edu/uci/i=
sr/archstudio4/comp/copypaste/CopyPasteMyxComponent.java Wed May  7 19:53:0=
5 2008
@@ -1,6 +1,7 @@
 package edu.uci.isr.archstudio4.comp.copypaste;
 =

 import edu.uci.isr.archstudio4.comp.relatedelements.IRelatedElementsManage=
r;
+import edu.uci.isr.archstudio4.comp.xarchcs.eventmanager.IEventManager;
 import edu.uci.isr.myx.fw.AbstractMyxSimpleBrick;
 import edu.uci.isr.myx.fw.IMyxName;
 import edu.uci.isr.myx.fw.MyxUtils;
@@ -10,6 +11,7 @@
 	public static final IMyxName INTERFACE_XARCHCS =3D MyxUtils.createName("x=
archcs");
 	public static final IMyxName INTERFACE_COPY_PASTE =3D MyxUtils.createName=
("copypaste");
 	public static final IMyxName INTERFACE_OUT_RELATEDELEMENTS =3D MyxUtils.c=
reateName("relatedelements");
+	public static final IMyxName INTERFACE_OUT_EVENT_MANAGER =3D MyxUtils.cre=
ateName("eventmanager");
 	=

 	XArchFlatInterface xArch;
 =

@@ -17,12 +19,15 @@
 	=

 	IRelatedElementsManager relatedElementsManager;
 	=

+	IEventManager eventManager;
+	=

 	@Override
 	public void init(){
 		super.init();
 		xArch =3D (XArchFlatInterface)MyxUtils.getFirstRequiredServiceObject(thi=
s, INTERFACE_XARCHCS);
 		relatedElementsManager =3D (IRelatedElementsManager)MyxUtils.getFirstReq=
uiredServiceObject(this, INTERFACE_OUT_RELATEDELEMENTS);
-		copyPasteManager =3D new CopyPasteManagerImpl(xArch,relatedElementsManag=
er);
+		eventManager =3D (IEventManager)MyxUtils.getFirstRequiredServiceObject(t=
his,INTERFACE_OUT_EVENT_MANAGER);
+		copyPasteManager =3D new CopyPasteManagerImpl(xArch,relatedElementsManag=
er,eventManager);
 	}
 =

 	public Object getServiceObject(IMyxName interfaceName){




More information about the archstudio-commits mailing list