Ejemplo n.º 1
0
        public override bool undoTool()
        {
            nodeDataControl.setInitial(false);
            trajectoryDataControl.initialNode = oldInitialNodeDataControl;

            if (trajectoryDataControl.initialNode != null)
            {
                trajectory.setInitial(trajectoryDataControl.getInitialNode().getID());
                trajectoryDataControl.initialNode.setInitial(true);
            }
            else
            {
                trajectory.setInitial("");
            }

            Controller.getInstance().updatePanel();
            return(true);
        }
        /**
         * Constructor.
         *
         * @param sceneDataControl
         *            Link to the parent scene controller
         * @param barriersList
         *            List of activeAreas
         */
        public TrajectoryDataControl(SceneDataControl sceneDataControl, Trajectory trajectory)
        {
            this.sceneDataControl = sceneDataControl;
            this.trajectory       = trajectory;

            sideDataControlList = new List <SideDataControl>();
            nodeDataControlList = new List <NodeDataControl>();
            if (trajectory != null)
            {
                foreach (Node node in trajectory.getNodes())
                {
                    nodeDataControlList.Add(new NodeDataControl(sceneDataControl, node, trajectory));
                    if (node == trajectory.getInitial())
                    {
                        initialNode = nodeDataControlList[nodeDataControlList.Count - 1];
                        initialNode.setInitial(true);
                    }
                }
                foreach (Side side in trajectory.getSides())
                {
                    sideDataControlList.Add(new SideDataControl(sceneDataControl, this, side));
                }
            }
        }