Refactor AppPlugin architecture and remove legacy imviewer plugins path#73
Refactor AppPlugin architecture and remove legacy imviewer plugins path#73ehennestad wants to merge 16 commits intodevfrom
Conversation
- Add explicit PointerManager property (accessible to ImviewerPlugin subclasses) - Add initialisePointerManager private method; call it on init and figure recreation - Replace all obj.plugins lookups for pointerManager with direct obj.PointerManager access - Remove the lowercase plugins property (no remaining call sites) - Update RoiManager to fetch PointerManager from hViewer.PointerManager directly Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…(Phase 2+3) - Add sendKeyReleaseEventToPlugins to AppWithPlugin, parallel to sendKeyEventToPlugins - Call sendKeyReleaseEventToPlugins in imviewer.App.onKeyReleased so plugins receive key release events through the new path - Remove legacy plugins struct aggregation from UserSettings.editSettings; composite settings aggregation now belongs on the app/controller side - Simplify editSettings: remove doDefault flag, fix indentation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Restores the behaviour removed from UserSettings.editSettings, now correctly using obj.Plugins (AppWithPlugin) instead of the removed lowercase plugins struct. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- New applify.mixin.HasOptionsManager: instance-level OptionsManager, dependent Options property, editOptions method, and onOptionsChanged hook for subclasses — clean separation from UserSettings - DffExplorer now inherits HasOptionsManager instead of using the settings workaround: assignDefaultOptions only sets OptionsManager, onOptionsChanged replaces onSettingsChanged, editOptions replaces editSettings in the constructor Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove PrimaryAppName abstract property (assigned by subclasses but never read by the base or AppWithPlugin) - Remove dead methods(Abstract,Static) block with commented-out getPluginIcon - Remove commented-out onPluginActivated abstract methods block - Remove stale Todo comment (resolved by HasOptionsManager) - Add concise comment explaining the class role and why Heterogeneous is needed - Make singleton constructor behaviour explicit: warn and return early instead of silently substituting a different object mid-construction Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove assignDataIoModel (body was immediate return, fully dead) - Remove NumFrames dependent property (no get method, never used) - Remove redundant PrimaryApp and Axes assignments from constructor; both are already set via onPluginActivated during activatePlugin - Remove double onImviewerSet call (constructor no longer calls it directly; onPluginActivated is the single call site) - Remove stale %PointerManager comment (now a real property on App) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gin (Phase 7) - New applify.mixin.ModalMethodPreviewPlugin: owns RunMethodOnFinish, DestroyOnFinish, Modal, editSettings, openSettingsEditor, onSettingsEditorResumed, onSettingsEditorClosed, place, relocatePrimaryApp - AppPlugin loses all of the above; now contains only core plugin lifecycle: Name, PrimaryApp, PartialConstruction, key callbacks, activatePlugin, DataIoModel, OptionsManager, MenuItem, Icon - NoRMCorre, FlowRegistration, EXTRACT, FluFinder now inherit ModalMethodPreviewPlugin alongside ImviewerPlugin - Remove dead loadSettings/saveSettings no-op overrides from NoRMCorre, EXTRACT, FluFinder (USE_DEFAULT_SETTINGS=false already prevents file I/O) - Remove dead getPluginIcon static stubs from EXTRACT and FluFinder - Migrate CaimanDeconvolution to HasOptionsManager; remove settings workaround Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Rename methods to drop the settings terminology: editSettings -> editOptions openSettingsEditor -> openOptionsEditor onSettingsEditorResumed -> onOptionsEditorResumed onSettingsEditorClosed -> onOptionsEditorClosed Update all overrides and call sites in NoRMCorre, FlowRegistration, EXTRACT and FluFinder. Fix superclass qualifier in NoRMCorre and FlowRegistration to reference ModalMethodPreviewPlugin directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wasAborted should be public
Fix syntax error
|
|
||
| function optionsEditor = openOptionsEditor(obj) | ||
| %openOptionsEditor Open the ui dialog for editing method options. | ||
| titleStr = sprintf('Options Editor (%s)', obj.Name); |
Check warning
Code scanning / Code Analyzer
'Name' is referenced but is not a property, method, or event name defined in this class. Warning
| function optionsEditor = openOptionsEditor(obj) | ||
| %openOptionsEditor Open the ui dialog for editing method options. | ||
| titleStr = sprintf('Options Editor (%s)', obj.Name); | ||
| if ~isempty(obj.OptionsManager) |
Check warning
Code scanning / Code Analyzer
'OptionsManager' is referenced but is not a property, method, or event name defined in this class. Warning
| %openOptionsEditor Open the ui dialog for editing method options. | ||
| titleStr = sprintf('Options Editor (%s)', obj.Name); | ||
| if ~isempty(obj.OptionsManager) | ||
| optionsEditor = obj.OptionsManager.openOptionsEditor([], obj.getCurrentOptions()); |
Check warning
Code scanning / Code Analyzer
'OptionsManager' is referenced but is not a property, method, or event name defined in this class. Warning
| obj.hOptionsEditor = []; | ||
| obj.onOptionsEditorClosed() | ||
| if ~obj.wasAborted && obj.RunMethodOnFinish | ||
| obj.run() |
Check warning
Code scanning / Code Analyzer
'run' is referenced but is not a property, method, or event name defined in this class. Warning
| %relocatePrimaryApp Shift app and plugin windows so they do not overlap. | ||
| if nargin < 3; direction = 'horizontal'; end | ||
| figPos(1,:) = getpixelposition(hPlugin.Figure); | ||
| figPos(2,:) = getpixelposition(obj.PrimaryApp.Figure); |
Check warning
Code scanning / Code Analyzer
'PrimaryApp' is referenced but is not a property, method, or event name defined in this class. Warning
| if nargin < 3; direction = 'horizontal'; end | ||
| figPos(1,:) = getpixelposition(hPlugin.Figure); | ||
| figPos(2,:) = getpixelposition(obj.PrimaryApp.Figure); | ||
| hFig = [hPlugin.Figure, obj.PrimaryApp.Figure]; |
Check warning
Code scanning / Code Analyzer
'PrimaryApp' is referenced but is not a property, method, or event name defined in this class. Warning
| case 'horizontal'; figPos_ = figPos(:, [1,3]); dim = 1; | ||
| case 'vertical'; figPos_ = figPos(:, [2,4]); dim = 2; | ||
| end | ||
| screenPos = uim.utility.getCurrentScreenSize(obj.PrimaryApp.Figure); |
Check warning
Code scanning / Code Analyzer
'PrimaryApp' is referenced but is not a property, method, or event name defined in this class. Warning
| function options = get.Options(obj) | ||
| if ~isempty(obj.Options_) | ||
| options = obj.Options_; | ||
| elseif ~isempty(obj.OptionsManager) |
Check warning
Code scanning / Code Analyzer
'OptionsManager' is referenced but is not a property, method, or event name defined in this class. Warning
| if ~isempty(obj.Options_) | ||
| options = obj.Options_; | ||
| elseif ~isempty(obj.OptionsManager) | ||
| options = obj.OptionsManager.Options; |
Check warning
Code scanning / Code Analyzer
'OptionsManager' is referenced but is not a property, method, or event name defined in this class. Warning
Manual checklist1.
|
Summary
Main changes
imviewer.Appnow owns PointerManager directlyNotes