Esempio n. 1
0
        private void StackPanel_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            FrameworkElement vertexPanel = sender as FrameworkElement;

            YodiiGraphVertex vertex = vertexPanel.DataContext as YodiiGraphVertex;

            _vm.SelectedVertex = null;
            _vm.SelectedVertex = vertex;
        }
Esempio n. 2
0
        /// <summary>
        /// Selects template.
        /// </summary>
        /// <param name="item">Service or plugin.</param>
        /// <param name="container"></param>
        /// <returns></returns>
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item == null)
            {
                return(null);
            }

            YodiiGraphVertex vertex = (YodiiGraphVertex)item;

            if (vertex.IsPlugin)
            {
                return(PluginPropertiesTemplate);
            }
            else
            {
                return(ServicePropertiesTemplate);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Selects template.
        /// </summary>
        /// <param name="item">Service or plugin.</param>
        /// <param name="container"></param>
        /// <returns></returns>
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            if (item == null)
            {
                return(null);
            }

            YodiiGraphVertex vertex = (YodiiGraphVertex)item;

            if (vertex.IsPlugin)
            {
                return(LivePluginDataTemplate);
            }
            else if (vertex.IsService)
            {
                return(LiveServiceDataTemplate);
            }
            return(null);
        }
Esempio n. 4
0
            public ServiceFamily(YodiiGraphVertex rootVertex, YodiiLayout parent)
            {
                SubPlugins  = new Dictionary <IPluginInfo, YodiiGraphVertex>();
                SubServices = new Dictionary <IServiceInfo, ServiceFamily>();

                Debug.Assert(rootVertex.IsService);

                _parent = parent;

                RootVertex     = rootVertex;
                RootVertexSize = _parent.VertexSizes[RootVertex];
                RootService    = rootVertex.LabServiceInfo.ServiceInfo;

                if (RootService.Generalization != null)
                {
                    var generalizationFamily = parent.FindOrCreateServiceFamily(RootService.Generalization);
                    ParentServiceFamily = generalizationFamily;
                    ParentServiceFamily.RegisterSubService(this);
                }
            }
Esempio n. 5
0
        void Graph_VertexAdded(YodiiGraphVertex vertex)
        {
            var control = new VertexControl(vertex);

            if (vertex.IsService)
            {
                if (vertex.LabServiceInfo.ServiceInfo.PositionInGraph.IsValid())
                {
                    control.SetPosition(vertex.LabServiceInfo.ServiceInfo.PositionInGraph);
                }
            }
            else if (vertex.IsPlugin)
            {
                if (vertex.LabPluginInfo.PluginInfo.PositionInGraph.IsValid())
                {
                    control.SetPosition(vertex.LabPluginInfo.PluginInfo.PositionInGraph);
                }
            }

            GraphArea.AddVertex(vertex, control);
            DragBehaviour.SetUpdateEdgesOnMove(control, true);
        }
Esempio n. 6
0
 void Graph_VertexRemoved(YodiiGraphVertex vertex)
 {
     GraphArea.RemoveVertex(vertex);
 }
Esempio n. 7
0
 void Graph_VertexRemoved( YodiiGraphVertex vertex )
 {
     GraphArea.RemoveVertex( vertex );
 }
Esempio n. 8
0
        void Graph_VertexAdded( YodiiGraphVertex vertex )
        {
            var control = new VertexControl( vertex );

            if( vertex.IsService )
            {
                if( vertex.LabServiceInfo.ServiceInfo.PositionInGraph.IsValid() ) control.SetPosition( vertex.LabServiceInfo.ServiceInfo.PositionInGraph );
            }
            else if( vertex.IsPlugin )
            {
                if( vertex.LabPluginInfo.PluginInfo.PositionInGraph.IsValid() ) control.SetPosition( vertex.LabPluginInfo.PluginInfo.PositionInGraph );
            }

            GraphArea.AddVertex( vertex, control );
            DragBehaviour.SetUpdateEdgesOnMove( control, true );
        }
Esempio n. 9
0
 internal void RegisterPlugin(YodiiGraphVertex p)
 {
     Debug.Assert(!SubPlugins.Keys.Contains(p.LabPluginInfo.PluginInfo));
     Debug.Assert(p.LabPluginInfo.PluginInfo.Service == RootService);
     SubPlugins.Add(p.LabPluginInfo.PluginInfo, p);
 }