Exemple #1
0
    def restoreSingleWindow(self,plotWindowInterface):
        '''
        Restores size and position of a single, just-added plot window
        :param plotWindowInterface: an insance of PlotWindowInterface - can be fetchet from PlotFrameWidget using PlotFrameWidgetInstance.plotInterface
        :return: None
        '''
        
        windows_layout_dict = Configuration.getSetting('WindowsLayout')
        # print 'windowsLayoutDict=', windowsLayoutDict
        
        if not windows_layout_dict: return
        
        if str(plotWindowInterface.title) in windows_layout_dict.keys():
            window_data_dict = windows_layout_dict[str(plotWindowInterface.title)]

            from Graphics.GraphicsWindowData import GraphicsWindowData
            
            gwd = GraphicsWindowData()                      
            gwd.fromDict(window_data_dict)
            
            if gwd.winType != 'plot':
                return

            plot_window = self.vm.lastActiveRealWindow
            plot_window.resize(gwd.winSize)
            plot_window.move(gwd.winPosition)
            plot_window.setWindowTitle(plotWindowInterface.title)
Exemple #2
0
    def restore_plots_layout(self):
        ''' This function restores plot layout - it is called from CompuCellSetup.py inside mainLoopNewPlayer function
        :return: None
        '''

        windows_layout_dict = Configuration.getSetting('WindowsLayout')

        if not windows_layout_dict:
            return

        for winId, win in self.vm.win_inventory.getWindowsItems(PLOT_WINDOW_LABEL):
            plot_frame_widget = win.widget()

            plot_interface = plot_frame_widget.plotInterface()  # plot_frame_widget.plotInterface is a weakref

            if not plot_interface:  # if weakref to plot_interface is None we ignore such window
                continue

            if str(plot_interface.title ) in windows_layout_dict.keys():
                window_data_dict = windows_layout_dict[str(plot_interface.title)]

                from Graphics.GraphicsWindowData import GraphicsWindowData

                gwd = GraphicsWindowData()
                gwd.fromDict(window_data_dict)

                if gwd.winType != 'plot':
                    return
                win.resize(gwd.winSize)
                win.move(gwd.winPosition)
                win.setWindowTitle(plot_interface.title)
Exemple #3
0
    def restoreSingleWindow(self, plotWindowInterface):
        '''
        Restores size and position of a single, just-added plot window
        :param plotWindowInterface: an insance of PlotWindowInterface - can be fetchet from PlotFrameWidget using PlotFrameWidgetInstance.plotInterface
        :return: None
        '''

        windows_layout_dict = Configuration.getSetting('WindowsLayout')
        # print 'windowsLayoutDict=', windowsLayoutDict

        if not windows_layout_dict: return

        if str(plotWindowInterface.title) in windows_layout_dict.keys():
            window_data_dict = windows_layout_dict[str(
                plotWindowInterface.title)]

            from Graphics.GraphicsWindowData import GraphicsWindowData

            gwd = GraphicsWindowData()
            gwd.fromDict(window_data_dict)

            if gwd.winType != 'plot':
                return

            plot_window = self.vm.lastActiveRealWindow
            plot_window.resize(gwd.winSize)
            plot_window.move(gwd.winPosition)
            plot_window.setWindowTitle(plotWindowInterface.title)
Exemple #4
0
    def restore_plots_layout(self):
        ''' This function restores plot layout - it is called from CompuCellSetup.py inside mainLoopNewPlayer function
        :return: None
        '''

        windows_layout_dict = Configuration.getSetting('WindowsLayout')

        if not windows_layout_dict:
            return

        for winId, win in self.vm.win_inventory.getWindowsItems(
                PLOT_WINDOW_LABEL):
            plot_frame_widget = win.widget()

            plot_interface = plot_frame_widget.plotInterface(
            )  # plot_frame_widget.plotInterface is a weakref

            if not plot_interface:  # if weakref to plot_interface is None we ignore such window
                continue

            if str(plot_interface.title) in windows_layout_dict.keys():
                window_data_dict = windows_layout_dict[str(
                    plot_interface.title)]

                from Graphics.GraphicsWindowData import GraphicsWindowData

                gwd = GraphicsWindowData()
                gwd.fromDict(window_data_dict)

                if gwd.winType != 'plot':
                    return
                win.resize(gwd.winSize)
                win.move(gwd.winPosition)
                win.setWindowTitle(plot_interface.title)
Exemple #5
0
    def getPlotWindowsLayoutDict(self):
        windowsLayout = {}
        from Graphics.GraphicsWindowData import GraphicsWindowData

        for winId, win in self.vm.win_inventory.getWindowsItems(
                PLOT_WINDOW_LABEL):
            plotFrameWidget = win.widget()
            plotInterface = plotFrameWidget.plotInterface()  # getting weakref
            if not plotInterface:
                continue

            gwd = GraphicsWindowData()
            gwd.sceneName = plotInterface.title
            gwd.winType = 'plot'
            plotWindow = plotInterface.plotWindow
            mdiPlotWindow = win
            # mdiPlotWindow = self.vm.findMDISubWindowForWidget(plotWindow)
            print 'plotWindow=', plotWindow
            print 'mdiPlotWindow=', mdiPlotWindow
            gwd.winSize = mdiPlotWindow.size()
            gwd.winPosition = mdiPlotWindow.pos()

            windowsLayout[gwd.sceneName] = gwd.toDict()

        return windowsLayout
Exemple #6
0
    def getPlotWindowsLayoutDict(self):
        windowsLayout = {}
        from Graphics.GraphicsWindowData import GraphicsWindowData



        for winId, win in self.vm.win_inventory.getWindowsItems(PLOT_WINDOW_LABEL):
            plotFrameWidget = win.widget()
            plotInterface = plotFrameWidget.plotInterface() # getting weakref
            if not plotInterface:
                continue

            gwd = GraphicsWindowData()
            gwd.sceneName = plotInterface.title
            gwd.winType = 'plot'
            plotWindow = plotInterface.plotWindow
            mdiPlotWindow = win
            # mdiPlotWindow = self.vm.findMDISubWindowForWidget(plotWindow)
            print 'plotWindow=',plotWindow
            print 'mdiPlotWindow=',mdiPlotWindow
            gwd.winSize = mdiPlotWindow.size()
            gwd.winPosition = mdiPlotWindow.pos()

            windowsLayout[gwd.sceneName] = gwd.toDict()

        return windowsLayout