Ejemplo n.º 1
0
        void PPSMtoPSM(P_PSMDiagram D)
        {
            NewModelClassCommand addPIMClass = NewModelClassCommandFactory.Factory().Create(DiagramController.ModelController) as NewModelClassCommand;

            addPIMClass.Package = DiagramController.Project.Schema.Model;
            addPIMClass.Execute();
            tempPIMClass = addPIMClass.CreatedClass.Element;

            X.p.Maximum    = X.ClassesCount;
            X.p.Value      = 0;
            X.p.Visibility = Visibility.Visible;
            X.l.Visibility = Visibility.Visible;
            if (!Layout)
            {
                TreeLayout.SwitchOff();
            }
            Stopwatch S = new Stopwatch();

            S.Start();
            if (UseCommands)
            {
                GeneratePSM(D);
            }
            else
            {
                DiagramController.getUndoStack().Invalidate();
                DiagramController.getRedoStack().Invalidate();
                GeneratePSM2(D);
            }
            S.Stop();
            X.t.Text += "Generated PSM in " + S.ElapsedMilliseconds.ToString() + "ms" + Environment.NewLine;

            S = new Stopwatch();
            S.Start();
            if (UseCommands)
            {
                LinkSRs(D);
            }
            else
            {
                LinkSRs2(D);
            }
            S.Stop();
            X.t.Text += "Linked SRs in " + S.ElapsedMilliseconds.ToString() + "ms" + Environment.NewLine;
            if (!Layout)
            {
                TreeLayout.SwitchOn();
            }

            //Only to refresh GUI, which normally happens after each command
            ActivateDiagramCommand A = ActivateDiagramCommandFactory.Factory().Create(DiagramController.ModelController) as ActivateDiagramCommand;

            A.Set(DiagramController.Diagram);
            A.Execute();
        }
Ejemplo n.º 2
0
 void Canvas_Loaded(object sender, RoutedEventArgs e)
 {
     TreeLayout.SwitchOn();
     TreeLayout.LayoutDiagram(xCaseDrawComponent.Canvas);
 }