You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 40d687d
Browse filesBrowse the repository at this point in the historyBrowse files
Scripts declare their presentation, and menus take more than one source
Answering "how does a script say where it belongs, and what language it
is written in":
- `#@script(menu = "Process>Filters>Blur It", accelerator = "^B", label,
weight, iconPath)` -- the same keys @menu uses. These directives were
parsed already and consumed by nothing; now they mean something.
- Where a script says nothing, the directory speaks for it:
scripts/Process/Filters/Blur_It.groovy means the same thing,
underscores read as spaces. That is how the scripts in the wild are
arranged.
- `#@script(language = "jython")` or a `#!` line settles which language
is meant, for the ones sharing an extension -- .py being Jython or
Python. Silence means the extension decides.
Making that work needed the gap underneath filled. `MenuTree.of` took
`Collection<CommandInfo>`, and a CommandInfo is class-and-index shaped;
a script is not a class. So `ExecutableInfo` is now the question the
menu layer asks -- menuPath, label, accelerator, iconPath, weight,
visible -- and it extends Executable, so what a menu holds is the thing
to run. `CommandInfo` implements it; `ExecutableInfo.of(executable,
attrs)` makes one out of a script and its directives; a SciJava Common
ModuleInfo will make one through the bridge, with no further change to
the menu layer, the bindings or the shells.
It is deliberately not called `MenuEntry`: a menu path is optional, and
plenty of runnable things belong in no menu -- one invoked by name from
a script, one reached only through the search bar, one that exists to be
called by something else. MenuTree takes the subset with a path;
CommandsTest pins that a pathless command is still labelled, still
runnable, and simply absent from the tree.
`ScriptFinder` reads a directory into scripts plus metadata maps -- not
menu entries, since scijava-script3 knows nothing about menus. All three
shells now build their menus from the annotation index *and* a directory
of Groovy scripts, and nothing below them can tell which came from
where. That is the AppLoader shape the fijifx notes sketched, now
load-bearing rather than planned.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013gJpzGd3ksbME4CN6Tu2ni
Copy file name to clipboardExpand all lines: docs/migration.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,12 +123,12 @@ A **dropped** row is a successful outcome, not a gap.
123
123
|`convert`|`org.scijava.convert3`: `Converter` asks one question - can you turn *this value* into *that type* - where SciJava Common had eight `canConvert` overloads and a `ConversionRequest` to carry the combinations. `ConvertService` becomes `Converters`, backed by plain `ServiceLoader` so that conversion sits *below* the container: parameter binding converts, and a script or command line supplies strings for everything. `DefaultConverter`'s pile of special cases becomes one converter per concern (cast, number, string, to-string, array, collection, constructor, file/path), each contributable and orderable by priority. `Converter.of(String.class, Foo.class, Foo::parse)` covers the common case in a line | ported |
124
124
|`module`, `module.process`|`org.scijava.execute`: `@Parameter` on fields, `Executables` for the plain case, and `Runner` for the processor chain. `ModuleService.run` becomes `Runner.run`, still returning a future, but of an `ExecutionResult` that reports a declined run with its reason and its author rather than through `ModulePreprocessor.isCanceled()`| ported |
125
125
|`command`|`org.scijava.command`: `Command` is a `Runnable` whose `@Parameter` fields are its struct; `@Menu` (repeatable) carries the presentation metadata, read from the annotation index without loading the class. `CommandInfo` replaces `ModuleInfo` and needs no `Context`; `MenuTree` replaces `ShadowMenu`. There is no `DynamicCommand`: see `choicesFrom` and `@Group(membersFrom)`| ported |
126
-
|`script`, `script.process`|`org.scijava.script3`: `ScriptLanguage`/`ScriptSession` are the SPI, with `JsrLanguage` making every JSR-223 engine on the classpath available for free; GraalVM polyglot and Appose are further languages, not replacements. `ScriptInfo`/`ScriptModule` become `ScriptExecutable`, an ordinary `Executable`, so a script runs through the same `Runner`, preprocessors, dialogs and menus as a Java command. `ScriptService` has no equivalent: `Scripts.get().of(path)` is a line. The `#@` header syntax is unchanged, and declaration lines are blanked rather than removed so the language's error messages keep pointing at the right line. The processor chain (`ScriptProcessor` and friends) is not ported: it existed to rewrite scripts before evaluation, and parameters plus a shebang are all it was actually used for. `ScriptREPL`, `ScriptInterpreter`, `AutoCompleter` and `CodeGenerator` await the script editor | ported |
126
+
| `script`, `script.process` | `org.scijava.script3`: `ScriptLanguage`/`ScriptSession` are the SPI, with `JsrLanguage` making every JSR-223 engine on the classpath available for free; GraalVM polyglot and Appose are further languages, not replacements. `ScriptInfo`/`ScriptModule` become `ScriptExecutable`, an ordinary `Executable`, so a script runs through the same `Runner`, preprocessors, dialogs and menus as a Java command. `ScriptService` has no equivalent: `Scripts.get().of(path)` is a line. The `#@` header syntax is unchanged, and declaration lines are blanked rather than removed so the language's error messages keep pointing at the right line. The processor chain (`ScriptProcessor` and friends) is not ported: it existed to rewrite scripts before evaluation, and parameters plus a shebang are all it was actually used for. `ScriptREPL`, `ScriptInterpreter`, `AutoCompleter` and `CodeGenerator` await the script editor. `ScriptFinder` is ported: it reads `#@script` directives and falls back to the directory hierarchy for a menu path, handing an application metadata rather than menus, since this component knows nothing about menus | ported |
127
127
|`widget` (`InputWidget`, `InputPanel`, `InputHarvester`, `WidgetModel`, `WidgetStyle`) |`org.scijava.ui3`: `Widget` is a view of a `ParameterNode`, `WidgetFactory` a discoverable `@Plugin`, `WidgetPanel` a widget holding widgets (so a group nests with no special case), and `WidgetPanels` walks the tree for every toolkit. `WidgetModel` has no equivalent - a widget reads the `ParameterModel` and the node directly, and `WidgetStyle`'s parsing is `Widgets.isStyle`/`styleValue`. `InputHarvester` is a `Preprocessor` that declines the run when the user dismisses the dialog, rather than setting a `canceled` flag on itself | ported |
128
128
|`ui.awt` (satellite repo `scijava-ui-awt`) |`org.scijava.awt`: the widget set in pure `java.awt` - no spinner, so the number widget is a field and a scroll bar - plus `Edt`, the first of the AWT platform layer that the Swing binding shares. `AWTColors`, `AWTWindows`, `AWTClipboard`, `AWTInputEventDispatcher` and the drag-and-drop dispatchers belong there too, when the `input`/`tool` layer arrives; the `AWTUI`/`AWTApplicationFrame`/`AWTStatusBar` shell classes await the application layer | ported |
129
129
|`ui.javafx` (satellite repo `scijava-ui-javafx`) |`org.scijava.javafx`: the same widget set as the Swing binding, plus `FxThread` for JavaFX's application thread. `JavaFXKeys`'s key-code mapping is worth keeping when the `input`/`tool` layer arrives; `JavaFXMenuCreator` is superseded by `FxMenus`, some 40 lines against `MenuCreator`| ported |
130
130
|`ui.swing.widget`|`org.scijava.swing`: number (spinner, with an optional slider or scroll bar and labelled ticks), text (field, password, area, and `BigInteger`/`BigDecimal`, which a spinner cannot step), toggle, choice, file, message, and the panel and dialog. `SpinnerBigDecimalModel`, `SpinnerBigIntegerModel`, `SpinnerTypedNumberModel` and `SpinnerNumberModelFactory` have no equivalent: `SpinnerNumberModel` already steps in the type of the value it holds, and arbitrary precision goes to the text widget. MigLayout is gone, in favor of `GridBagLayout`: one fewer dependency, and one fewer automatic module. The button, color, date, file-list and radio-choice widgets are not ported yet - each earns its place when something asks for it | ported |
131
-
|`menu` (`MenuCreator`, `AbstractMenuCreator`, `MenuService`, `ShadowMenu`) |`org.scijava.command`: `MenuTree` is the model and `MenuCreator`/`Menus` the toolkit-free walk, with `SwingMenus` the first implementation. `MenuService` has no equivalent: a menu bar is `MenuTree.of(Commands.discover(context))`, which is a line rather than a service | ported |
131
+
|`menu` (`MenuCreator`, `AbstractMenuCreator`, `MenuService`, `ShadowMenu`) |`org.scijava.command`: `ExecutableInfo` is anything an application can run (a menu path being optional), `MenuTree` arranges the subset that has one, and `MenuCreator`/`Menus`are the toolkit-free walk, with `SwingMenus`, `FxMenus` and `AwtMenus` implementing it. `MenuService` has no equivalent: a menu bar is `MenuTree.of(Commands.discover(context))`, which is a line rather than a service | ported |
132
132
|`ui`, `menu`|`scijava-ui3` (toolkit-agnostic contracts) and `scijava-menu` (the menu tree), with `ApplicationFrame`/`Desktop`/`StatusBar`/`ToolBar` as contracts there and implementations in the toolkit bindings. Dropped from the *core*, not from the stack — see the layering section of [migration-plan.md](migration-plan.md)| planned |
0 commit comments