internal BrainstormControl OpenNewBrainstorm()
        {
            BrainstormControl brainstorm_control = new BrainstormControl();

            main_window.DockingManager.AddContent("Brainstorm" + Guid.NewGuid(), "Brainstorm", Icons.GetAppIcon(Icons.ModuleBrainstorm), true, true, brainstorm_control);
            return(brainstorm_control);
        }
        internal void ExploreAutoTagInBrainstorm(string library_id, string tag)
        {
            BrainstormControl     brainstorm_control = Instance.OpenNewBrainstorm();
            PDFAutoTagNodeContent content            = new PDFAutoTagNodeContent(library_id, tag);
            NodeControl           node_control       = brainstorm_control.SceneRenderingControl.AddNewNodeControlInScreenCentre(content);

            brainstorm_control.AutoArrange = true;

            PDFAutoTagNodeContentControl content_control = node_control.NodeContentControl as PDFAutoTagNodeContentControl;

            content_control.ExpandDocuments();
        }
예제 #3
0
        public static void Test()
        {
            Library l = Library.GuestInstance;

            Thread.Sleep(1000);

            BrainstormControl bc = new BrainstormControl();

            //SampleSceneGenerator.CreateSampleScene_Coordinates(bc.ObjSceneRenderingControlScrollWrapper.ObjSceneRenderingControl);
            //SampleSceneGenerator.CreateSampleScene_Spiral(bc.ObjSceneRenderingControlScrollWrapper.ObjSceneRenderingControl);
            bc.SceneRenderingControl.OpenFromDisk(@"C:\temp\untitled.brain");
            ControlHostingWindow window = new ControlHostingWindow("SceneRenderer", bc);

            window.Show();
        }
        internal void ExploreTopicInBrainstorm(Library library, int topic)
        {
            ExpeditionDataSource eds = library.ExpeditionManager.ExpeditionDataSource;
            string topic_name        = eds.GetDescriptionForTopic(topic, false, "\n");

            BrainstormControl brainstorm_control = Instance.OpenNewBrainstorm();
            ThemeNodeContent  tnc          = new ThemeNodeContent(topic_name, library.WebLibraryDetail.Id);
            NodeControl       node_control = brainstorm_control.SceneRenderingControl.AddNewNodeControlInScreenCentre(tnc);

            brainstorm_control.AutoArrange = true;

            // Then expand the interesting documents - old style
            //ThemeNodeContentControl node_content_control = node_control.NodeContentControl as ThemeNodeContentControl;
            //node_content_control.ExpandSpecificDocuments();
            //node_content_control.ExpandInfluentialDocuments();

            // Then expand the interesting documents
            {
                // Thmeme docs
                brainstorm_control.SceneRenderingControl.SelectAll();
                brainstorm_control.SceneRenderingControl.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(brainstorm_control.SceneRenderingControl), 0, Key.D)
                {
                    RoutedEvent = Keyboard.KeyDownEvent
                });
                brainstorm_control.SceneRenderingControl.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(brainstorm_control.SceneRenderingControl), 0, Key.S)
                {
                    RoutedEvent = Keyboard.KeyDownEvent
                });

                // Authors
                brainstorm_control.SceneRenderingControl.SelectAll();
                brainstorm_control.SceneRenderingControl.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(brainstorm_control.SceneRenderingControl), 0, Key.A)
                {
                    RoutedEvent = Keyboard.KeyDownEvent
                });

                // Their docs
                brainstorm_control.SceneRenderingControl.SelectAll();
                brainstorm_control.SceneRenderingControl.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(brainstorm_control.SceneRenderingControl), 0, Key.D)
                {
                    RoutedEvent = Keyboard.KeyDownEvent
                });
            }

            brainstorm_control.SceneRenderingControl.SetSelectedNodeControl(node_control, false);
        }
        internal void ExploreLibraryInBrainstorm(Library library)
        {
            BrainstormControl brainstorm_control = Instance.OpenNewBrainstorm();

            int WIDTH  = 320;
            int HEIGHT = 240;

            LibraryNodeContent content_library = new LibraryNodeContent(library.WebLibraryDetail.Title, library.WebLibraryDetail.Id);
            NodeControl        node_library    = brainstorm_control.SceneRenderingControl.AddNewNodeControl(content_library, 0, 0, WIDTH, HEIGHT);

            ExpeditionDataSource eds = library.ExpeditionManager.ExpeditionDataSource;

            if (null != eds)
            {
                for (int topic = 0; topic < eds.lda_sampler.NumTopics; ++topic)
                {
                    string           topic_name = eds.GetDescriptionForTopic(topic, false, "\n");
                    ThemeNodeContent tnc        = new ThemeNodeContent(topic_name, library.WebLibraryDetail.Id);
                    NodeControlAddingByKeyboard.AddChildToNodeControl(node_library, tnc);
                }
            }
            else
            {
                {
                    StringNodeContent content_warning = new StringNodeContent("Please run Expedition on your library.");
                    NodeControl       node_warning    = brainstorm_control.SceneRenderingControl.AddNewNodeControl(content_warning, 0, -2 * HEIGHT);
                    brainstorm_control.SceneRenderingControl.AddNewConnectorControl(node_library, node_warning);
                }
                {
                    StringNodeContent content_warning = new StringNodeContent("Then you will get to\nexplore its themes.");
                    NodeControl       node_warning    = brainstorm_control.SceneRenderingControl.AddNewNodeControl(content_warning, -WIDTH, +2 * HEIGHT);
                    brainstorm_control.SceneRenderingControl.AddNewConnectorControl(node_library, node_warning);
                }
                {
                    StringNodeContent content_warning = new StringNodeContent("And you will get to\nexplore its documents.");
                    NodeControl       node_warning    = brainstorm_control.SceneRenderingControl.AddNewNodeControl(content_warning, +WIDTH, +2 * HEIGHT);
                    brainstorm_control.SceneRenderingControl.AddNewConnectorControl(node_library, node_warning);
                }
            }

            brainstorm_control.AutoArrange = true;
        }
        internal void ExploreDocumentInBrainstorm(List <PDFDocument> pdf_documents)
        {
            BrainstormControl brainstorm_control = Instance.OpenNewBrainstorm();
            List <object>     contents           = new List <object>();

            foreach (PDFDocument pdf_document in pdf_documents)
            {
                PDFDocumentNodeContent content = new PDFDocumentNodeContent(pdf_document.Fingerprint, pdf_document.Library.WebLibraryDetail.Id);
                contents.Add(content);
            }
            List <NodeControl> node_controls = brainstorm_control.SceneRenderingControl.AddNewNodeControlsInScreenCentre(contents);

            brainstorm_control.AutoArrange = true;

            // Then expand the interesting documents
            {
                // Authors and themes
                brainstorm_control.SceneRenderingControl.SelectAll();
                brainstorm_control.SceneRenderingControl.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(brainstorm_control.SceneRenderingControl), 0, Key.A)
                {
                    RoutedEvent = Keyboard.KeyDownEvent
                });
                brainstorm_control.SceneRenderingControl.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(brainstorm_control.SceneRenderingControl), 0, Key.M)
                {
                    RoutedEvent = Keyboard.KeyDownEvent
                });

                // All attached docs
                brainstorm_control.SceneRenderingControl.SelectAll();
                brainstorm_control.SceneRenderingControl.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(brainstorm_control.SceneRenderingControl), 0, Key.D)
                {
                    RoutedEvent = Keyboard.KeyDownEvent
                });
                brainstorm_control.SceneRenderingControl.RaiseEvent(new KeyEventArgs(Keyboard.PrimaryDevice, PresentationSource.FromVisual(brainstorm_control.SceneRenderingControl), 0, Key.S)
                {
                    RoutedEvent = Keyboard.KeyDownEvent
                });
            }

            brainstorm_control.SceneRenderingControl.SetSelectedNodeControls(node_controls, false);
        }