XMLElement txpdl = t.getPropertyObject();
if (sxpdl instanceof Activity && txpdl instanceof Activity) {
Transitions tras = (Transitions) getGraph().getXPDLObject().get("Transitions");
String fromId = ((Activity) sxpdl).getId();
String toId = ((Activity) txpdl).getId();
Transition tra = JaWEManager.getInstance().getXPDLObjectFactory().createXPDLObject(tras, subType, false);
tra.setFrom(fromId);
tra.setTo(toId);
if (fromId.equals(toId)) {
GraphUtilities.setStyle(tra, GraphEAConstants.EA_JAWE_GRAPH_TRANSITION_STYLE_VALUE_NO_ROUTING_BEZIER);
} else {
GraphUtilities.setStyle(tra, getGraphController().getGraphSettings().getDefaultTransitionStyle());
}
GraphUtilities.setBreakpoints(tra, points);
points.clear();
graphController.setUpdateInProgress(true);
JaWEManager.getInstance().getJaWEController().startUndouableChange();
tras.add(tra);
getGraphManager().insertTransition(tra);
List toSelect = new ArrayList();
toSelect.add(tra);
JaWEManager.getInstance().getJaWEController().endUndouableChange(toSelect);
getGraph().selectTransition(tra, false);
graphController.setUpdateInProgress(false);
} else if (sxpdl instanceof ExtendedAttribute && txpdl instanceof Activity) {
connectStartOrEndBubble((ExtendedAttribute) sxpdl, ((Activity) txpdl).getId());
} else if (txpdl instanceof ExtendedAttribute && sxpdl instanceof Activity) {
connectStartOrEndBubble((ExtendedAttribute) txpdl, ((Activity) sxpdl).getId());
}
return true;
}
// circular
} else {
if (validateConnection(pPort, pPort, null) && points.size() > 0) { // CUSTOM: only allow circular if there is another point
Point realP = (Point) getGraph().fromScreen(new Point(start));
List breakpoints = new ArrayList();
if (points.size() == 0) {
int rp50x1 = realP.x - 50;
int rp50x2 = realP.x + 50;
if (rp50x1 < 0) {
rp50x2 = rp50x2 - rp50x1;
rp50x1 = 0;
}
int rp50y = realP.y - 50;
if (rp50y < 0) {
rp50y = realP.y + 50;
}
breakpoints.add(new Point(Math.abs(rp50x1), Math.abs(rp50y)));
breakpoints.add(new Point(Math.abs(rp50x2), Math.abs(rp50y)));
} else {
breakpoints.addAll(points);
points.clear();
}
Activity act = (Activity) ((GraphPortInterface) firstPort.getCell()).getActivity().getPropertyObject();
Transitions tras = (Transitions) getGraph().getXPDLObject().get("Transitions");
Transition tra = JaWEManager.getInstance().getXPDLObjectFactory().createXPDLObject(tras, subType, false);
tra.setFrom(act.getId());
tra.setTo(act.getId());
GraphUtilities.setStyle(tra, GraphEAConstants.EA_JAWE_GRAPH_TRANSITION_STYLE_VALUE_NO_ROUTING_BEZIER);
GraphUtilities.setBreakpoints(tra, breakpoints);
getGraphController().setUpdateInProgress(true);
JaWEManager.getInstance().getJaWEController().startUndouableChange();
tras.add(tra);