Changeset 8598:7b0818c9c740 in orange


Ignore:
Timestamp:
08/04/11 13:59:30 (3 years ago)
Author:
miha <miha.stajdohar@…>
Branch:
default
Convert:
6268717669497fa2fb705d2d8dab2a7bfd7ffb59
Message:
 
Location:
orange/OrangeWidgets/Prototypes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orange/OrangeWidgets/Prototypes/OWNxCanvasQt.py

    r8592 r8598  
    5252        return selected 
    5353   
    54     def get_selected_nodes(self): 
    55         return [vertex.index() for vertex in self.nodes().itervalues() if vertex.is_selected()] 
     54#    def get_selected_nodes(self): 
     55#        return [vertex.index() for vertex in self.networkCurve.nodes().itervalues() if vertex.is_selected()] 
    5656 
    5757    def get_unselected_nodes(self): 
    58         return [vertex.index() for vertex in self.nodes().itervalues() if not vertex.is_selected()] 
     58        return [vertex.index() for vertex in self.networkCurve.nodes().itervalues() if not vertex.is_selected()] 
    5959 
    6060    def get_marked_nodes(self): 
     
    278278     
    279279    def getSelectedGraph(self): 
    280       selection = self.networkCurve.get_selected_nodes() 
    281        
    282       if len(selection) == 0: 
    283           return None 
    284        
    285       subgraph = self.graph.subgraph(selection) 
    286       subnet = Network(subgraph) 
    287       return subnet 
     280        selection = self.networkCurve.get_selected_nodes() 
     281       
     282        if len(selection) == 0: 
     283            return None 
     284       
     285        subgraph = self.graph.subgraph(selection) 
     286        subnet = Network(subgraph) 
     287        return subnet 
    288288     
    289289    def selected_nodes(self): 
    290         return [p.index() for p in self.selected_points()] 
     290        return [vertex.index() for vertex in self.networkCurve.nodes().itervalues() if vertex.is_selected()] 
     291        #return [p.index() for p in self.selected_points()] 
    291292     
    292293    def getNeighboursUpTo(self, ndx, dist): 
     
    622623        self.graph = newgraph 
    623624         
     625        if len(remove_nodes) == 0 and len(add_nodes) == 0: 
     626            return False 
     627         
    624628        current_nodes = self.networkCurve.nodes() 
    625629         
     
    673677             
    674678        self.networkCurve.add_edges(edges) 
     679        return True 
    675680         
    676681    def set_graph(self, graph, curve=None, items=None, links=None): 
  • orange/OrangeWidgets/Prototypes/OWNxExplorerQt.py

    r8595 r8598  
    12241224        self.number_of_edges_label = self.graph.number_of_edges() 
    12251225         
    1226         self.networkCanvas.change_graph(self.graph) 
     1226        if not self.networkCanvas.change_graph(self.graph): 
     1227            return 
    12271228         
    12281229        self.compute_network_info() 
Note: See TracChangeset for help on using the changeset viewer.