[archstudio-commits] svn commit: r7098 - in /archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatedelements/src/edu/uci/isr/archstudio4/comp/relatedelements: ./ processors/

archstudio-commits-owner at uci.edu archstudio-commits-owner at uci.edu
Wed May 7 14:30:32 PDT 2008


Author: ssubrama
Date: Wed May  7 14:30:32 2008
New Revision: 7098

Log:
Changes to Copy/Paste functionality as per Scott's feedback

Modified:
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/IRelatedElement.ja=
va
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/IRelatedElementsPr=
ocessor.java
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
HintedElement.java
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
HintedElementsProcessor.java
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
RationaleElement.java
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
RationaleElementsProcessor.java
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
TypeElement.java
    archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
TypeElementsProcessor.java

Modified: archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.re=
latedelements/src/edu/uci/isr/archstudio4/comp/relatedelements/IRelatedElem=
ent.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.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/IRelatedElement.ja=
va (original)
+++ archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/IRelatedElement.ja=
va Wed May  7 14:30:32 2008
@@ -11,4 +11,5 @@
 	ObjRef getRelatedObjRef();
 	String getDescription();
 	IRelatedElementsProcessor getRelatedElementsProcessor();
+	boolean isDefaultSelection();
 }

Modified: archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.re=
latedelements/src/edu/uci/isr/archstudio4/comp/relatedelements/IRelatedElem=
entsProcessor.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.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/IRelatedElementsPr=
ocessor.java (original)
+++ archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/IRelatedElementsPr=
ocessor.java Wed May  7 14:30:32 2008
@@ -7,6 +7,5 @@
 =

 public interface IRelatedElementsProcessor {
 	List<IRelatedElement> getRelatedElements(ObjRef objRef);
-	ObjRef getTargetReferenceRef(ObjRef targetXArchRef,IRelatedElement relate=
dElement, Map<String,ObjRef> oldXArchIDToNewObjRefMap,String newIdSuffix);
-	public boolean isDefaultSelection();
+	ObjRef getTargetReferenceRef(ObjRef targetXArchRef,ObjRef pasteRef,IRelat=
edElement relatedElement, Map<String,ObjRef> oldXArchIDToNewObjRefMap,Strin=
g newIdSuffix);
 }

Modified: archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.re=
latedelements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/R=
elatedHintedElement.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.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
HintedElement.java (original)
+++ archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
HintedElement.java Wed May  7 14:30:32 2008
@@ -21,12 +21,15 @@
 	=

 	Map<String,String> properties;
 	=

-	public RelatedHintedElement(ObjRef sourceObjRef,ObjRef relatedObjRef,Stri=
ng description,IRelatedElementsProcessor relatedHintElementsProcessor,Map<S=
tring,String> properties) {
+	boolean defaultSelection;
+	=

+	public RelatedHintedElement(ObjRef sourceObjRef,ObjRef relatedObjRef,Stri=
ng description,IRelatedElementsProcessor relatedHintElementsProcessor,Map<S=
tring,String> properties,boolean defaultSelection) {
 		this.sourceObjRef =3D sourceObjRef;
 		this.relatedObjRef =3D relatedObjRef;
 		this.description =3D description;
 		this.relatedHintedElementsProcessor =3D relatedHintElementsProcessor;
 		this.properties =3D properties;
+		this.defaultSelection =3D defaultSelection;
 	}
 	public String getDescription() {
 		return this.description;
@@ -46,5 +49,9 @@
 	=

 	public ObjRef getSourceObjRef() {
 		return this.sourceObjRef;
-	}	=

+	}
+	=

+	public boolean isDefaultSelection() {
+		return defaultSelection;
+	}
 }

Modified: archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.re=
latedelements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/R=
elatedHintedElementsProcessor.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.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
HintedElementsProcessor.java (original)
+++ archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
HintedElementsProcessor.java Wed May  7 14:30:32 2008
@@ -55,7 +55,7 @@
 									}
 								}
 							}						=

-							RelatedHintedElement relatedHintedElement =3D new RelatedHintedElem=
ent(objRef,parentRef,"Hints",this,properties);
+							RelatedHintedElement relatedHintedElement =3D new RelatedHintedElem=
ent(objRef,parentRef,"Hints",this,properties,true);
 							relatedElements.add(relatedHintedElement);
 						}
 					}
@@ -72,7 +72,7 @@
 =

 	}
 =

-	public ObjRef getTargetReferenceRef(ObjRef targetXArchRef,IRelatedElement=
 relatedElement,Map<String,ObjRef> oldXArchIDToNewObjRefMap,String newIdSuf=
fix) {
+	public ObjRef getTargetReferenceRef(ObjRef targetXArchRef,ObjRef pasteRef=
,IRelatedElement relatedElement,Map<String,ObjRef> oldXArchIDToNewObjRefMap=
,String newIdSuffix) {
 		if(relatedElement instanceof RelatedHintedElement) {
 			RelatedHintedElement relatedHintedElement =3D (RelatedHintedElement)rel=
atedElement;
 			ObjRef hintsContextRef =3D xArch.createContext(targetXArchRef, "hints3"=
);
@@ -87,7 +87,7 @@
 				newXArchID =3D (String)xArch.get(newObjRef, "Id") + newIdSuffix;
 			}
 			else {
-				newXArchID =3D oldXArchID;
+				newXArchID =3D (String)xArch.get(pasteRef,"id");
 			}
 			boolean found =3D false;
 			if(hintBundleRefs !=3D null && hintBundleRefs.length > 0) {
@@ -144,8 +144,4 @@
 		}
 		return null;
 	}
-
-	public boolean isDefaultSelection() {
-		return true;
-	}
 }

Modified: archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.re=
latedelements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/R=
elatedRationaleElement.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.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
RationaleElement.java (original)
+++ archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
RationaleElement.java Wed May  7 14:30:32 2008
@@ -17,10 +17,14 @@
 	=

 	IRelatedElementsProcessor relatedRationaleElementsProcessor;
 	=

-	public RelatedRationaleElement(ObjRef sourceObjRef,ObjRef relatedObjRef,S=
tring description) {
+	boolean defaultSelection;
+	=

+	=

+	public RelatedRationaleElement(ObjRef sourceObjRef,ObjRef relatedObjRef,S=
tring description,boolean defaultSelection) {
 		this.relatedObjRef =3D relatedObjRef;
 		this.description =3D description;
 		this.sourceObjRef =3D sourceObjRef;
+		this.defaultSelection =3D defaultSelection;
 	}
 =

 	public String getDescription() {
@@ -42,4 +46,8 @@
 	public ObjRef getTargetReferenceRef(XArchFlatInterface xArch,ObjRef targe=
tXArchRef) {
 		return null;
 	}	=

+	=

+	public boolean isDefaultSelection() {
+		return defaultSelection;
+	}
 }

Modified: archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.re=
latedelements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/R=
elatedRationaleElementsProcessor.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.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
RationaleElementsProcessor.java (original)
+++ archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
RationaleElementsProcessor.java Wed May  7 14:30:32 2008
@@ -30,7 +30,7 @@
 				for(ObjRef reference : references) {
 					ObjRef parentRef =3D xArch.getParent(reference);
 					if(xArch.isInstanceOf(parentRef, "Rationale")) {
-						RelatedRationaleElement relatedRationaleElement =3D new RelatedRatio=
naleElement(objRef,parentRef,"Rationale");
+						RelatedRationaleElement relatedRationaleElement =3D new RelatedRatio=
naleElement(objRef,parentRef,"Rationale",false);
 						relatedElements.add(relatedRationaleElement);
 					}
 				}
@@ -46,11 +46,7 @@
 		=

 	}
 =

-	public ObjRef getTargetReferenceRef(ObjRef targetXArchRef,IRelatedElement=
 relatedElement,Map<String,ObjRef> oldXArchIDToNewObjRefMap,String newIdSuf=
fix) {
+	public ObjRef getTargetReferenceRef(ObjRef targetXArchRef,ObjRef pasteRef=
,IRelatedElement relatedElement,Map<String,ObjRef> oldXArchIDToNewObjRefMap=
,String newIdSuffix) {
 		return null;
-	}
-	=

-	public boolean isDefaultSelection() {
-		return false;
-	}
+	}	=

 }

Modified: archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.re=
latedelements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/R=
elatedTypeElement.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.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
TypeElement.java (original)
+++ archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
TypeElement.java Wed May  7 14:30:32 2008
@@ -21,12 +21,15 @@
 	=

 	Map<String,String> properties;
 	=

-	public RelatedTypeElement(ObjRef sourceObjRef,ObjRef relatedObjRef,String=
 description,IRelatedElementsProcessor relatedTypeElementsProcessor,Map<Str=
ing,String> properties) {
+	boolean defaultSelection;
+	=

+	public RelatedTypeElement(ObjRef sourceObjRef,ObjRef relatedObjRef,String=
 description,IRelatedElementsProcessor relatedTypeElementsProcessor,Map<Str=
ing,String> properties,boolean defaultSelection) {
 		this.sourceObjRef =3D sourceObjRef;
 		this.relatedObjRef =3D relatedObjRef;
 		this.description =3D description;
 		this.relatedTypeElementsProcessor =3D relatedTypeElementsProcessor;
 		this.properties =3D properties;
+		this.defaultSelection =3D defaultSelection;
 	}
 	=

 	public String getDescription() {
@@ -48,4 +51,8 @@
 	public ObjRef getSourceObjRef() {
 		return this.sourceObjRef;
 	}	=

+	=

+	public boolean isDefaultSelection() {
+		return defaultSelection;
+	}
 }

Modified: archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.re=
latedelements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/R=
elatedTypeElementsProcessor.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.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
TypeElementsProcessor.java (original)
+++ archstudio4/branches/enhancements/edu.uci.isr.archstudio4.comp.relatede=
lements/src/edu/uci/isr/archstudio4/comp/relatedelements/processors/Related=
TypeElementsProcessor.java Wed May  7 14:30:32 2008
@@ -33,11 +33,13 @@
 						String id =3D href.replaceFirst("#", "");
 						ObjRef xArchRef =3D xArch.getXArch(objRef);
 						ObjRef objRefType =3D xArch.getByID(xArchRef,id);
-						String description =3D (String)xArch.get((ObjRef)xArch.get(objRefTyp=
e,"Description"),"value");
-						IRelatedElement relatedElement =3D new RelatedTypeElement(objRef,obj=
RefType,description,this,null);
-						List<IRelatedElement> relatedElements =3D new ArrayList<IRelatedElem=
ent>();
-						relatedElements.add(relatedElement);
-						return relatedElements;
+						if(objRefType !=3D null) {
+							String description =3D (String)xArch.get((ObjRef)xArch.get(objRefTy=
pe,"Description"),"value");
+							IRelatedElement relatedElement =3D new RelatedTypeElement(objRef,ob=
jRefType,description,this,null,false);
+							List<IRelatedElement> relatedElements =3D new ArrayList<IRelatedEle=
ment>();
+							relatedElements.add(relatedElement);
+							return relatedElements;
+						}
 					}
 				}
 			}
@@ -45,7 +47,7 @@
 		return null;
 	}
 =

-	public ObjRef getTargetReferenceRef(ObjRef targetXArchRef,
+	public ObjRef getTargetReferenceRef(ObjRef targetXArchRef,ObjRef pasteRef,
 			IRelatedElement relatedElement,Map<String,ObjRef> oldXArchIDToNewObjRef=
Map,String newIdSuffix) {
 =

 		ObjRef contextRef =3D xArch.createContext(targetXArchRef, "types");
@@ -56,8 +58,4 @@
 		}		=

 		return typesElement;
 	}
-
-	public boolean isDefaultSelection() {
-		return false;
-	}
 }




More information about the archstudio-commits mailing list