diff --git a/fsl/fsleyes/controls/timeseriescontrolpanel.py b/fsl/fsleyes/controls/timeseriescontrolpanel.py index 9787fc16ffd5686f532ef4311caaefdd491bb209..b8c26c6f6e839d19a4a9e445375cced700c690ec 100644 --- a/fsl/fsleyes/controls/timeseriescontrolpanel.py +++ b/fsl/fsleyes/controls/timeseriescontrolpanel.py @@ -203,7 +203,7 @@ class TimeSeriesControlPanel(fslpanel.FSLEyesPanel): if overlay is None: return - ts = self.__tsPanel.getTimeSeries(overlay) + ts = self.__tsPanel.getDataSeries(overlay) if ts is None: return diff --git a/fsl/fsleyes/controls/timeserieslistpanel.py b/fsl/fsleyes/controls/timeserieslistpanel.py index 76d469d762ffd42a0990ade5a30483d69c965494..b8c176af0dbf9d9e1f5ecefbf263f1d4c6b7225a 100644 --- a/fsl/fsleyes/controls/timeserieslistpanel.py +++ b/fsl/fsleyes/controls/timeserieslistpanel.py @@ -134,7 +134,7 @@ class TimeSeriesListPanel(fslpanel.FSLEyesPanel): overlay = self._displayCtx.getSelectedOverlay() - ts = self.__tsPanel.getTimeSeries(overlay) + ts = self.__tsPanel.getDataSeries(overlay) if ts is None: self.__currentLabel.SetLabel('') @@ -157,7 +157,7 @@ class TimeSeriesListPanel(fslpanel.FSLEyesPanel): if overlay is None: return - ts = self.__tsPanel.getTimeSeries(overlay) + ts = self.__tsPanel.getDataSeries(overlay) if ts is None: return diff --git a/fsl/fsleyes/views/plotpanel.py b/fsl/fsleyes/views/plotpanel.py index e80aa4b782ebd24f5dc04a026b658effb3eac796..6e04dd2277ad16f75f3563d75157dafcc35dda01 100644 --- a/fsl/fsleyes/views/plotpanel.py +++ b/fsl/fsleyes/views/plotpanel.py @@ -58,7 +58,10 @@ class PlotPanel(viewpanel.ViewPanel): 3. Override the :meth:`draw` method, so it calls the :meth:`drawDataSeries` method. - 4. If necessary, override the :meth:`destroy` method, but make + 4. Override the :meth:`getDataSeries` method, so it returns a + :class:`.DataSeries` instance associated with a given overlay. + + 5. If necessary, override the :meth:`destroy` method, but make sure that the base-class implementation is called. @@ -275,6 +278,20 @@ class PlotPanel(viewpanel.ViewPanel): raise NotImplementedError('The draw method must be ' 'implemented by PlotPanel subclasses') + + def getDataSeries(self, overlay): + """This method must be overridden by ``PlotPanel`` sub-classes. + + It may be called by the :class:`.PlotControlPanel` and + :class:`.PlotListPanel` to display controls allowing the user + to change :class:`.DataSeries` display properties. + + It should return the :class:`.DataSeries` instance associated with + the given overlay, or ``None`` if there is no ``DataSeries`` instance. + """ + raise NotImplementedError('The getDataSeries method must be ' + 'implemented by PlotPanel subclasses') + def destroy(self): """Removes some property listeners, and then calls diff --git a/fsl/fsleyes/views/timeseriespanel.py b/fsl/fsleyes/views/timeseriespanel.py index 4dc88389572acc2399e1dd127258e8d689bffd31..4271c6528a62785d7a54808f33ded2e51d5ac253 100644 --- a/fsl/fsleyes/views/timeseriespanel.py +++ b/fsl/fsleyes/views/timeseriespanel.py @@ -291,9 +291,10 @@ class TimeSeriesPanel(plotpanel.PlotPanel): preproc=self.__prepareTimeSeriesData) - def getTimeSeries(self, overlay): - """Returns the :class:`.TimeSeries` instance for the specified - overlay, or ``None`` if there is none. + def getDataSeries(self, overlay): + """Overrides :meth:`.PlotPanel.getDataSeries`. Returns the + :class:`.TimeSeries` instance for the specified overlay, or ``None`` + if there is none. """ return self.__currentTss.get(overlay)