Point partLoc = getGraphManager().getBounds(gpar, null).getBounds().getLocation();
Point offset = new Point(whereTo.x - partLoc.x, whereTo.y - partLoc.y);
String partId = gpar.getPropertyObject().get("Id").toValue();
graphController.setUpdateInProgress(true);
JaWEManager.getInstance().getJaWEController().startUndouableChange();
ExtendedAttribute ea = GraphUtilities.createStartOrEndExtendedAttribute(getGraph().getXPDLObject(), true, partId, offset, subType,
true);
getGraphManager().insertStart(ea);
List toSelect = new ArrayList();
toSelect.add(ea);
JaWEManager.getInstance().getJaWEController().endUndouableChange(toSelect);
getGraph().selectBubble(ea, false);
graphController.setUpdateInProgress(false);
}
}
// if end button is selected
if (isEndButtonSelected()) {
if (!getGraphManager().doesRootParticipantExist()) {
JaWEFrame frame = JaWEManager.getInstance().getJaWEController().getJaWEFrame();
JOptionPane.showMessageDialog(frame, getGraphController().getSettings().getLanguageDependentString(
"WarningInvalidOperation"), frame.getAppTitle(),
JOptionPane.WARNING_MESSAGE);
} else {
GraphParticipantInterface gpar = getGraphManager().findParentActivityParticipantForLocation(whereTo, null,
null);
Point partLoc = getGraphManager().getBounds(gpar, null).getBounds().getLocation();
Point offset = new Point(whereTo.x - partLoc.x, whereTo.y - partLoc.y);
String partId = gpar.getPropertyObject().get("Id").toValue();
graphController.setUpdateInProgress(true);
JaWEManager.getInstance().getJaWEController().startUndouableChange();
ExtendedAttribute ea = GraphUtilities.createStartOrEndExtendedAttribute(getGraph().getXPDLObject(), false, partId, offset, subType,
true);
getGraphManager().insertEnd(ea);
List toSelect = new ArrayList();
toSelect.add(ea);
JaWEManager.getInstance().getJaWEController().endUndouableChange(toSelect);