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 a OverlayPlotPanel. The PlotControlPanel may be used as is, or may be sub-classed for more customisation.

Sub-class implementations may:

The first two methods are called by __init__(), and the created widgets persist for the lifetime of the PlotControlPanel. The last two methods are called whenever the DisplayContext.selectedOverlay changes, and may also be called at other times.

The following methods are available on a PlotControlPanel:

getPlotPanel Returns the OverlayPlotPanel associated with this PlotControlPanel.
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:
destroy()

Must be called when this PlotControlPanel is no longer needed. Removes some property listeners, and calls the SettingsPanel.destroy() method.

getPlotPanel()

Returns the OverlayPlotPanel associated with this PlotControlPanel.

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 given PlotPanel 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 given DataSeries 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)

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()).

_PlotControlPanel__autoScaleChanged(*a)

Called when the PlotPanel.xAutoScale or PlotPanel.yAutoScale properties change. If widgets have been created for the PlotPanel.limits, they are enabled/disabled according to the new xAutoScale yAutoScale value.

_PlotControlPanel__selectedOverlayChanged(*a)

Called when the DisplayContext.selectedOverlay or OverlayList changes.

_PlotControlPanel__selectedOverlayNameChanged(*a)

Called when the Display.name property for the currently selected overlay changes. Updates the display name of the DataSeries settings sections if necessary.

__module__ = 'fsleyes.controls.plotcontrolpanel'