コード例 #1
0
 private MVG.GraphProperty CreateNewGraphProperty(string attribute, Type dataType)
 {
     MVG.GraphProperty genericName = Properties.AddNewProperty(attribute, dataType);
     PropertiesMap[attribute] = new Dictionary <Type, MVG.GraphProperty> {
         [dataType] = genericName
     };
     return(genericName);
 }
コード例 #2
0
ファイル: Vertex.cs プロジェクト: sajens/MAIME
        /// <summary>
        /// Visualization on vertex
        /// </summary>
        public void CreateVisualNode()
        {
            MVG.GraphNode nodeA = Program.VisualGraph.Graph.Nodes.GetOrCreate(ComponentRef.Name);

            Program.VisualGraph.LinkNodes.Add(ComponentRef.ID, nodeA);
            nodeA.Label = ComponentRef.Name;

            MVG.GraphProperty property = Program.VisualGraph.GetOrAddAttribute(
                "ComponentClass", typeof(string));

            nodeA[property] = Graph.Application.PipelineComponentInfos[ComponentRef.ComponentClassID].Name;
        }
コード例 #3
0
        /// <summary>
        /// Create a link between two vertices, when visualizing the graph
        /// </summary>
        public void CreateVisualLinks()
        {
            MVG.GraphLink graphLink = Program.VisualGraph.Graph.Links.GetOrCreate(
                Program.VisualGraph.LinkNodes[Source.ComponentRef.ID], Program.VisualGraph.LinkNodes[Destination.ComponentRef.ID]);

            graphLink.Label = Path.Name;

            // TODO: Improve to add type of property
            if (Attributes != null)
            {
                foreach (Attribute attribute in Attributes)
                {
                    MVG.GraphProperty property = Program.VisualGraph.GetOrAddAttribute(
                        "Attribute", typeof(string));

                    graphLink[property] = attribute.Name;
                }
            }
        }