Exemplo n.º 1
0
 public WindowMain()
 {
     InitializeComponent();
     ServiceControls.CreateServiceControls(CanvasTree);
     ServiceListener.AddListener(Note.Get());
     PrepareMenuIcons(TreeType.CommonBST, false);
 }
Exemplo n.º 2
0
        /*******************************************************************************************/
        /*******************************************************************************************/

        public void PrepareStepsForTreeBalancing(Tree tree)
        {
            ServiceListener.AddListener(this);
            new DSW().BalanceTree(tree);
            ServiceListener.RemoveListener(this);

            for (int i = Steps.Count - 1; i >= 0; i--)
            {
                BackRotationAfterPrepareSteps(tree, i);
            }
        }
Exemplo n.º 3
0
        /*******************************************************************************************/
        /*******************************************************************************************/

        public void PrepareStepsForDeleteNodes(Tree tree, List <Node> nodes)
        {
            ServiceListener.AddListener(this);
            tree.DelSelectedNodes(nodes);
            ServiceListener.RemoveListener(this);

            for (int i = Steps.Count - 1; i >= 0; i--)
            {
                if (Steps[i].ActionTreeType == ActionTreeType.REMOVE_NODE)
                {
                    tree.AttachNode(Steps[i].Node);
                }
                else if (Steps[i].ActionTreeType == ActionTreeType.ROTATE_NODE)
                {
                    BackRotationAfterPrepareSteps(tree, i);
                }
                else if (Steps[i].ActionTreeType == ActionTreeType.CHANGE_NODE_COLOR)
                {
                    (Steps[i].Node as NodeRB).ChangeColor();
                }
            }
        }