Community
Participate
Working Groups
- Create a Circuit - Create a wire from top terminal to bottom terminal Result: - Duplicate wires appear. Note: - Probably some something to do with the ToggleCanonical
Moving to the next release, GMF 2.1.
This is probably an issue in CircuitCompartmentCanonicalEditPolicy. Connections between pins on different circuits are found as compartment semantic children but not found as notational children. If this is the case then we should either not append such connections to the list of semantic childern or should be able to append such connections' views to the list of notational children.
Created attachment 79402 [details] Proposed Patch Added a check to determine if wire came and ended to the same source, in the getSemanticCommenctionsList(). if this checked evaluated to true, do not add the wire, since it is not a semantic connection.
Comment on attachment 79402 [details] Proposed Patch >### Eclipse Workspace Patch 1.0 >#P org.eclipse.gmf.examples.runtime.diagram.logic >Index: src/org/eclipse/gmf/examples/runtime/diagram/logic/internal/editpolicies/CircuitCompartmentCanonicalEditPolicy.java >=================================================================== >RCS file: /cvsroot/modeling/org.eclipse.gmf/examples/org.eclipse.gmf.examples.runtime.diagram.logic/src/org/eclipse/gmf/examples/runtime/diagram/logic/internal/editpolicies/CircuitCompartmentCanonicalEditPolicy.java,v >retrieving revision 1.8 >diff -u -r1.8 CircuitCompartmentCanonicalEditPolicy.java >--- src/org/eclipse/gmf/examples/runtime/diagram/logic/internal/editpolicies/CircuitCompartmentCanonicalEditPolicy.java 3 Oct 2006 14:40:40 -0000 1.8 >+++ src/org/eclipse/gmf/examples/runtime/diagram/logic/internal/editpolicies/CircuitCompartmentCanonicalEditPolicy.java 27 Sep 2007 20:15:12 -0000 >@@ -70,20 +70,27 @@ > ListIterator li = allChildren.listIterator(); > UniqueEList wires = new UniqueEList(); > while (li.hasNext()) { >- Object obj = li.next(); >+ Object obj = li.next(); > if (obj instanceof Wire) { >- Wire wire = (Wire)obj; >+ Wire wire = (Wire)obj; > if (isWirePartOfContainer(circuitElement, wire)) >- wires.add(wire); >+ //checks if the wire maps to the same circuit >+ if (wire.getSource().eContainer().equals(circuitElement) >+ && (wire.getTarget().eContainer().equals(circuitElement))){ >+ // do nothing >+ } >+ else{ >+ wires.add(wire); >+ } > } >- } >- >+ } > return wires; > } > > private boolean isWirePartOfContainer(Circuit circuitElement, Wire wire) { > if (EcoreUtil.isAncestor(circuitElement, wire.getSource()) && > EcoreUtil.isAncestor(circuitElement, wire.getTarget())) {> > return true; > } > else { >@@ -91,6 +98,7 @@ > EcoreUtil.isAncestor(circuitElement, wire.getSource().eContainer())) || > (!wire.getTarget().eContainer().equals(circuitElement) && > EcoreUtil.isAncestor(circuitElement, wire.getTarget().eContainer()))) { >+ System.out.println("the other one"); > return true; > } > }
Committed to HEAD (removed the println() :-).
[target cleanup] 2.1 M4 was the original target milestone for this bug
[GMF Restructure] Bug 319140 : product GMF and component Runtime was the original product and component for this bug