GraphParticipantInterface gpar = getGraphManager().findParentActivityParticipantForLocation(whereTo, null,
null);
Point partLoc = getGraphManager().getBounds(gpar, null).getBounds().getLocation();
Point off = new Point(whereTo.x - partLoc.x, whereTo.y - partLoc.y);
String partId = gpar.getPropertyObject().get("Id").toValue();
Activities acts = (Activities) getGraph().getXPDLObject().get("Activities");
Activity act = JaWEManager.getInstance().getXPDLObjectFactory().createXPDLObject(acts, subType, false);
GraphUtilities.setOffsetPoint(act, off);
GraphUtilities.setParticipantId(act, partId);
int acttype = act.getActivityType();
if (acttype == XPDLConstants.ACTIVITY_TYPE_NO || acttype == XPDLConstants.ACTIVITY_TYPE_TOOL) {
if (!partId.equals(FreeTextExpressionParticipant.getInstance().getId())) {
act.setPerformer(partId);
}
}
graphController.setUpdateInProgress(true);
JaWEManager.getInstance().getJaWEController().startUndouableChange();
acts.add(act);
getGraphManager().insertActivity(act);
List toSelect = new ArrayList();
toSelect.add(act);
JaWEManager.getInstance().getJaWEController().endUndouableChange(toSelect);
getGraph().selectActivity(act, false);