public override bool doTool() { Node temp = (Node)oldNodeDataControl.getContent(); trajectory.removeNode(temp.getX(), temp.getY()); trajectoryDataControl.getNodes().Remove(oldNodeDataControl); if (wasInitial) { trajectory.setInitial(null); trajectoryDataControl.initialNode = null; trajectory.setInitial(trajectory.getNodes()[0].getID()); trajectoryDataControl.initialNode = trajectoryDataControl.getNodes()[0]; } foreach (SideDataControl side in trajectoryDataControl.getSides()) { if (!trajectory.getSides().Contains((Side)side.getContent())) { oldSides.Add(side); } } foreach (SideDataControl side in oldSides) { trajectoryDataControl.getSides().Remove(side); } return(true); }