fsleyes.controls.plotcontrolpanel
¶
This module provides the PlotControlPanel
class, which is a
FSLeyes control panel base-class for use with OverlayPlotPanel
views.
-
class
fsleyes.controls.plotcontrolpanel.
PlotControlPanel
(parent, overlayList, displayCtx, frame, plotPanel)[source]¶ Bases:
fsleyes.controls.controlpanel.SettingsPanel
The
PlotControlPanel
is a FSLeyes control panel which allows the user to control aOverlayPlotPanel
. ThePlotControlPanel
may be used as is, or may be sub-classed for more customisation.Sub-class implementations may:
Override
generatePlotPanelWidgets()
to add to the default group of widgets controllingPlotPanel
properties.Override
generateCustomPlotPanelWidgets()
to create a new group of widgets controllingPlotPanel
properties.Override
generateDataSeriesWidgets()
to add to the default group of widgets controllingDataSeries
properties.Override
generateDataSeriesWidgets()
to create a new group of widgets controllingDataSeries
properties.
The first two methods are called by
__init__()
, and the created widgets persist for the lifetime of thePlotControlPanel
. The last two methods are called whenever theDisplayContext.selectedOverlay
changes, and may also be called at other times.The following methods are available on a
PlotControlPanel
:Returns the
OverlayPlotPanel
associated with thisPlotControlPanel
.getWidgetList
Returns the
fsleyes_widgets.WidgetList
which should be used by sub-classes to display content to the user.Re-creates all of the widgets controlling properties of the current
DataSeries
instance.-
__init__
(parent, overlayList, displayCtx, frame, plotPanel)[source]¶ Create a
PlotControlPanel
.- Parameters
parent – The
wx
parent object.overlayList – The
OverlayList
.displayCtx – The
DisplayContext
instance.frame – The
FSLeyesFrame
instance.plotPanel – The
PlotPanel
associated with thisPlotControlPanel
.
-
destroy
()[source]¶ Must be called when this
PlotControlPanel
is no longer needed. Removes some property listeners, and calls theSettingsPanel.destroy()
method.
-
getPlotPanel
()[source]¶ Returns the
OverlayPlotPanel
associated with thisPlotControlPanel
.
-
generateCustomPlotPanelWidgets
(groupName)[source]¶ May be overridden by sub-classes to add a group of widgets controlling
OverlayPlotPanel
properties. The default implementation does nothing.- Parameters
groupName – The
WidgetList
group name.- Returns
A list of the widgets that were created, and should be included in keyboard navigation (see
FSLeyesPanel.setNavOrder()
).
-
generatePlotPanelWidgets
(groupName)[source]¶ Adds a collection of widgets to the given
WidgetList
, allowing the properties of the givenPlotPanel
instance to be changed.This method may be overridden by sub-classes to change/add to the list of properties that are added by default.
- Parameters
groupName – The
WidgetList
group name.- Returns
A list of the widgets that were created, and should be included in keyboard navigation (see
FSLeyesPanel.setNavOrder()
).
-
refreshDataSeriesWidgets
()[source]¶ Re-creates all of the widgets controlling properties of the current
DataSeries
instance.
-
generateDataSeriesWidgets
(ds, groupName)[source]¶ Adds a collection of widgets to the given
WidgetList
, allowing the properties of the givenDataSeries
instance to be changed. This method may be overridden by sub-classes which need to customise the list of widgets.- Parameters
ds – The
DataSeries
instance.groupName – The
WidgetList
group name.
- Returns
A list of the widgets that were created, and should be included in keyboard navigation (see
FSLeyesPanel.setNavOrder()
).
-
generateCustomDataSeriesWidgets
(ds, groupName)[source]¶ May be overridden by sub-classes to create a group of widgets for controlling
DataSeries
properties. The default implementation does nothing.- Parameters
ds – The
DataSeries
instance.groupName – The
WidgetList
group name.
- Returns
A list of the widgets that were created, and should be included in keyboard navigation (see
FSLeyesPanel.setNavOrder()
).
-
__selectedOverlayNameChanged
(*a)¶ Called when the
Display.name
property for the currently selected overlay changes. Updates the display name of theDataSeries
settings sections if necessary.
-
__selectedOverlayChanged
(*a)¶ Called when the
DisplayContext.selectedOverlay
orOverlayList
changes.
-
__autoScaleChanged
(*a)¶ Called when the
PlotPanel.xAutoScale
orPlotPanel.yAutoScale
properties change. If widgets have been created for thePlotPanel.limits
, they are enabled/disabled according to the newxAutoScale
yAutoScale
value.
-
__module__
= 'fsleyes.controls.plotcontrolpanel'¶