Esempio n. 1
0
    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);
    }
Esempio n. 2
0
 public override bool doTool()
 {
     newSide = trajectory.addSide(startNode.getID(), endNode.getID(), -1);
     if (newSide != null)
     {
         newSideDataControl = new SideDataControl(sceneDataControl, trajectoryDataControl, newSide);
         trajectoryDataControl.getSides().Add(newSideDataControl);
         return(true);
     }
     return(false);
 }
Esempio n. 3
0
 public override bool doTool()
 {
     trajectoryDataControl.getSides().Remove(sideDataControl);
     trajectory.getSides().Remove((Trajectory.Side)sideDataControl.getContent());
     return(true);
 }