private boolean hasMultipleIncommingSequenceFlow(IDiagramElementView view){ IConnectableElement connectable = (IConnectableElement) view; int i = 0; for(IConnector c:connectable.getIncommingConnectors()){ if (c instanceof SequenceFlow){ i++; }else{ return false; } } if (i>1){ return true; } return false; }
private boolean hasOneIncomingSequenceFlow(IDiagramElementView view){ IConnectableElement connectable = (IConnectableElement) view; int i = 0; for(IConnector c:connectable.getIncommingConnectors()){ if (c instanceof SequenceFlow){ i++; }else{ return false; } } if (i==1){ return true; } return false; }
if (connectable.getIncommingConnectors().contains(cp.getConnector())){ connectable.getIncommingConnectors().remove(cp.getConnector()); }else if (connectable.getOutgoingConnectors().contains(cp.getConnector())){ connectable.getOutgoingConnectors().remove(cp.getConnector());
IConnectableElement connectable = (IConnectableElement) uiElement; for(IConnector incomingC:connectable.getIncommingConnectors()){ if (connector.getTarget()!=null) connector.getTarget().getIncommingConnectors().remove(connector);
@Override public void onStart(IDragStartEvent event) { this.getConnector().refresh(); //if current point is already attached => detach it if (this.getConnectedToMagnet()!=null){ this.getConnectedToMagnet().removeConnectorPoint(this); //remove incoming or outgoing connector this.getConnectedToMagnet().getConnectableElement().getIncommingConnectors().remove(this.getConnector()); this.getConnectedToMagnet().getConnectableElement().getOutgoingConnectors().remove(this.getConnector()); this.setConnectedToMagnet(null); if (this instanceof IConnectorStart){ this.getConnector().setSource(null); }else if (this instanceof IConnectorEnd){ this.getConnector().setTarget(null); } } }
connectableElement.getIncommingConnectors().add(cp.getConnector()); cp.getConnector().setTarget(connectableElement);