コード例 #1
0
 public ConnectionViewModel(DiagramViewModel diagramViewModel)
 {
     DiagramViewModel = diagramViewModel;
 }
コード例 #2
0
 public void Save()
 {
     DiagramViewModel.Save();
 }
コード例 #3
0
 protected DiagramNodeViewModel(TData graphItemObject, DiagramViewModel diagramViewModel)
     : base(graphItemObject, diagramViewModel)
 {
 }
コード例 #4
0
 public GenericNodeViewModel(TData graphItemObject, DiagramViewModel diagramViewModel)
     : base(graphItemObject, diagramViewModel)
 {
 }
コード例 #5
0
 public DiagramDrawer(DiagramViewModel viewModel)
 {
     DiagramViewModel = viewModel;
 }
コード例 #6
0
        public void QueryPossibleConnections(SelectionMenu menu, DiagramViewModel diagramViewModel,
                                             ConnectorViewModel startConnector,
                                             Vector2 mousePosition)
        {
            var currentGraph       = InvertApplication.Container.Resolve <WorkspaceService>().CurrentWorkspace.CurrentGraph;
            var allowedFilterNodes = FilterExtensions.AllowedFilterNodes[currentGraph.CurrentFilter.GetType()];

            foreach (var item in allowedFilterNodes)
            {
                if (item.IsInterface)
                {
                    continue;
                }
                if (item.IsAbstract)
                {
                    continue;
                }

                var node = Activator.CreateInstance(item) as IDiagramNode;
                node.Repository = diagramViewModel.CurrentRepository;
                node.GraphId    = currentGraph.Identifier;

                var vm = InvertGraphEditor.Container.GetNodeViewModel(node, diagramViewModel) as DiagramNodeViewModel;


                if (vm == null)
                {
                    continue;
                }
                vm.IsCollapsed = false;
                var connectors = new List <ConnectorViewModel>();
                vm.GetConnectors(connectors);

                var config = InvertGraphEditor.Container.Resolve <NodeConfigBase>(item.Name);
                var name   = config == null ? item.Name : config.Name;
                foreach (var connector in connectors)
                {
                    foreach (var strategy in InvertGraphEditor.ConnectionStrategies)
                    {
                        var connection = strategy.Connect(diagramViewModel, startConnector, connector);
                        if (connection == null)
                        {
                            continue;
                        }
                        var node1   = node;
                        var message = string.Format("Create {0}", name);
                        //if (!string.IsNullOrEmpty(connector.Name))
                        //{
                        //    message += string.Format(" and connect to {0}", connector.Name);
                        //}
                        var value = new KeyValuePair <IDiagramNode, ConnectionViewModel>(node1, connection);

                        var qaItem = new SelectionMenuItem("Connect", message, () =>
                        {
                            diagramViewModel.AddNode(value.Key, mousePosition);
                            connection.Apply(value.Value as ConnectionViewModel);
                            value.Key.IsSelected = true;
                            value.Key.IsEditing  = true;
                            value.Key.Name       = "";
                        });
                        menu.AddItem(qaItem);
                    }
                }
            }
        }
コード例 #7
0
 public NoteNodeViewModel(NoteNode graphItemObject, DiagramViewModel diagramViewModel) : base(graphItemObject, diagramViewModel)
 {
 }
コード例 #8
0
 public ScreenshotNodeViewModel(ScreenshotNode graphItemObject, DiagramViewModel diagramViewModel) : base(graphItemObject, diagramViewModel)
 {
 }
コード例 #9
0
 public void CreateConnectionMenu(ConnectionHandler viewModel, DiagramViewModel diagramViewModel, MouseEvent mouseEvent)
 {
 }
コード例 #10
0
        public static GraphItemViewModel GetNodeViewModel(this IQFrameworkContainer container, IGraphItem item, DiagramViewModel diagram)
        {
            var vm = InvertApplication.Container.ResolveRelation <ViewModel>(item.GetType(), item, diagram) as
                     GraphItemViewModel;

            return(vm);
        }
コード例 #11
0
 public ImageNodeViewModel(ImageNode graphItemObject, DiagramViewModel diagramViewModel) : base(graphItemObject, diagramViewModel)
 {
 }
コード例 #12
0
 public DiagramInputHander(DiagramViewModel diagramViewModel)
 {
     DiagramViewModel = diagramViewModel;
 }
コード例 #13
0
 public TypeReferenceNodeViewModel(TypeReferenceNode graphItemObject, DiagramViewModel diagramViewModel) : base(graphItemObject, diagramViewModel)
 {
 }
コード例 #14
0
ファイル: ConnectorInfo.cs プロジェクト: xubingyue/QFramework
 public ConnectorInfo(ConnectorViewModel[] allConnectors, DiagramViewModel viewModel)
 {
     AllConnectors    = allConnectors;
     DiagramData      = viewModel.GraphData;
     DiagramViewModel = viewModel;
 }