Ejemplo n.º 1
0
    def OnAddFigure(self, event):
        if len(DataStore.getData()) == 0:
            return
        
        nameDlg = displayDialogs.EditNameDialog(self, '')
        if (nameDlg.ShowModal() == wx.ID_OK):
            newFig = Figure(nameDlg.Text, [dv.Subplot()], 1, (1,1), (0,1))
            currFig = FigureStore.getSelectedFigure() 
            FigureStore.add(newFig)
            dv.switchFigures(self.facsPlotPanel, currFig, newFig)
            self.facsPlotPanel.subplots = []  
            self.addSubplot()
    
            self.treeCtrlPanel.updateTree()   

        nameDlg.Destroy()
Ejemplo n.º 2
0
 def selectItemTreeSelection(self, rightClick=False):
     """
     Using the selected tree item, set the corresponding object 
     in the data store as the current selection.
     """
     item = self.getSanitizedItemSelectionData()
     
     if item is not None:
         if item[0] is DATA_SET_ITEM:
             self.applyToSelection(DataStore.selectDataSet, FacsData.selectClustering)
         
         if item[0] is FIGURE_SET_ITEM and not rightClick:
             if item[1] != FigureStore.getSelectedIndex():
                 currFig = FigureStore.getSelectedFigure()
                 newFig = FigureStore.get(item[1])
                 switchFigures(self.Parent.TopLevelParent.facsPlotPanel, currFig, newFig, True)
                 self.Parent.TopLevelParent.selectAxes(newFig.axes)
                 FigureStore.setSelectedFigure(item[1])