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.SettingsPanelThe
PlotControlPanelis a FSLeyes control panel which allows the user to control aOverlayPlotPanel. ThePlotControlPanelmay 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 controllingPlotPanelproperties.Override
generateCustomPlotPanelWidgets()to create a new group of widgets controllingPlotPanelproperties.Override
generateDataSeriesWidgets()to add to the default group of widgets controllingDataSeriesproperties.Override
generateDataSeriesWidgets()to create a new group of widgets controllingDataSeriesproperties.
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.selectedOverlaychanges, and may also be called at other times.The following methods are available on a
PlotControlPanel:Returns the
OverlayPlotPanelassociated with thisPlotControlPanel.getWidgetListReturns the
fsleyes_widgets.WidgetListwhich should be used by sub-classes to display content to the user.Re-creates all of the widgets controlling properties of the current
DataSeriesinstance.-
__init__(parent, overlayList, displayCtx, frame, plotPanel)[source]¶ Create a
PlotControlPanel.- Parameters
parent – The
wxparent object.overlayList – The
OverlayList.displayCtx – The
DisplayContextinstance.frame – The
FSLeyesFrameinstance.plotPanel – The
PlotPanelassociated with thisPlotControlPanel.
-
destroy()[source]¶ Must be called when this
PlotControlPanelis no longer needed. Removes some property listeners, and calls theSettingsPanel.destroy()method.
-
getPlotPanel()[source]¶ Returns the
OverlayPlotPanelassociated with thisPlotControlPanel.
-
generateCustomPlotPanelWidgets(groupName)[source]¶ May be overridden by sub-classes to add a group of widgets controlling
OverlayPlotPanelproperties. The default implementation does nothing.- Parameters
groupName – The
WidgetListgroup 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 givenPlotPanelinstance 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
WidgetListgroup 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
DataSeriesinstance.
-
generateDataSeriesWidgets(ds, groupName)[source]¶ Adds a collection of widgets to the given
WidgetList, allowing the properties of the givenDataSeriesinstance to be changed. This method may be overridden by sub-classes which need to customise the list of widgets.- Parameters
ds – The
DataSeriesinstance.groupName – The
WidgetListgroup 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
DataSeriesproperties. The default implementation does nothing.- Parameters
ds – The
DataSeriesinstance.groupName – The
WidgetListgroup 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.xAutoScaleorPlotPanel.yAutoScaleproperties change. If widgets have been created for thePlotPanel.limits, they are enabled/disabled according to the newxAutoScaleyAutoScalevalue.
-
_PlotControlPanel__selectedOverlayChanged(*a)¶ Called when the
DisplayContext.selectedOverlayorOverlayListchanges.
-
_PlotControlPanel__selectedOverlayNameChanged(*a)¶ Called when the
Display.nameproperty for the currently selected overlay changes. Updates the display name of theDataSeriessettings sections if necessary.
-
__module__= 'fsleyes.controls.plotcontrolpanel'¶