void LoadTextDataFile(SaveData saveData, Vector2 mousePos, bool addFlag = true, string pathName = null)
    {
        baseEdge = new BaseEdge();
        var file = new SaveManager();

        if (pathName == null)
        {
            file.OpenFile();
        }
        else
        {
            file.LoadFile(pathName);
        }

        var nodeName = file.GetExtensionFileNameSaveData(saveData.pathName);
        var node     = new SerializableNode()
        {
            position = mousePos, data = saveData, name = nodeName
        };
        var data = new SaveData()
        {
            stateKey = saveData.stateKey, isBase = saveData.isBase, clipPath = saveData.clipPath, events = saveData.events, position = saveData.position, pathName = saveData.pathName
        };
        var view = GetGraphView();

        if (addFlag == true)
        {
            CreateNodeElement(node, data);
        }
        else
        {
            LoadNodeElement(node, data);
        }
    }
Beispiel #2
0
        void OnEdgeAdded(BaseEdge _edge)
        {
            var input  = NodeViews[_edge.InputNodeGUID].PortViews[_edge.InputFieldName];
            var output = NodeViews[_edge.OutputNodeGUID].PortViews[_edge.OutputFieldName];

            ConnectView(input, output, _edge);
            SetDirty();
        }
Beispiel #3
0
        internal void WriteEdge(BaseNode fromNode, BaseNode toNode, BaseEdge edge)
        {
            var query = client.Cypher.MatchQuerry("n", fromNode)
                        .MatchQuerry("m", toNode).
                        Create("(n)-[:" + edge.GetType().Name + " {newEdge}]->(m)").
                        WithParam("newEdge", edge);

            query.ExecuteWithoutResults();
        }
Beispiel #4
0
 void OnEdgeRemoved(BaseEdge _edge)
 {
     edges.ForEach(edge =>
     {
         if (edge.userData != _edge)
         {
             return;
         }
         DisconnectView(edge as BaseEdgeView);
     });
     SetDirty();
 }
Beispiel #5
0
    //接続用に一纏め
    public StringNode(string path, BaseEdge edge) : base()
    {
        title = "String";
        port  = Port.Create <Edge>(Orientation.Horizontal, Direction.Output, Port.Capacity.Single, typeof(string));

        port.portName = "StringValue";
        //port.Connect(port.ConnectTo(p));

        //edge.GetOutputContainer().Add(port);
        outputContainer.Add(port);

        Init(path);
    }
Beispiel #6
0
    public BoolNode(bool flag, BaseEdge edge)
    {
        title = "Bool";
        var port = Port.Create <Edge>(Orientation.Horizontal, Direction.Output, Port.Capacity.Single, typeof(bool));

        port.portName = "Value";

        outputContainer.Add(port);

        //値の追加
        enumField = new EnumField();
        enumField.Init(boolField);
        enumField.value = (flag == true ? BoolField.True : BoolField.False);
        mainContainer.Add(enumField);

        RefreshExpandedState();
    }
Beispiel #7
0
        //public StackView AddStackNodeView(StackPanel _stackNode)
        //{
        //    var stackView = new StackView();
        //    stackView.SetUp(_stackNode, CommandDispatcher, this);
        //    AddElement(stackView);
        //    StackViews[_stackNode.GUID] = stackView;
        //    return stackView;
        //}

        //public void RemoveStackNodeView(StackView _stackNodeView)
        //{
        //    RemoveElement(_stackNodeView);
        //    StackViews.Remove(_stackNodeView.Model.GUID);
        //}

        //public void RemoveStackNodeViews()
        //{
        //    foreach (var stackView in StackViews)
        //        RemoveElement(stackView.Value);
        //    StackViews.Clear();
        //}

        public BaseEdgeView ConnectView(NodePortView _inputPortView, NodePortView _outputPortView, BaseEdge _serializableEdge)
        {
            var edgeView = Activator.CreateInstance(GetEdgeViewType()) as BaseEdgeView;

            edgeView.userData = _serializableEdge;
            edgeView.input    = _inputPortView;
            edgeView.output   = _outputPortView;
            edgeView.SetUp(_serializableEdge, CommandDispatcher, this);
            _inputPortView.Connect(edgeView);
            _outputPortView.Connect(edgeView);
            AddElement(edgeView);
            return(edgeView);
        }
Beispiel #8
0
        protected void UpdateItemList()
        {
            ItemsList = m0.MinusZero.Instance.CreateTempVertex();

            if (InstanceRadio.IsChecked == true)
            {
                IVertex Instance = m0.MinusZero.Instance.Root.GetAll(@"System\Data\Visualiser\Diagram\{InstanceCreation:Instance}");

                foreach (IEdge d in Instance)
                {
                    //if (BaseEdge.Get("To:").Get((string)GraphUtil.GetValue(d.To.Get("MetaVertexTestQuery:"))) != null)
                    if (testVertex(BaseEdge.Get("To:"), (string)GraphUtil.GetValue(d.To.Get("MetaVertexTestQuery:"))))
                    {
                        ItemsList.AddEdge(null, d.To);
                    }
                }

                IVertex InstanceAndDirect = m0.MinusZero.Instance.Root.GetAll(@"System\Data\Visualiser\Diagram\{InstanceCreation:InstanceAndDirect}");

                foreach (IEdge d in InstanceAndDirect)
                {
                    //if (BaseEdge.Get("To:").Get((string)GraphUtil.GetValue(d.To.Get("MetaVertexTestQuery:"))) != null)
                    if (testVertex(BaseEdge.Get("To:"), (string)GraphUtil.GetValue(d.To.Get("MetaVertexTestQuery:"))))
                    {
                        ItemsList.AddEdge(null, d.To);
                    }
                }
            }
            else
            {
                IVertex InstanceAndDirect = m0.MinusZero.Instance.Root.GetAll(@"System\Data\Visualiser\Diagram\{InstanceCreation:InstanceAndDirect}");

                foreach (IEdge d in InstanceAndDirect)
                {
                    //if (BaseEdge.Get("To:").Get((string)GraphUtil.GetValue(d.To.Get("DirectVertexTestQuery:"))) != null)
                    if (testVertex(BaseEdge.Get("To:"), (string)GraphUtil.GetValue(d.To.Get("DirectVertexTestQuery:"))))
                    {
                        ItemsList.AddEdge(null, d.To);
                    }
                    else
                    if ((string)GraphUtil.GetValue(d.To.Get("DirectVertexTestQuery:")) == "")
                    {
                        ItemsList.AddEdge(null, d.To);
                    }
                }

                IVertex Direct = m0.MinusZero.Instance.Root.GetAll(@"System\Data\Visualiser\Diagram\{InstanceCreation:Direct}");

                foreach (IEdge d in Direct)
                {
                    //if (BaseEdge.Get("To:").Get((string)GraphUtil.GetValue(d.To.Get("DirectVertexTestQuery:"))) != null)
                    if (testVertex(BaseEdge.Get("To:"), (string)GraphUtil.GetValue(d.To.Get("DirectVertexTestQuery:"))))
                    {
                        ItemsList.AddEdge(null, d.To);
                    }
                    else
                    if ((string)GraphUtil.GetValue(d.To.Get("DirectVertexTestQuery:")) == "")
                    {
                        ItemsList.AddEdge(null, d.To);
                    }
                }
            }

            List.ItemsSource = ItemsList;

            if (ItemsList.Count() > 0)
            {
                ListLabel.Visibility = Visibility.Visible;
                List.Visibility      = Visibility.Visible;

                CreateButton.IsEnabled = true;

                if (InstanceRadio.IsChecked == true)
                {
                    NameControlsShow();
                }
                else
                {
                    NameControlsHide();
                }
            }
            else
            {
                ListLabel.Visibility = Visibility.Hidden;
                List.Visibility      = Visibility.Hidden;

                CreateButton.IsEnabled = false;

                NameControlsHide();
            }
        }
Beispiel #9
0
        internal void AddTransitionEdge(string fromCommitSha, string fromCommitPath, long fromAstId, BaseNode destNode, BaseEdge edge)
        {
            var query = this.client.Cypher
                        .MatchQuerry("n1", new AstElement()
            {
                AstId = fromAstId, FilePath = fromCommitPath, CommitSha = fromCommitSha
            })
                        .MatchQuerry("n2", destNode)
                        .Create("(n1)-[:" + edge.GetType().Name + " {newEdge}]->(n2)")
                        .WithParam("newEdge", edge);

            query.ExecuteWithoutResults();
        }