fsleyes.profiles.profilemap
¶
This module is used by the Profile
and ProfileManager
classes.
It defines a few dictionaries which define the profile type to use for each
ViewPanel
type, temporary mouse/keyboard interaction modes, and
alternate mode handlers for the profiles contained in the profiles package.
This dictionary is used by the |
|
This dictionary is used by the |
|
The |
|
The |
-
fsleyes.profiles.profilemap.
profiles
= {<class 'fsleyes.views.orthopanel.OrthoPanel'>: ['view', 'edit', 'crop'], <class 'fsleyes.views.lightboxpanel.LightBoxPanel'>: ['view'], <class 'fsleyes.views.timeseriespanel.TimeSeriesPanel'>: ['view'], <class 'fsleyes.views.histogrampanel.HistogramPanel'>: ['view'], <class 'fsleyes.views.powerspectrumpanel.PowerSpectrumPanel'>: ['view'], <class 'fsleyes.views.scene3dpanel.Scene3DPanel'>: ['view']}¶ This dictionary is used by the
ProfileManager
to figure out which profiles are available for eachViewPanel
. They are added as options to theViewPanel.profile
property.
-
fsleyes.profiles.profilemap.
profileHandlers
= {(<class 'fsleyes.views.orthopanel.OrthoPanel'>, 'view'): <class 'fsleyes.profiles.orthoviewprofile.OrthoViewProfile'>, (<class 'fsleyes.views.orthopanel.OrthoPanel'>, 'edit'): <class 'fsleyes.profiles.orthoeditprofile.OrthoEditProfile'>, (<class 'fsleyes.views.orthopanel.OrthoPanel'>, 'crop'): <class 'fsleyes.profiles.orthocropprofile.OrthoCropProfile'>, (<class 'fsleyes.views.lightboxpanel.LightBoxPanel'>, 'view'): <class 'fsleyes.profiles.lightboxviewprofile.LightBoxViewProfile'>, (<class 'fsleyes.views.timeseriespanel.TimeSeriesPanel'>, 'view'): <class 'fsleyes.profiles.timeseriesprofile.TimeSeriesProfile'>, (<class 'fsleyes.views.histogrampanel.HistogramPanel'>, 'view'): <class 'fsleyes.profiles.histogramprofile.HistogramProfile'>, (<class 'fsleyes.views.powerspectrumpanel.PowerSpectrumPanel'>, 'view'): <class 'fsleyes.profiles.plotprofile.PlotProfile'>, (<class 'fsleyes.views.scene3dpanel.Scene3DPanel'>, 'view'): <class 'fsleyes.profiles.scene3dviewprofile.Scene3DViewProfile'>}¶ This dictionary is used by the
ProfileManager
class to figure out whichProfile
sub-class to create for a givenViewPanel
instance and profile identifier.
-
fsleyes.profiles.profilemap.
tempModeMap
= {<class 'fsleyes.profiles.orthoviewprofile.OrthoViewProfile'>: OrderedDict([(('nav', <MagicMock name='mock.WXK_CONTROL' id='3011062776'>), 'zoom'), (('nav', <MagicMock name='mock.WXK_ALT' id='3010693008'>), 'pan'), (('nav', <MagicMock name='mock.WXK_SHIFT' id='3010696936'>), 'slice'), (('nav', (<MagicMock name='mock.WXK_CONTROL' id='3011062776'>, <MagicMock name='mock.WXK_SHIFT' id='3010696936'>)), 'bricon')]), <class 'fsleyes.profiles.orthoeditprofile.OrthoEditProfile'>: OrderedDict([(('sel', <MagicMock name='mock.WXK_SHIFT' id='3010696936'>), 'slice'), (('desel', <MagicMock name='mock.WXK_SHIFT' id='3010696936'>), 'slice'), (('selint', <MagicMock name='mock.WXK_SHIFT' id='3010696936'>), 'slice'), (('fill', <MagicMock name='mock.WXK_SHIFT' id='3010696936'>), 'slice'), (('sel', <MagicMock name='mock.WXK_ALT' id='3010693008'>), 'pan'), (('desel', <MagicMock name='mock.WXK_ALT' id='3010693008'>), 'pan'), (('selint', <MagicMock name='mock.WXK_ALT' id='3010693008'>), 'pan'), (('fill', <MagicMock name='mock.WXK_ALT' id='3010693008'>), 'pan'), (('sel', <MagicMock name='mock.WXK_CONTROL' id='3011062776'>), 'zoom'), (('desel', <MagicMock name='mock.WXK_CONTROL' id='3011062776'>), 'zoom'), (('selint', <MagicMock name='mock.WXK_CONTROL' id='3011062776'>), 'zoom'), (('fill', <MagicMock name='mock.WXK_CONTROL' id='3011062776'>), 'zoom'), (('sel', (<MagicMock name='mock.WXK_CONTROL' id='3011062776'>, <MagicMock name='mock.WXK_SHIFT' id='3010696936'>)), 'chsize'), (('desel', (<MagicMock name='mock.WXK_CONTROL' id='3011062776'>, <MagicMock name='mock.WXK_SHIFT' id='3010696936'>)), 'chsize'), (('selint', (<MagicMock name='mock.WXK_CONTROL' id='3011062776'>, <MagicMock name='mock.WXK_SHIFT' id='3010696936'>)), 'chthres'), (('selint', (<MagicMock name='mock.WXK_ALT' id='3010693008'>, <MagicMock name='mock.WXK_SHIFT' id='3010696936'>)), 'chrad')]), <class 'fsleyes.profiles.orthocropprofile.OrthoCropProfile'>: OrderedDict([(('crop', <MagicMock name='mock.WXK_SHIFT' id='3010696936'>), 'nav'), (('crop', <MagicMock name='mock.WXK_CONTROL' id='3011062776'>), 'zoom'), (('crop', <MagicMock name='mock.WXK_ALT' id='3010693008'>), 'pan'), (('crop', (<MagicMock name='mock.WXK_CONTROL' id='3011062776'>, <MagicMock name='mock.WXK_SHIFT' id='3010696936'>)), 'slice')]), <class 'fsleyes.profiles.lightboxviewprofile.LightBoxViewProfile'>: OrderedDict([(('view', <MagicMock name='mock.WXK_CONTROL' id='3011062776'>), 'zoom')]), <class 'fsleyes.profiles.timeseriesprofile.TimeSeriesProfile'>: OrderedDict([(('panzoom', <MagicMock name='mock.WXK_CONTROL' id='3011062776'>), 'volume')]), <class 'fsleyes.profiles.histogramprofile.HistogramProfile'>: OrderedDict([(('panzoom', <MagicMock name='mock.WXK_CONTROL' id='3011062776'>), 'overlayRange')]), <class 'fsleyes.profiles.scene3dviewprofile.Scene3DViewProfile'>: OrderedDict([(('rotate', <MagicMock name='mock.WXK_CONTROL' id='3011062776'>), 'zoom'), (('rotate', <MagicMock name='mock.WXK_ALT' id='3010693008'>), 'pan'), (('rotate', <MagicMock name='mock.WXK_SHIFT' id='3010696936'>), 'pick')])}¶ The
tempModeMap
dictionary defines temporary modes, for eachProfile
sub-class which, when in a given mode, can be accessed with a keyboard modifer (e.g. Control, Shift, etc). For example, a temporary mode map of:('view', wx.WXK_SHIFT) : 'zoom'
states that when the
Profile
is in'view'
mode, and the shift key is held down, theProfile
should temporarily switch to'zoom'
mode.
-
fsleyes.profiles.profilemap.
altHandlerMap
= {<class 'fsleyes.profiles.orthoviewprofile.OrthoViewProfile'>: OrderedDict([(('nav', 'LeftMouseDown'), ('nav', 'LeftMouseDrag')), (('nav', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('nav', 'RightMouseDown'), ('zoom', 'RightMouseDown')), (('nav', 'RightMouseDrag'), ('zoom', 'RightMouseDrag')), (('nav', 'RightMouseUp'), ('zoom', 'RightMouseUp')), (('slice', 'LeftMouseDown'), ('pick', 'LeftMouseDown')), (('slice', 'LeftMouseDrag'), ('pick', 'LeftMouseDrag')), (('slice', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('slice', 'RightMouseDown'), ('zoom', 'RightMouseDown')), (('slice', 'RightMouseDrag'), ('zoom', 'RightMouseDrag')), (('slice', 'RightMouseUp'), ('zoom', 'RightMouseUp')), (('zoom', 'RightMouseDown'), ('zoom', 'RightMouseDrag')), (('zoom', 'LeftMouseDown'), ('nav', 'LeftMouseDown')), (('zoom', 'LeftMouseDrag'), ('nav', 'LeftMouseDrag')), (('zoom', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('pick', 'LeftMouseDown'), ('pick', 'LeftMouseDrag'))]), <class 'fsleyes.profiles.orthoeditprofile.OrthoEditProfile'>: OrderedDict([(('sel', 'Char'), ('nav', 'Char')), (('desel', 'Char'), ('nav', 'Char')), (('selint', 'Char'), ('nav', 'Char')), (('fill', 'Char'), ('nav', 'Char')), (('sel', 'RightMouseDown'), ('desel', 'LeftMouseDown')), (('sel', 'RightMouseDrag'), ('desel', 'LeftMouseDrag')), (('sel', 'RightMouseUp'), ('desel', 'LeftMouseUp')), (('desel', 'RightMouseDown'), ('sel', 'LeftMouseDown')), (('desel', 'RightMouseDrag'), ('sel', 'LeftMouseDrag')), (('desel', 'RightMouseUp'), ('sel', 'LeftMouseUp')), (('fill', 'RightMouseDown'), ('desel', 'LeftMouseDown')), (('fill', 'RightMouseDrag'), ('desel', 'LeftMouseDrag')), (('fill', 'RightMouseUp'), ('desel', 'LeftMouseUp')), (('selint', 'RightMouseDown'), ('desel', 'LeftMouseDown')), (('selint', 'RightMouseDrag'), ('desel', 'LeftMouseDrag')), (('selint', 'RightMouseUp'), ('desel', 'LeftMouseUp')), (('desel', 'MouseMove'), ('sel', 'MouseMove')), (('sel', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('desel', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('selint', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag'))]), <class 'fsleyes.profiles.orthocropprofile.OrthoCropProfile'>: OrderedDict([(('crop', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag'))]), <class 'fsleyes.profiles.lightboxviewprofile.LightBoxViewProfile'>: OrderedDict([(('view', 'LeftMouseDown'), ('view', 'LeftMouseDrag'))]), <class 'fsleyes.profiles.scene3dviewprofile.Scene3DViewProfile'>: OrderedDict([(('rotate', 'MiddleMouseDown'), ('pan', 'LeftMouseDown')), (('rotate', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag')), (('rotate', 'MiddleMouseUp'), ('pan', 'LeftMouseUp'))])}¶ The
altHandlerMap
dictionary defines alternate handlers for a given mode and event type. Entries in this dictionary allow aProfile
sub-class to define a handler for a single mode and event type, but to re-use that handler for other modes and event types. For example, the following alternate handler mapping:('zoom', 'MiddleMouseDrag'), ('pan', 'LeftMouseDrag'))
states that when the
Profile
is in'zoom'
mode, and aMiddleMouseDrag
event occurs, theLeftMouseDrag
handler for the'pan'
mode should be called.Note
Event bindings defined in the
altHandlerMap
take precdence over the event bindings defined in theProfile
sub-class. So you can use thealtHandlerMap
to override the default behaviour of aProfile
.
-
fsleyes.profiles.profilemap.
fallbackHandlerMap
= {<class 'fsleyes.profiles.orthoviewprofile.OrthoViewProfile'>: {('pick', 'LeftMouseDown'): ('nav', 'LeftMouseDown'), ('pick', 'LeftMouseDrag'): ('nav', 'LeftMouseDrag')}}¶ The
fallbackHandlerMap
dictionary defines handlers for a given mode and event type which will be called if the handler for that mode/event type returns a value ofFalse
, indicating that it has not been handled.