Example #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);
    }
 public NodeDataControl getStart()
 {
     foreach (NodeDataControl ndc in trajectoryDataControl.getNodes())
     {
         if (ndc.getID().Equals(side.getIDStart()))
         {
             return(ndc);
         }
     }
     return(null);
 }
    public override bool doTool()
    {
        string id = "node" + (new System.Random().Next(10000));

        newNode            = trajectory.addNode(id, x, y, 1.0f);
        newNodeDataControl = new NodeDataControl(sceneDataControl, newNode, trajectory);
        trajectoryDataControl.getNodes().Add(newNodeDataControl);
        if (trajectory.getInitial() == newNode)
        {
            trajectoryDataControl.initialNode = newNodeDataControl;
            wasInitial = true;
        }
        return(true);
    }