コード例 #1
0
 def updateDisabledWidgets(self,  msg=None):
     # subscriptions: 
     # - newCorpus
     receive(self.updateDisabledWidgets, msg)
     
     for menuItem in self.disabledMenuItems:
         menuItem.Enable(True)
コード例 #2
0
    def updateAutoFolded(self, msg=None):
        receive(self.updateAutoFolded, msg)

        if self.viewMenu.isChecked("Auto Fold Equals"):
            from_graph = self.aligner.get_from_graph()
            to_graph = self.aligner.get_to_graph()

            from_equal_nodes, to_equal_nodes = \
            self.aligner.get_auto_fold_equal_nodes()

            for from_node in from_equal_nodes:
                self.dotGraphPair.from_subgraph._fold_node(
                    from_graph, from_node)

            for to_node in to_equal_nodes:
                self.dotGraphPair.to_subgraph._fold_node(to_graph, to_node)
        else:
            # Unfolding only the auto-folded nodes is difficult, because one
            # or more predecessors of an auto-folded nody may have been be
            # manually folded. We obviously cannot unfold a subtree without
            # unfolding the folded predecesors as well. Keeping track of these
            # relations would require a lot of administration. Instead we just
            # unfold all nodes.
            self.dotGraphPair.from_subgraph.unfold_all()
            self.dotGraphPair.to_subgraph.unfold_all()
コード例 #3
0
 def initRelationView(self, msg=None):
     receive(self.initRelationView, msg)
     sizer = self.GetSizer()
     sizer.Detach(self.relView)
     self.relView.Destroy()
     self.relView = RelationView(self, self.aligner)
     sizer.Insert(1, self.relView, 0, wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM, border=10)
     sizer.Layout()
コード例 #4
0
 def updateSplitterWindow(self, msg=None):
     # subscriptions: 
     # - newCorpus        
     receive(self.updateSplitterWindow, msg)
     bottom = self.splitterWindow.GetWindow2()
     bestSize = bottom.GetBestSize()[1]
     self.splitterWindow.SetMinimumPaneSize(bestSize)
     self.splitterWindow.SetSashPosition(-bestSize)
コード例 #5
0
 def updateWindowTitle(self, msg=None):
     # subscriptions: 
     # - newCorpus      
     receive(self.updateWindowTitle, msg)
     name = self.aligner.get_corpus_filename()
     
     if name:
         self.SetTitle("Algraeph: %s (%s)" % (basename(name), dirname(name)))
     else:
         self.SetTitle("Algraeph")
コード例 #6
0
ファイル: commentview.py プロジェクト: emsrc/algraeph
 def updateText(self, msg=None):
     receive(self.updateText, msg)
     
     text = self.aligner.get_comment()
     
     # text received from aligner has \n for newlines
     if wx.Platform == "__WXMSW__": 
         text = text.replace("\n", "\r\n")
         
     self.SetValue(text)
コード例 #7
0
    def updateText(self, msg=None):
        receive(self.updateText, msg)

        text = self.aligner.get_comment()

        # text received from aligner has \n for newlines
        if wx.Platform == "__WXMSW__":
            text = text.replace("\n", "\r\n")

        self.SetValue(text)
コード例 #8
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
    def updateNodeFocus(self, msg=None):
        receive(self.updateNodeFocus, msg)

        from_graph = self.aligner.get_from_graph()
        to_graph = self.aligner.get_to_graph()

        from_node = self.aligner.get_from_node()
        self.dotGraphPair.from_subgraph.update_node_focus(from_node)

        to_node = self.aligner.get_to_node()
        self.dotGraphPair.to_subgraph.update_node_focus(to_node)
コード例 #9
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
    def updateNodeFocus(self, msg=None): 
        receive(self.updateNodeFocus, msg)

        from_graph = self.aligner.get_from_graph()
        to_graph = self.aligner.get_to_graph()
        
        from_node = self.aligner.get_from_node()
        self.dotGraphPair.from_subgraph.update_node_focus(from_node)
        
        to_node = self.aligner.get_to_node()
        self.dotGraphPair.to_subgraph.update_node_focus(to_node)
コード例 #10
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
    def updateEdgeFocus(self, msg=None):
        receive(self.updateEdgeFocus, msg)

        self.dotGraphPair.clear_edge_focus()

        from_node = self.aligner.get_from_node()
        to_node = self.aligner.get_aligned_to_node()
        self.dotGraphPair.update_edge_focus(from_node, to_node)

        to_node = self.aligner.get_to_node()
        from_node = self.aligner.get_aligned_from_node()
        self.dotGraphPair.update_edge_focus(from_node, to_node)
コード例 #11
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateCoSelectedNode(self, msg=None):
     receive(self.updateCoSelectedNode, msg)
     
     from_node = self.aligner.get_from_node()
     
     if from_node:
         self.aligner.set_from_node(from_node)
     else:
         to_node = self.aligner.get_to_node()
     
         if to_node:
             self.aligner.set_to_node(to_node)
コード例 #12
0
    def updateStatusbarCounter(self, msg=None):
        # subscriptions:
        # - statusDescription
        receive(self.updateStatusbarCounter, msg)
        self.statusBar.SetStatusText("%d of %d graph pairs" % self.aligner.get_graph_pair_counter(), 1)

        name = self.aligner.get_corpus_filename()
        
        if name:
            self.SetTitle("Algraeph:  %s  (%s)" % ( basename(name), dirname(name)))
        else:
            self.SetTitle("Algraeph")
コード例 #13
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateEdgeFocus(self, msg=None): 
     receive(self.updateEdgeFocus, msg)
     
     self.dotGraphPair.clear_edge_focus()  
     
     from_node = self.aligner.get_from_node()
     to_node = self.aligner.get_aligned_to_node()
     self.dotGraphPair.update_edge_focus(from_node, to_node) 
     
     to_node= self.aligner.get_to_node()
     from_node = self.aligner.get_aligned_from_node()
     self.dotGraphPair.update_edge_focus(from_node, to_node) 
コード例 #14
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
    def updateCoSelectedNode(self, msg=None):
        receive(self.updateCoSelectedNode, msg)

        from_node = self.aligner.get_from_node()

        if from_node:
            self.aligner.set_from_node(from_node)
        else:
            to_node = self.aligner.get_to_node()

            if to_node:
                self.aligner.set_to_node(to_node)
コード例 #15
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
    def updateHtmlPage(self, msg=None):
        """
        reload html page and reposition scroll bars
        """
        receive(self.updateHtmlPage, msg)

        # Backup current scroll positions
        # This is not perfect, because the size of the image may change
        # (e.g. with or without dependency relation labels)
        xpos, ypos = self.GetViewStart()

        html = get_html()
        self.SetPage(html)

        # Restore scroll positions
        self.Scroll(xpos, ypos)
コード例 #16
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateHtmlPage(self, msg=None):
     """
     reload html page and reposition scroll bars
     """
     receive(self.updateHtmlPage, msg)
     
     # Backup current scroll positions
     # This is not perfect, because the size of the image may change
     # (e.g. with or without dependency relation labels)
     xpos, ypos = self.GetViewStart()
     
     html = get_html()
     self.SetPage(html)
     
     # Restore scroll positions
     self.Scroll(xpos, ypos)
コード例 #17
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
    def updateAutoFolded(self, msg=None):
        receive(self.updateAutoFolded, msg)

        if self.viewMenu.isChecked("Auto Fold Equals"):  
            from_graph = self.aligner.get_from_graph()
            to_graph = self.aligner.get_to_graph()

            from_equal_nodes, to_equal_nodes = \
            self.aligner.get_auto_fold_equal_nodes()
        
            for from_node in from_equal_nodes:
                self.dotGraphPair.from_subgraph._fold_node(from_graph, from_node)
                
            for to_node in to_equal_nodes:
                self.dotGraphPair.to_subgraph._fold_node(to_graph, to_node)
        else:
            # Unfolding only the auto-folded nodes is difficult, because one
            # or more predecessors of an auto-folded nody may have been be
            # manually folded. We obviously cannot unfold a subtree without
            # unfolding the folded predecesors as well. Keeping track of these
            # relations would require a lot of administration. Instead we just
            # unfold all nodes.
            self.dotGraphPair.from_subgraph.unfold_all()
            self.dotGraphPair.to_subgraph.unfold_all()
コード例 #18
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateFolded(self, msg):
     receive(self.updateFolded, msg)
     
     self.dotGraphPair.from_subgraph.update_folded()
     self.dotGraphPair.to_subgraph.update_folded()
コード例 #19
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def unfoldAllNodes(self, msg=None):
     receive(self.unfoldAllNodes, msg)
     
     self.dotGraphPair.from_subgraph.unfold_all()
     self.dotGraphPair.to_subgraph.unfold_all()
コード例 #20
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateImageMap(self, msg=None):
     """
     call graphviz to update the image map
     """
     receive(self.updateImageMap, msg)
     update_image_map(self.dotGraphPair.to_string())
コード例 #21
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateImageFile(self, msg=None):
     """
     call graphviz to update the image file
     """
     receive(self.updateImageFile, msg)
     update_image_file(self.dotGraphPair.to_string())
コード例 #22
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateImageMap(self, msg=None):
     """
     call graphviz to update the image map
     """
     receive(self.updateImageMap, msg)
     update_image_map(self.dotGraphPair.to_string())
コード例 #23
0
ファイル: tokenview.py プロジェクト: emsrc/algraeph
 def updateTokens(self, msg=None):
     receive(self.updateTokens, msg)
     self.SetValue(self.getTokens())
コード例 #24
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateFromGraph(self, msg=None):  
     receive(self.updateFromGraph, msg)
     from_graph = self.aligner.get_from_graph()
     self.dotGraphPair.from_subgraph.update_structure(from_graph)
コード例 #25
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateFromGraph(self, msg=None):
     receive(self.updateFromGraph, msg)
     from_graph = self.aligner.get_from_graph()
     self.dotGraphPair.from_subgraph.update_structure(from_graph)
コード例 #26
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateToGraph(self, msg=None):
     receive(self.updateToGraph, msg)
     to_graph = self.aligner.get_to_graph()
     self.dotGraphPair.to_subgraph.update_structure(to_graph)
コード例 #27
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateAlignment(self, msg=None):
     receive(self.updateAlignment, msg)
     from_graph = self.aligner.get_from_graph()
     to_graph = self.aligner.get_to_graph()
     graph_pair = self.aligner.get_graph_pair()
     self.dotGraphPair.update_structure(graph_pair, from_graph, to_graph)
コード例 #28
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
    def updateFolded(self, msg):
        receive(self.updateFolded, msg)

        self.dotGraphPair.from_subgraph.update_folded()
        self.dotGraphPair.to_subgraph.update_folded()
コード例 #29
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
    def unfoldAllNodes(self, msg=None):
        receive(self.unfoldAllNodes, msg)

        self.dotGraphPair.from_subgraph.unfold_all()
        self.dotGraphPair.to_subgraph.unfold_all()
コード例 #30
0
 def updateDisabledWidgets(self, msg):
     # subscriptions: 
     # - newCorpus
     receive(self.updateDisabledWidgets, msg)
     self.Enable()
コード例 #31
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateToGraph(self, msg=None): 
     receive(self.updateToGraph, msg)
     to_graph = self.aligner.get_to_graph()
     self.dotGraphPair.to_subgraph.update_structure(to_graph)
コード例 #32
0
 def updateStatusbar(self, msg=None):
     # subscriptions:
     # - statusDescription
     
     receive(self.updateStatusbar, msg)
     self.statusBar.SetStatusText(msg.data or "Ready", 0)
コード例 #33
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateAlignment(self, msg=None):
     receive(self.updateAlignment, msg)
     from_graph = self.aligner.get_from_graph()
     to_graph = self.aligner.get_to_graph()
     graph_pair = self.aligner.get_graph_pair()
     self.dotGraphPair.update_structure(graph_pair, from_graph, to_graph)        
コード例 #34
0
ファイル: tokenview.py プロジェクト: emsrc/algraeph
 def updateTokens(self, msg=None):
     receive(self.updateTokens, msg)
     self.SetValue(self.getTokens())
コード例 #35
0
ファイル: graphview.py プロジェクト: emsrc/algraeph
 def updateImageFile(self, msg=None):
     """
     call graphviz to update the image file
     """
     receive(self.updateImageFile, msg)
     update_image_file(self.dotGraphPair.to_string())