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)¶ 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
:getPlotPanel
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.refreshDataSeriesWidgets
Re-creates all of the widgets controlling properties of the current DataSeries
instance.-
__init__
(parent, overlayList, displayCtx, frame, plotPanel)¶ 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
.
- parent – The
-
destroy
()¶ Must be called when this
PlotControlPanel
is no longer needed. Removes some property listeners, and calls theSettingsPanel.destroy()
method.
-
getPlotPanel
()¶ Returns the
OverlayPlotPanel
associated with thisPlotControlPanel
.
-
generateCustomPlotPanelWidgets
(groupName)¶ 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)¶ 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
()¶ Re-creates all of the widgets controlling properties of the current
DataSeries
instance.
-
generateDataSeriesWidgets
(ds, groupName)¶ 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()
).- ds – The
-
generateCustomDataSeriesWidgets
(ds, groupName)¶ 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()
).- ds – The
-
_PlotControlPanel__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.
-
_PlotControlPanel__selectedOverlayChanged
(*a)¶ Called when the
DisplayContext.selectedOverlay
orOverlayList
changes.
-
_PlotControlPanel__selectedOverlayNameChanged
(*a)¶ Called when the
Display.name
property for the currently selected overlay changes. Updates the display name of theDataSeries
settings sections if necessary.
-
__module__
= 'fsleyes.controls.plotcontrolpanel'¶
- Override