Beispiel #1
0
 public ConnectionViewModel(DiagramViewModel diagramViewModel)
 {
     DiagramViewModel = diagramViewModel;
 }
Beispiel #2
0
 public void Save()
 {
     DiagramViewModel.Save();
 }
 protected DiagramNodeViewModel(TData graphItemObject, DiagramViewModel diagramViewModel)
     : base(graphItemObject, diagramViewModel)
 {
 }
 public GenericNodeViewModel(TData graphItemObject, DiagramViewModel diagramViewModel)
     : base(graphItemObject, diagramViewModel)
 {
 }
Beispiel #5
0
 public DiagramDrawer(DiagramViewModel viewModel)
 {
     DiagramViewModel = viewModel;
 }
Beispiel #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);
                    }
                }
            }
        }
Beispiel #7
0
 public NoteNodeViewModel(NoteNode graphItemObject, DiagramViewModel diagramViewModel) : base(graphItemObject, diagramViewModel)
 {
 }
 public ScreenshotNodeViewModel(ScreenshotNode graphItemObject, DiagramViewModel diagramViewModel) : base(graphItemObject, diagramViewModel)
 {
 }
Beispiel #9
0
 public void CreateConnectionMenu(ConnectionHandler viewModel, DiagramViewModel diagramViewModel, MouseEvent mouseEvent)
 {
 }
Beispiel #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);
        }
 public ImageNodeViewModel(ImageNode graphItemObject, DiagramViewModel diagramViewModel) : base(graphItemObject, diagramViewModel)
 {
 }
 public DiagramInputHander(DiagramViewModel diagramViewModel)
 {
     DiagramViewModel = diagramViewModel;
 }
Beispiel #13
0
 public TypeReferenceNodeViewModel(TypeReferenceNode graphItemObject, DiagramViewModel diagramViewModel) : base(graphItemObject, diagramViewModel)
 {
 }
Beispiel #14
0
 public ConnectorInfo(ConnectorViewModel[] allConnectors, DiagramViewModel viewModel)
 {
     AllConnectors    = allConnectors;
     DiagramData      = viewModel.GraphData;
     DiagramViewModel = viewModel;
 }