Exemplo n.º 1
0
        public static IVertex AddInstance(IVertex baseVertex, IVertex metaVertex, IVertex edgeVertex)
        {
            IVertex nv = baseVertex.AddVertex(edgeVertex, null);

            nv.AddEdge(MinusZero.Instance.Root.Get(@"System\Meta\Base\Vertex\$Is"), metaVertex);

            ///

            if (metaVertex.Get("$IsAggregation:") != null)
            {
                nv.AddVertex(MinusZero.Instance.Root.Get(@"System\Meta\Base\Vertex\$IsAggregation"), MinusZero.Instance.Root.Get(@"System\Meta\Base\$Empty"));
            }

            ///

            //IVertex children = metaVertex.GetAll("{$MinCardinality:1}");

            IVertex children = metaVertex; // can use VertexOperations.GetChildEdges, but $DefaultValue: should be OK


            foreach (IEdge child in children)
            {
                if (child.To.Get("$DefaultValue:") != null)
                {
                    nv.AddEdge(child.To, child.To.Get("$DefaultValue:"));
                }
                //       else
                //         nv.AddVertex(child.To, null);
            }

            return(nv);
        }
Exemplo n.º 2
0
        public static IVertex GetChildEdges(IVertex metaVertex)
        {
            IVertex edgeTarget = metaVertex.Get("$EdgeTarget:");

            if (edgeTarget != null && edgeTarget != metaVertex)
            {
                return(GetChildEdges(edgeTarget));
            }

            IVertex ret = m0.MinusZero.Instance.CreateTempVertex();

            foreach (IEdge e in metaVertex)
            {
                if (GeneralUtil.CompareStrings(e.Meta, "$VertexTarget"))
                {
                    ret.AddEdge(null, m0.MinusZero.Instance.Root.Get(@"System\Meta\Base\Vertex\$EdgeTarget"));
                }
                else
                if ((e.To.Value != null) && ((string)e.To.Value != "") && (((string)e.To.Value)[0] != '$') &&
                    (GeneralUtil.CompareStrings(e.Meta, "$Empty") || ((string)e.Meta.Value)[0] != '$')) // is extanded
                                                                                                        // if (e.To.Get("$VertexTarget:") != null || e.To.Get("$EdgeTarget:") != null)
                {
                    ret.AddEdge(null, e.To);
                }
            }

            return(ret);
        }
Exemplo n.º 3
0
        static public void AddEdgeEdgesOnlyMetaTo(IVertex baseVertex, IVertex edgeMeta, IVertex edgeTo)
        {
            IVertex r = MinusZero.Instance.Root;

            baseVertex.AddVertex(r.Get(@"System\Meta\ZeroTypes\Edge\From"), null);
            baseVertex.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\Meta"), edgeMeta);
            baseVertex.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\To"), edgeTo);
        }
Exemplo n.º 4
0
        static public void AddEdgeEdges(IVertex baseVertex, IEdge edge)
        {
            IVertex r = MinusZero.Instance.Root;

            baseVertex.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\From"), edge.From);
            baseVertex.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\Meta"), edge.Meta);
            baseVertex.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\To"), edge.To);
        }
Exemplo n.º 5
0
        static public void AddEdgeEdgesOnlyTo(IVertex baseVertex, IVertex toVertex)
        {
            IVertex r = MinusZero.Instance.Root;

            baseVertex.AddVertex(r.Get(@"System\Meta\ZeroTypes\Edge\From"), null);
            baseVertex.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\Meta"), MinusZero.Instance.Empty);
            baseVertex.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\To"), toVertex);
        }
Exemplo n.º 6
0
        private static void AddNewLineOption(IVertex v, IEdge def, IEdge e)
        {
            IVertex r = m0.MinusZero.Instance.Root;

            IVertex vv = v.AddVertex(null, e.To.Value + " (" + def.To.Value + ")");//def.To.Value + " for " + e.To.Value);

            vv.AddEdge(r.Get(@"System\Meta\Visualiser\DiagramInternal\DiagramItemBase\OptionEdge"), e.To);
            vv.AddEdge(r.Get(@"System\Meta\Visualiser\DiagramInternal\DiagramItemBase\OptionDiagramLineDefinition"), def.To);
        }
Exemplo n.º 7
0
        private void dndPreviewMouseMove(object sender, MouseEventArgs e)
        {
            Point  mousePos = e.GetPosition(this);
            Vector diff     = dndStartPoint - mousePos;

            var    headersPresenter   = UIWpf.FindVisualChild <DataGridColumnHeadersPresenter>(this);
            double headerActualHeight = headersPresenter.ActualHeight;

            if (mousePos.Y <= headerActualHeight) // if header
            {
                e.Handled = false;
                return;
            }

            if (hasButtonBeenDown && isDraggin == false &&
                !UIWpf.IsMouseOverScrollbar(sender, dndStartPoint) &&
                (e.LeftButton == MouseButtonState.Pressed) && (
                    (Math.Abs(diff.X) > Dnd.MinimumHorizontalDragDistance) ||
                    (Math.Abs(diff.Y) > Dnd.MinimumVerticalDragDistance)))
            {
                isDraggin = true;

                RestoreSelectedVertexes();

                IVertex dndVertex = MinusZero.Instance.CreateTempVertex();

                if (Vertex.Get(@"SelectedEdges:\") != null)
                {
                    foreach (IEdge ee in Vertex.GetAll(@"SelectedEdges:\"))
                    {
                        dndVertex.AddEdge(null, ee.To);
                    }
                }
                else
                {
                    IVertex v = GetEdgeByLocation(dndStartPoint);
                    if (v != null)
                    {
                        dndVertex.AddEdge(null, v);
                    }
                }

                if (dndVertex.Count() > 0)
                {
                    DataObject dragData = new DataObject("Vertex", dndVertex);
                    dragData.SetData("DragSource", this);

                    Dnd.DoDragDrop(this, dragData);

                    e.Handled = true;
                }

                isDraggin = false;
            }

            // e.Handled = true;
        }
Exemplo n.º 8
0
        void OnOpenVisualiserSelectedSelected(object sender, System.Windows.RoutedEventArgs e)
        {
            IVertex input = MinusZero.Instance.CreateTempVertex();

            IVertex root = MinusZero.Instance.Root;

            input.AddEdge(root.Get(@"System\Meta\Commands*VisualiserClass"), ((IVertex)((MenuItem)sender).Tag));
            input.AddEdge(root.Get(@"System\Meta\Commands*SynchronisedVisualiser"), PlatformClass.Vertex);

            BaseCommands.OpenVisualiserSelectedSelected(this.Edge, input);
        }
Exemplo n.º 9
0
        static public IVertex AddEdge(IVertex baseVertex, IVertex fromEdge, IVertex metaEdge, IVertex toVertex)
        {
            IVertex r = MinusZero.Instance.Root;

            IVertex ev = baseVertex.AddVertex(r.Get(@"System\Meta\ZeroTypes\Edge"), null);

            ev.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\From"), fromEdge);
            ev.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\Meta"), metaEdge);
            ev.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\To"), toVertex);

            return(ev);
        }
Exemplo n.º 10
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            if (!GeneralUtil.CompareStrings(this.To.Vertex.Get(@"BaseEdge:\To:\To:").Value, "$Empty"))
            {
                if (GeneralUtil.CompareStrings(this.Meta.Vertex.Get(@"BaseEdge:\To:\To:").Value, "$Empty"))
                {
                    Vertex.AddEdge(null, this.To.Vertex.Get(@"BaseEdge:\To:\To:"));
                }
                else
                {
                    Vertex.AddEdge(this.Meta.Vertex.Get(@"BaseEdge:\To:\To:"), this.To.Vertex.Get(@"BaseEdge:\To:\To:"));
                }

                MinusZero.Instance.DefaultShow.CloseWindowByContent(this);
            }
        }
Exemplo n.º 11
0
 static public void CopyEdges(IVertex source, IVertex destination)
 {
     foreach (IEdge e in source)
     {
         destination.AddEdge(e.Meta, e.To);
     }
 }
Exemplo n.º 12
0
        private void dndPreviewMouseMove(object sender, MouseEventArgs e)
        {
            Point  mousePos = e.GetPosition(this);
            Vector diff     = dndStartPoint - mousePos;

            if (hasButtonBeenDown && isDraggin == false && (e.LeftButton == MouseButtonState.Pressed) && (
                    (Math.Abs(diff.X) > Dnd.MinimumHorizontalDragDistance) ||
                    (Math.Abs(diff.Y) > Dnd.MinimumVerticalDragDistance)))
            {
                if (Vertex.Get(@"BaseEdge:\To:") != null)
                {
                    isDraggin = true;

                    IVertex dndVertex = MinusZero.Instance.CreateTempVertex();

                    dndVertex.AddEdge(null, Vertex.Get(@"BaseEdge:"));

                    DataObject dragData = new DataObject("Vertex", dndVertex);
                    dragData.SetData("DragSource", this);

                    Dnd.DoDragDrop(this, dragData);

                    isDraggin = false;
                }
            }
        }
Exemplo n.º 13
0
        public static void DoDrop(object orgin, IVertex baseVertex, DragEventArgs e)
        {
            object sender = e.Data.GetData("DragSource");

            if (sender == null || orgin == sender)
            {
                return;
            }

            bool doCopy = false;

            if (GeneralUtil.CompareStrings(MinusZero.Instance.Root.Get(@"User\CurrentUser:\Settings:\CopyOnDragAndDrop:").Value, "True"))
            {
                doCopy = true;
            }


            if (e.Data.GetDataPresent("Vertex"))
            {
                IVertex dndVertex = e.Data.GetData("Vertex") as IVertex;

                foreach (IEdge ee in dndVertex)
                {
                    if (doCopy)
                    {
                        baseVertex.AddEdge(ee.To.Get("Meta:"), ee.To.Get("To:"));
                    }
                    else
                    {
                        if (ee.To.Get("To:") != baseVertex) // do not want to cut and paste to itself
                        {
                            GraphUtil.DeleteEdge(ee.To.Get("From:"), ee.To.Get("Meta:"), ee.To.Get("To:"));
                            baseVertex.AddEdge(ee.To.Get("Meta:"), ee.To.Get("To:"));
                        }
                    }
                }

                if (sender is IHasSelectableEdges)
                {
                    ((IHasSelectableEdges)sender).UnselectAllSelectedEdges();
                }

                GraphUtil.RemoveAllEdges(dndVertex);
            }

            MinusZero.Instance.IsGUIDragging = false;
        }
Exemplo n.º 14
0
        public static void AddIsClassAndAllAttributesAndAssociations(IVertex ObjectVertex, IVertex ClassVertex)
        {
            IVertex smuv = MinusZero.Instance.Root.Get(@"System\Meta\Base\Vertex");

            ObjectVertex.AddEdge(smuv.Get("$Is"), ClassVertex);

            AddAllAttributesAndAssociationsVertexes(ObjectVertex);
        }
Exemplo n.º 15
0
 /// <summary>
 /// Adds an edge with the same weight between two vertices.
 /// </summary>
 public void AddEdge(IVertex <T> firstVertex, IVertex <T> secondVertex, int weight)
 {
     if (!_vertices.Contains(firstVertex) || !_vertices.Contains(secondVertex))
     {
         throw new Exception("One or both vertices do not exist.");
     }
     firstVertex.AddEdge(secondVertex, weight);
     secondVertex.AddEdge(firstVertex, weight);
 }
Exemplo n.º 16
0
        public static void StartNonAtomProcess()
        {
            IVertex r = MinusZero.Instance.Root;

            IVertex process = ZeroTypes.VertexOperations.AddInstance(r.Get(@"User\CurrentUser:\CurrentSession:"), r.Get(@"System\Meta\User\NonAtomProcess"), r.Get(@"System\Meta\User\Session\Process"));

            process.AddEdge(r.Get(@"System\Meta\User\NonAtomProcess\StartTimeStamp"), MinusZero.Instance.Empty);

            ZeroTypes.DateTime.FillDateTime(process.Get("StartTimeStamp:"), DateTime.Now);
        }
Exemplo n.º 17
0
        static public void CopyAndReplaceEdge(IVertex baseVertex, string MetaValue, IVertex EdgeVertex)
        {
            IEdge toReplace = GraphUtil.FindEdgeByMetaValue(baseVertex, MetaValue);

            if (toReplace == null)
            {
                throw new Exception("Vertex does not have \"" + MetaValue + "\" edge");
            }

            baseVertex.DeleteEdge(toReplace);

            IVertex edge = baseVertex.AddVertex(toReplace.Meta, null);

            IVertex r = MinusZero.Instance.Root;

            edge.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\From"), EdgeVertex.Get("From:"));
            edge.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\Meta"), EdgeVertex.Get("Meta:"));
            edge.AddEdge(r.Get(@"System\Meta\ZeroTypes\Edge\To"), EdgeVertex.Get("To:"));
        }
Exemplo n.º 18
0
        private void dndPreviewMouseMove(object sender, MouseEventArgs e)
        {
            Point  mousePos = e.GetPosition(this);
            Vector diff     = dndStartPoint - mousePos;

            if (hasButtonBeenDown &&
                !UIWpf.IsMouseOverScrollbar(sender, dndStartPoint) &&
                (e.LeftButton == MouseButtonState.Pressed) && (
                    (Math.Abs(diff.X) > Dnd.MinimumHorizontalDragDistance) ||
                    (Math.Abs(diff.Y) > Dnd.MinimumVerticalDragDistance)))
            {
                isDraggin = true;

                IVertex dndVertex = MinusZero.Instance.CreateTempVertex();

                if (Vertex.Get(@"SelectedEdges:\") != null)
                {
                    foreach (IEdge ee in Vertex.GetAll(@"SelectedEdges:\"))
                    {
                        dndVertex.AddEdge(null, ee.To);
                    }
                }
                else
                {
                    IVertex v = GetEdgeByLocation(dndStartPoint);
                    if (v != null)
                    {
                        dndVertex.AddEdge(null, v);
                    }
                }

                if (dndVertex.Count() > 0)
                {
                    DataObject dragData = new DataObject("Vertex", dndVertex);
                    dragData.SetData("DragSource", this);

                    Dnd.DoDragDrop(this, dragData);
                }

                isDraggin = false;
            }
        }
Exemplo n.º 19
0
        static public IEdge CreateOrReplaceEdge(IVertex Vertex, IVertex metaVertex, IVertex NewEdgeToVertex)
        {
            IEdge toReplace = FindEdgeByMetaVertex(Vertex, metaVertex);

            if (toReplace != null)
            {
                Vertex.DeleteEdge(toReplace);
            }

            return(Vertex.AddEdge(metaVertex, NewEdgeToVertex));
        }
Exemplo n.º 20
0
        private void UpdateSelectedVertexes_Reccurent(SimpleTreeVisualiserViewItem i, IVertex sv)
        {
            if (i.IsSelected)
            {
                sv.AddEdge(null, (IVertex)i.Tag);
            }

            foreach (SimpleTreeVisualiserViewItem ii in i.Items)
            {
                UpdateSelectedVertexes_Reccurent(ii, sv);
            }
        }
Exemplo n.º 21
0
        void addf(IVertex where)
        {
            IVertex r = MinusZero.Instance.Root;

            IVertex smzt = r.Get(@"System\Meta\ZeroTypes");
            IVertex smu  = r.Get(@"System\Meta\UML");
            IVertex smb  = r.Get(@"System\Meta\Base");

            IVertex function_function = where.AddVertex(smu.Get(@"Function"), "Sleep");

            function_function.AddEdge(smb.Get(@"Vertex\$Is"), smu.Get("Function"));

            function_function.AddEdge(smu.Get(@"Function\Output"), smzt.Get("Integer"));

            IVertex ffi = function_function.AddVertex(smu.Get(@"Function\InputParameter"), "time");

            ffi.AddEdge(smb.Get(@"Vertex\$VertexTarget"), smzt.Get("Integer"));

            //
            ffi.AddVertex(smb.Get(@"Vertex\$Description"), "this is opis");

            //function_function.AddVertex(smb.Get(@"Vertex\$Description"), "this is opis");
            //

            IVertex ffi2 = function_function.AddVertex(smu.Get(@"Function\InputParameter"), "fastMode");

            ffi2.AddEdge(smb.Get(@"Vertex\$VertexTarget"), smzt.Get("Boolean"));

            IVertex ffi3 = function_function.AddVertex(smu.Get(@"Function\InputParameter"), "interrupt");

            ffi3.AddEdge(smb.Get(@"Vertex\$VertexTarget"), smzt.Get("Integer"));


            ffi3.AddVertex(smb.Get(@"Vertex\$Description"), "inter opis");


            function_function.AddVertex(smu.Get(@"[]"), null);

            function_function.AddEdge(smb.Get(@"$NewLine"), smb.Get(@"$Empty"));
        }
Exemplo n.º 22
0
        static public IEdge ReplaceEdge(IVertex Vertex, string MetaValue, IVertex NewEdgeToVertex)
        {
            IEdge toReplace = FindEdgeByMetaValue(Vertex, MetaValue);

            if (toReplace == null)
            {
                throw new Exception("Vertex does not have \"" + MetaValue + "\" edge");
            }

            Vertex.DeleteEdge(toReplace);

            return(Vertex.AddEdge(toReplace.Meta, NewEdgeToVertex));
        }
Exemplo n.º 23
0
        static public IEdge ReplaceEdge(IVertex Vertex, IVertex metaVertex, IVertex NewEdgeToVertex)
        {
            IEdge toReplace = FindEdgeByMetaVertex(Vertex, metaVertex);

            if (toReplace == null)
            {
                throw new Exception("Vertex does not have edge of supplied Meta Vertex");
            }

            Vertex.DeleteEdge(toReplace);

            return(Vertex.AddEdge(toReplace.Meta, NewEdgeToVertex));
        }
Exemplo n.º 24
0
        public void AddEdge(IVertex v, IVertex u, int weight)
        {
            if (v is null)
            {
                throw new ArgumentNullException(nameof(v));
            }
            if (u is null)
            {
                throw new ArgumentNullException(nameof(u));
            }

            v.AddEdge(new Edge(v, u, weight));
            u.AddEdge(new Edge(u, v, weight));
        }
Exemplo n.º 25
0
        private bool testVertex(IVertex toTest, string query)
        {
            IVertex temp = MinusZero.Instance.CreateTempVertex();

            IEdge e = temp.AddEdge(null, toTest);

            IVertex res = temp.GetAll(query);

            temp.DeleteEdge(e);

            if (res.Count() > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 26
0
        protected override void OnSelectionChanged(SelectionChangedEventArgs e)
        {
            if (!TurnOffSelectedVertexesUpdate)
            {
                TurnOffSelectedItemsUpdate = true;

                IVertex sv = Vertex.Get("SelectedVertexes:");

                GraphUtil.RemoveAllEdges(sv);

                foreach (IEdge v in SelectedItems)
                {
                    sv.AddEdge(null, v.To);
                }

                TurnOffSelectedItemsUpdate = false;
            }

            base.OnSelectionChanged(e);
        }
Exemplo n.º 27
0
        public IVertex Parse(IVertex rootVertex, string text)
        {
            if (goldParser.Parse(new System.IO.StringReader(text)))
            {
                Parse_Reccurent(goldParser.Root, rootVertex, new List <IVertex>());

                return(null);
            }
            else
            {
                IVertex error = MinusZero.Instance.CreateTempVertex();

                IVertex error2 = MinusZero.Instance.CreateTempVertex();
                error2.Value = goldParser.FailMessage;

                error.AddEdge(null, error2);

                return(error);
            }
        }
Exemplo n.º 28
0
        public static void DoFormDrop(object orgin, IVertex baseVertex, IVertex metaVertex, DragEventArgs e)
        {
            object sender = e.Data.GetData("DragSource");

            if (sender == null || orgin == sender)
            {
                return;
            }

            if (e.Data.GetDataPresent("Vertex"))
            {
                IVertex dndVertex = e.Data.GetData("Vertex") as IVertex;

                IVertex maxCardinality = metaVertex.Get("$MaxCardinality:");

                if (maxCardinality != null && (GraphUtil.GetIntegerValue(maxCardinality) == -1 || GraphUtil.GetIntegerValue(maxCardinality) > 1)) // ADD
                {
                    foreach (IEdge ee in dndVertex)
                    {
                        baseVertex.AddEdge(metaVertex, ee.To.Get("To:"));
                    }
                }
                else // REPLACE
                {
                    GraphUtil.ReplaceEdge(baseVertex, metaVertex, dndVertex.First().To.Get("To:"));
                }


                if (sender is IHasSelectableEdges)
                {
                    ((IHasSelectableEdges)sender).UnselectAllSelectedEdges();
                }

                GraphUtil.RemoveAllEdges(dndVertex);
            }

            MinusZero.Instance.IsGUIDragging = false;
        }
Exemplo n.º 29
0
        public static IEdge AddEdgeOrVertexByMeta(IVertex baseVertex, IVertex metaVertex, IVertex toVertex, Point position, bool?CreateEdgeOnly, bool?ForceShowEditForm)
        {
            if (metaVertex.Get(@"$VertexTarget:") != null &&
                (CreateEdgeOnly.HasValue == false || CreateEdgeOnly == false))
            {
                IVertex n = VertexOperations.AddInstance(baseVertex, metaVertex);

                IEdge e = new EasyEdge(baseVertex, metaVertex, n);

                n.AddEdge(MinusZero.Instance.Root.Get(@"System\Meta\Base\Vertex\$EdgeTarget"), toVertex);

                if (ForceShowEditForm.HasValue == false || ForceShowEditForm == true)
                {
                    MinusZero.Instance.DefaultShow.EditDialog(e.To, position);
                }

                return(e);
            }
            else
            {
                return(baseVertex.AddEdge(metaVertex, toVertex));;
            }
        }
Exemplo n.º 30
0
        private void CreateTestData()
        {
            IVertex r = MinusZero.Instance.Root;

            GeneralUtil.ParseAndExcute(r, r.Get(@"System\Meta"), @"{TEST3{Class:Customer{},Class:Person{$Description:opis,Attribute:Name,Attribute:Surname,Attribute:DateOfBirth},Class:Company{Attribute:Name,Attribute:RegistrationNumber,},Class:Adress{Attribute:Line 1,Attribute:Line 2,Attribute:Line 3,Attribute:City,Attribute:County,Attribute:Postal code,Attribute:Country},Class:Basket{Attribute:Creation date,Attribute:Status},Class:Item{Attribute:Name,Attribute:Description,Attribute:Price}}}");

            r.Get(@"TEST3\Customer").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta\UML\Class"));
            r.Get(@"TEST3\Person").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta\UML\Class"));
            r.Get(@"TEST3\Company").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta\UML\Class"));
            r.Get(@"TEST3\Adress").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta\UML\Class"));
            r.Get(@"TEST3\Basket").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta\UML\Class"));
            r.Get(@"TEST3\Item").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta\UML\Class"));

            GeneralUtil.ParseAndExcute(r, r.Get(@"System\Meta"), "{TEST2,TEST{Class:Person{Association:Spouse{$MaxCardinality:1,$MaxTargetCardinality:1},Aggregation:Child{$MaxCardinality:3},Attribute:Name,Attribute:Surname,Attribute:Age{MinValue:0,MaxValue:40},Attribute:NoseLength{MinValue:0,MaxValue:40},Attribute:Money{MinValue:0,MaxValue:1000},Attribute:IsGood,Attribute:IsPretty,Attribute:IsPretty2,Attribute:IsPretty3},Enum:Pretty{EnumValue:Yes,EnumValue:No,EnumValue:Maybe}}}");

            r.Get(@"TEST\Pretty").AddEdge(r.Get(@"System\Meta*$Inherits"), r.Get(@"System\Meta\ZeroTypes\EnumBase"));
            r.Get(@"TEST\Person").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta\UML\Class"));

            IVertex smzt = r.Get(@"System\Meta\ZeroTypes");

            IVertex EdgeTarget = r.Get(@"System\Meta*$EdgeTarget");

            IVertex Person = r.Get(@"TEST\Person");



            IVertex smu = r.Get(@"System\Meta\UML");
            IVertex smb = r.Get(@"System\Meta\Base");


            IVertex function_function = Person.AddVertex(smu.Get(@"Function"), "Sleep");

            function_function.AddEdge(smu.Get(@"Function\Output"), smzt.Get("Integer"));

            IVertex ffi = function_function.AddVertex(smu.Get(@"Function\InputParameter"), "time");

            ffi.AddEdge(smb.Get(@"Vertex\$VertexTarget"), smzt.Get("Integer"));

            //
            ffi.AddVertex(smb.Get(@"Vertex\$Description"), "this is opis time");
            function_function.AddVertex(smb.Get(@"Vertex\$Description"), "this is opis function");
            //

            IVertex ffi2 = function_function.AddVertex(smu.Get(@"Function\InputParameter"), "fastMode");

            ffi2.AddEdge(smb.Get(@"Vertex\$VertexTarget"), smzt.Get("Boolean"));

            IVertex ffi3 = function_function.AddVertex(smu.Get(@"Function\InputParameter"), "interrupt");

            ffi3.AddEdge(smb.Get(@"Vertex\$VertexTarget"), smzt.Get("Integer"));


            function_function.AddVertex(smu.Get(@"[]"), null);

            function_function.AddEdge(smb.Get(@"$NewLine"), smb.Get(@"$Empty"));

            //

            /*IVertex function2_function = Person.AddVertex(smu.Get(@"Function"), "Sleep");
             *
             * function2_function.AddEdge(smu.Get(@"Function\Output"), smzt.Get("Integer"));
             *
             * IVertex f2fi = function2_function.AddVertex(smu.Get(@"Function\InputParameter"), "time");
             *
             * f2fi.AddEdge(smb.Get(@"Vertex\$VertexTarget"), smzt.Get("Integer"));
             *
             *
             * function2_function.AddVertex(smu.Get(@"[]"), null);
             *
             * function2_function.AddVertex(smb.Get(@"$NewLine"), "3");
             *
             */

            Person.Get("Name").AddEdge(EdgeTarget, smzt.Get("String"));

            Person.Get("Spouse").AddEdge(r.Get(@"System\Meta*$EdgeTarget"), Person);
            Person.Get("Child").AddEdge(r.Get(@"System\Meta*$EdgeTarget"), Person);

            Person.Get("Surname").AddEdge(EdgeTarget, smzt.Get("String"));
            Person.Get("Age").AddEdge(EdgeTarget, smzt.Get("Integer"));
            Person.Get("NoseLength").AddEdge(EdgeTarget, smzt.Get("Float"));
            Person.Get("Money").AddEdge(EdgeTarget, smzt.Get("Decimal"));
            Person.Get("IsGood").AddEdge(EdgeTarget, smzt.Get("Boolean"));
            Person.Get("IsPretty").AddEdge(EdgeTarget, r.Get(@"TEST\Pretty"));
            Person.Get("IsPretty2").AddEdge(EdgeTarget, r.Get(@"TEST\Pretty"));
            Person.Get("IsPretty3").AddEdge(EdgeTarget, r.Get(@"TEST\Pretty"));

            //Person.AddEdge(smu.Get(@"Class\Attribute"), Person.Get("Surname"));
            // what is it for?

            GeneralUtil.ParseAndExcute(r.Get("TEST"), r.Get(@"TEST"), "{Person:Person1{Name:Radek,Surname:Tereszczuk,Age:34,NoseLength:\"2,3\",Money:999,IsGood:False,IsPretty:},Person:Person2{Name:Maurycy,Surname:Tereszczuk,Age:1,NoseLength:1.1,Money:9999,IsGood:True,IsPretty:}}");

            GeneralUtil.ParseAndExcute(r.Get("TEST"), r.Get(@"TEST"), "{Person:Person3{Name:Radek,Surname:Tereszczuk,Age:34,NoseLength:\"2,3\",Money:999,IsGood:False,IsPretty:},Person:Person4{Name:Maurycy,Surname:Tereszczuk,Age:1,NoseLength:1.1,Money:9999,IsGood:True,IsPretty:}}");

            r.Get(@"TEST\Person1").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"TEST\Person"));
            r.Get(@"TEST\Person2").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"TEST\Person"));
            r.Get(@"TEST\Person3").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"TEST\Person"));
            r.Get(@"TEST\Person4").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"TEST\Person"));

            GraphUtil.ReplaceEdge(r.Get(@"TEST\Person1"), "IsPretty", r.Get(@"TEST\Pretty\No"));
            GraphUtil.ReplaceEdge(r.Get(@"TEST\Person2"), "IsPretty", r.Get(@"TEST\Pretty\Yes"));
            GraphUtil.ReplaceEdge(r.Get(@"TEST\Person3"), "IsPretty", r.Get(@"TEST\Pretty\Yes"));
            GraphUtil.ReplaceEdge(r.Get(@"TEST\Person4"), "IsPretty", r.Get(@"TEST\Pretty\Yes"));


            for (int x = 0; x < 1; x++)
            {
                GeneralUtil.ParseAndExcute(r.Get("TEST2"), r.Get(@"TEST"), "{Person:Person1" + x + "{Name:Radek,Surname:Tereszczuk,Age:34,NoseLength:\"2,3\",Money:999,IsGood:False,IsPretty:},Person:Person2" + x + "{Name:Maurycy,Surname:Tereszczuk,Age:1,NoseLength:1.1,Money:9999,IsGood:True,IsPretty:}}");


                GeneralUtil.ParseAndExcute(r.Get("TEST2"), r.Get(@"TEST"), "{Person:Person3" + x + "{Name:Magda,Surname:Tereszczuk,Age:18,NoseLength:\"2,1\",Money:999,IsGood:True,IsPretty:},Person:Person4" + x + "{Name:Jan,Surname:Kuciak,Age:10,NoseLength:0.6,Money:99999,IsGood:True,IsPretty:}}");

                GraphUtil.ReplaceEdge(r.Get(@"TEST2\Person1" + x), "IsPretty", r.Get(@"TEST\Pretty\No"));
                GraphUtil.ReplaceEdge(r.Get(@"TEST2\Person2" + x), "IsPretty", r.Get(@"TEST\Pretty\Yes"));
                GraphUtil.ReplaceEdge(r.Get(@"TEST2\Person3" + x), "IsPretty", r.Get(@"TEST\Pretty\Yes"));
                GraphUtil.ReplaceEdge(r.Get(@"TEST2\Person4" + x), "IsPretty", r.Get(@"TEST\Pretty\Yes"));

                r.Get(@"TEST2\Person1" + x + @"\Radek").AddEdge(r.Get(@"System\Meta*$Is"), smzt.Get("String"));


                r.Get(@"TEST2\Person1" + x).AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"TEST\Person"));
                r.Get(@"TEST2\Person2" + x).AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"TEST\Person"));
                r.Get(@"TEST2\Person3" + x).AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"TEST\Person"));
                r.Get(@"TEST2\Person4" + x).AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"TEST\Person"));
            }

            for (int x = 0; x < 1; x++)
            {
                for (int y = 0; y < 1; y++)
                {
                    r.Get(@"TEST2\Person1" + x).AddEdge(r.Get(@"TEST\Person\Child"), r.Get(@"TEST2\Person1" + y));
                    r.Get(@"TEST2\Person2" + x).AddEdge(r.Get(@"TEST\Person\Child"), r.Get(@"TEST2\Person2" + y));
                    r.Get(@"TEST2\Person3" + x).AddEdge(r.Get(@"TEST\Person\Child"), r.Get(@"TEST2\Person3" + y));
                    r.Get(@"TEST2\Person4" + x).AddEdge(r.Get(@"TEST\Person\Child"), r.Get(@"TEST2\Person4" + y));
                }
            }

            for (int i = 1; i <= 1; i++)
            {
                IVertex x = r.Get("TEST2").AddVertex(null, i);

                for (int ii = 1; ii <= 1; ii++)
                {
                    IVertex xx = x.AddVertex(null, i + " " + ii);

                    for (int iii = 1; iii <= 1; iii++)
                    {
                        IVertex xxx = xx.AddVertex(null, i + " " + ii + " " + iii);

                        for (int iiii = 1; iiii <= 3; iiii++)
                        {
                            xxx.AddVertex(null, i + " " + ii + " " + iii + " " + iiii);
                        }
                    }
                }
            }

            //r.Get(@"TEST2\1").AddEdge(null, r.Get(@"TEST2\2\2 2\2 2 1"));

            GeneralUtil.ParseAndExcute(r.Get("TEST"), r.Get(@"System\Meta"), "{Diagram:TestDiagram{ZoomVisualiserContent:100,SelectedEdges:,CreationPool:}}");

            r.Get(@"TEST\TestDiagram").AddVertex(r.Get(@"System\Meta\Visualiser\Diagram\SizeX"), 600.0);

            r.Get(@"TEST\TestDiagram").AddVertex(r.Get(@"System\Meta\Visualiser\Diagram\SizeY"), 600.0);

            r.Get(@"TEST\TestDiagram").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta*Diagram"));

            IVertex i1 = r.Get(@"TEST\TestDiagram").AddVertex(r.Get(@"System\Meta*Item"), null);

            GeneralUtil.ParseAndExcute(i1, r.Get(@"System\Meta"), "{PositionX:0,PositionY:0,SizeX:100,SizeY:100}");

            IVertex i2 = r.Get(@"TEST\TestDiagram").AddVertex(r.Get(@"System\Meta*Item"), null);

            GeneralUtil.ParseAndExcute(i2, r.Get(@"System\Meta"), "{PositionX:200,PositionY:200,SizeX:100,SizeY:100}");

            i1.AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta\Visualiser\DiagramInternal\DiagramRectangleItem"));

            i1.AddEdge(r.Get(@"System\Meta\Visualiser\DiagramInternal\DiagramItemBase\Definition"), r.Get(@"System\Data\Visualiser\Diagram\Object"));

            Edge.AddEdgeByToVertex(i1, r.Get(@"System\Meta\ZeroTypes\HasBaseEdge\BaseEdge"), r.Get(@"TEST\Person1"));

            i2.AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta\Visualiser\DiagramInternal\DiagramRectangleItem"));

            i2.AddEdge(r.Get(@"System\Meta\Visualiser\DiagramInternal\DiagramItemBase\Definition"), r.Get(@"System\Data\Visualiser\Diagram\Object"));

            Edge.AddEdgeByToVertex(i2, r.Get(@"System\Meta\ZeroTypes\HasBaseEdge\BaseEdge"), r.Get(@"TEST\Person2"));



            i1 = r.Get(@"TEST\TestDiagram").AddVertex(r.Get(@"System\Meta*Item"), null);

            GeneralUtil.ParseAndExcute(i1, r.Get(@"System\Meta"), "{PositionX:350,PositionY:0}");

            i2 = r.Get(@"TEST\TestDiagram").AddVertex(r.Get(@"System\Meta*Item"), null);

            GeneralUtil.ParseAndExcute(i2, r.Get(@"System\Meta"), "{PositionX:0,PositionY:350}");

            i1.AddEdge(r.Get(@"System\Meta\Visualiser\DiagramInternal\DiagramItemBase\Definition"), r.Get(@"System\Data\Visualiser\Diagram\Object"));

            i1.AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta\Visualiser\DiagramInternal\DiagramRectangleItem"));

            Edge.AddEdgeByToVertex(i1, r.Get(@"System\Meta\ZeroTypes\HasBaseEdge\BaseEdge"), r.Get(@"TEST\Person3"));

            i2.AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"System\Meta\Visualiser\DiagramInternal\DiagramRectangleItem"));

            i2.AddEdge(r.Get(@"System\Meta\Visualiser\DiagramInternal\DiagramItemBase\Definition"), r.Get(@"System\Data\Visualiser\Diagram\Object"));

            Edge.AddEdgeByToVertex(i2, r.Get(@"System\Meta\ZeroTypes\HasBaseEdge\BaseEdge"), r.Get(@"TEST\Person4"));

            /////////////////////

            /* GeneralUtil.ParseAndExcute(r.Get("TEST"), r.Get(@"System\Meta"), "{Class:X1,Class:X2,Class:X3,Class:X4,Class:PersonA,Class:PersonB,Class:PersonB2{Attribute:New}}");
             *
             * r.Get(@"TEST\PersonB2\New").AddEdge(r.Get(@"System\Meta*$EdgeTarget"), r.Get(@"System\Meta*String"));
             *
             * VertexOperations.AddInstance(r.Get("TEST"), r.Get(@"TEST\PersonB2"), r.Get(@"TEST\Person")).Value="XXX";
             *
             * r.Get(@"TEST\X2").AddEdge(r.Get(@"System\Meta*$Inherits"), r.Get(@"TEST\Person"));
             * r.Get(@"TEST\X3").AddEdge(r.Get(@"System\Meta*$Inherits"), r.Get(@"TEST\X2"));
             * r.Get(@"TEST\X4").AddEdge(r.Get(@"System\Meta*$Inherits"), r.Get(@"TEST\X3"));
             *
             * r.Get(@"TEST\PersonA").AddEdge(r.Get(@"System\Meta*$Inherits"), r.Get(@"TEST\Person"));
             * r.Get(@"TEST\PersonB").AddEdge(r.Get(@"System\Meta*$Inherits"), r.Get(@"TEST\Person"));
             * r.Get(@"TEST\PersonB2").AddEdge(r.Get(@"System\Meta*$Inherits"), r.Get(@"TEST\PersonB"));
             *
             * r.Get(@"TEST\XXX").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"TEST\PersonA"));
             * r.Get(@"TEST\XXX").AddEdge(r.Get(@"System\Meta*$Is"), r.Get(@"TEST\X4"));*/

            //////////////////////

            IVertex tt = r.Get("TEST").AddVertex(r.Get("System*Class"), "TestClass");

            for (int x = 0; x < 1; x++)
            {
                for (int y = 0; y < 1; y++)
                {
                    IVertex tta = tt.AddVertex(r.Get("System*Attribute"), "a" + x + " " + y + ";" + randomChars());
                    tta.AddVertex(r.Get("System*$Group"), x.ToString());
                    tta.AddVertex(r.Get("System*$Section"), y.ToString());

                    tta.AddEdge(r.Get("System*$EdgeTarget"), r.Get("System*String"));

                    IVertex ttb = tt.AddVertex(r.Get("System*Attribute"), "b" + x + " " + y + ";" + randomChars());
                    ttb.AddVertex(r.Get("System*$Group"), x.ToString());
                    //ttb.AddVertex(r.Get("System*$Section"), y.ToString());
                    ttb.AddEdge(r.Get("System*$EdgeTarget"), r.Get("System*String"));

                    IVertex ttc = tt.AddVertex(r.Get("System*Attribute"), "c" + x + " " + y + ";" + randomChars());
                    ttc.AddVertex(r.Get("System*$Group"), x.ToString());
                    ttc.AddVertex(r.Get("System*$Section"), y.ToString());
                    ttc.AddVertex(r.Get("System*$MaxCardinality"), 6);
                    ttc.AddEdge(r.Get("System*$EdgeTarget"), r.Get("System*String"));
                }
            }

            VertexOperations.AddInstance(r.Get("TEST"), tt);

            //////////////////////


            IVertex start = r.Get(@"TEST3");

            for (int i = 0; i < 1; i++)
            {
                IVertex sm = start.AddVertex(r.Get(@"System\Meta\UML\StateMachine"), "sm " + i);

                for (int ii = 0; ii < 1; ii++)
                {
                    sm.AddVertex(r.Get(@"System\Meta\UML\StateMachine\State"), "state " + ii + " of machine" + i);
                }

                IVertex allstates = sm.GetAll("");

                foreach (IEdge e in allstates)
                {
                    foreach (IEdge ee in allstates)
                    {
                        e.To.AddEdge(r.Get(@"System\Meta\UML\StateMachine\State\Transition"), ee.To);
                    }
                }
            }

            //////////////////////

            IVertex associations = r.GetAll(@"TEST\Person\Association:");
            IVertex ismeta       = r.Get(@"System\Meta*$Is");
            IVertex asmeta       = r.Get(@"System\Meta\UML\Class\Association");

            //foreach (IEdge v in associations)
            //   v.To.AddEdge(ismeta, asmeta);

            IVertex attributes = r.GetAll(@"TEST\Person\Attribute:");
            //IVertex ismeta=r.Get(@"System\Meta*$Is");
            IVertex ameta = r.Get(@"System\Meta\UML\Class\Attribute");

            foreach (IEdge v in attributes)
            {
                v.To.AddEdge(ismeta, ameta);
            }

            attributes = r.GetAll(@"TEST3\\Attribute:");

            foreach (IEdge v in attributes)
            {
                v.To.AddEdge(ismeta, ameta);
            }

            IVertex test = r.Get("TEST");

            test.AddVertex(test.AddVertex(null, "Counter"), (int)0);


            IVertex vvv = VertexOperations.AddInstance(test, r.Get(@"System\Meta\Base\$Import"));

            vvv.AddEdge(r.Get(@"System\Meta\Base\Vertex\$$IsLink"), MinusZero.Instance.Empty);

            vvv.Value = "tst";

            test.AddEdge(r.Get(@"TEST\tst"), r.Get(@"System\Meta\Visualiser"));

            /////

            IVertex aattributes = r.GetAll(@"TEST\\Attribute:");

            IVertex isAggregation = r.Get(@"System\Meta\Base\Vertex\$IsAggregation");
            IVertex empty         = r.Get(@"System\Meta\Base\$Empty");

            foreach (IEdge v in aattributes)
            {
                v.To.AddEdge(isAggregation, empty);
            }

            IVertex aggregations = r.GetAll(@"TEST\\Aggregation:");

            foreach (IEdge v in aggregations)
            {
                v.To.AddEdge(isAggregation, empty);
            }

            ///

            IVertex vx = r.AddVertex(null, "X");

            IVertex my = vx.AddVertex(null, "j e s ");

            IVertex vxx = vx.AddVertex(null, "VXX");

            IVertex c = VertexOperations.AddInstance(vxx, smu.Get("[]"));

            c.Value = "";

            c.AddVertex(smu.Get(@"MultiOperator\Expression"), "raz");

            IVertex dwa = c.AddVertex(smu.Get(@"MultiOperator\Expression"), "dwa");

            //dwa.AddVertex(smb.Get(@"Vertex\$Description"), "3 3 3");

            c.AddEdge(smu.Get(@"MultiOperator\Expression"), my);

            IVertex cztery = c.AddVertex(smu.Get(@"MultiOperator\Expression"), "cztery");

            //cztery.AddVertex(smb.Get(@"Vertex\$Description"), "cztery 1");

            //cztery.AddVertex(smb.Get(@"Vertex\$Description"), "cztery 2");


            // IVertex zzz = vx.AddVertex(null, "raz");

            //   IVertex yyy = vx.AddVertex(null, "dwa");

            //  IVertex wh = VertexOperations.AddInstance(vx, smu.Get(@"While"));


            // IVertex plus = VertexOperations.AddInstance(wh, smu.Get("-"), smu.Get(@"While\Test"));

            IVertex plus = VertexOperations.AddInstance(c, smu.Get("+"), smu.Get(@"MultiOperator\Expression"));

            //plus.AddVertex(smb.Get(@"Vertex\$Description"), "plus opis MAIN");

            //plus.AddVertex(null, "KUPA");

            //  plus.AddVertex(smu.Get(@"DoubleOperator\LeftExpression"), "10");

            // plus.AddVertex(smu.Get(@"DoubleOperator\RightExpression"), "30");

            plus.Value = "";

            // IVertex h = vx.AddVertex(null, "h");

            //  vx.AddEdge(zzz,plus);

            //  vx.AddVertex(zzz, "");

            // vx.AddEdge(yyy, plus);

            IVertex leftplus = VertexOperations.AddInstance(plus, smu.Get("-"), smu.Get(@"DoubleOperator\LeftExpression"));

            leftplus.Value = "";

            leftplus.AddVertex(smu.Get(@"DoubleOperator\LeftExpression"), "1");

            leftplus.AddVertex(smu.Get(@"DoubleOperator\RightExpression"), "2");

            IVertex rightplus = VertexOperations.AddInstance(plus, smu.Get("+"), smu.Get(@"DoubleOperator\RightExpression"));

            //rightplus.AddVertex(smb.Get(@"Vertex\$Description"), "plus opis tak");

            rightplus.Value = "";

            IVertex w3 = rightplus.AddVertex(smu.Get(@"DoubleOperator\LeftExpression"), "3");
            // w3.AddVertex(smb.Get(@"Vertex\$Description"), "3 3 3");


            IVertex v4 = rightplus.AddVertex(smu.Get(@"DoubleOperator\RightExpression"), "4");

            v4.AddVertex(smb.Get(@"Vertex\$Description"), "opis");



            //////////////////////////


            IVertex xXx = r.AddVertex(null, "XX");


            addf(xXx);


            //////////////////////////

            IVertex yv = r.AddVertex(null, "Y");
        }