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, plotPanel)[source]¶ Bases:
fsleyes.controls.controlpanel.SettingsPanelThe
PlotControlPanelis a FSLeyes control panel which allows the user to control aOverlayPlotPanel. ThePlotControlPanelis intended to be sub-classed.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.-
static
supportedViews()[source]¶ The
PlotControlPanelis restricted for use withOverlayPlotPanelviews. This method may be overridden by sub-classes.
-
__init__(parent, overlayList, displayCtx, plotPanel)[source]¶ Create a
PlotControlPanel.- Parameters
parent – The
wxparent object.overlayList – The
OverlayList.displayCtx – The
DisplayContextinstance.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.
-
property
plotPanel¶ Returns the
OverlayPlotPanelassociated with thisPlotControlPanel.
-
property
plotCanvas¶ Returns the
PlotCanvasassociated 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()).
-
__selectedOverlayNameChanged(*a)¶ Called when the
Display.nameproperty for the currently selected overlay changes. Updates the display name of theDataSeriessettings sections if necessary.
-
__selectedOverlayChanged(*a)¶ Called when the
DisplayContext.selectedOverlayorOverlayListchanges.
-
__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.
-
__module__= 'fsleyes.controls.plotcontrolpanel'¶