Repository navigation
Simplify the OmeZarrOpenActions and OmeZarr APIs - #163
Open
stefanhahmann wants to merge 3 commits into
Open
stefanhahmann wants to merge 3 commits into
stefanhahmann wants to merge 3 commits into
Conversation
Its withSettings/withDefaultBackend factories returned an OmeZarr, and its URI constructors and show delegates served only tests. The factory is now OmeZarrOpeningSettings.createOmeZarr, the only constructor takes an OmeZarr, the BDV openers install the drop target themselves, and showHelp is static. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Effect of the breaking changes on downstream users, checked on
|
OmeZarr had four public constructors, so setting an error handler meant passing a positional null for the preferred width. There is now one public constructor plus withPreferredMaxWidth and withErrorHandler, which return copies and chain in any order. The constructor taking the open-anyway confirmation is package-private, since only tests replace the dialog. The 4-argument constructor stays, deprecated until 0.11, because bigvolumebrowser calls it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stefanhahmann
force-pushed
the
issue-162-open-actions-api
branch
from
October 28, 2026 11:40
de6a09c to
a90c457
Compare
stefanhahmann
added a commit
that referenced
this pull request
Oct 28, 2026
The test opens the chooser's real modal dialog and presses OK from a WINDOW_OPENED listener. If OK is never pressed, choose() blocks forever. That happened once in the SonarCloud job on PR #163, which ran until GitHub cancelled it after six hours. The cause is unknown. The same test passed in that job on main, and it passes locally on JDK 11 and 21. Now a 5 second timeout, run on a separate thread so JUnit can abandon the blocked one, turns any hang into a failed test that names itself. The listener also only touches the chooser's dialog, matched by title, so a dialog left behind by another test cannot trip it. Polling for the showing dialog instead of listening was tried and dropped: JOptionPane resets its value on COMPONENT_SHOWN, so pressing OK too early gets wiped (an empty result on JDK 11). Window.show() posts WINDOW_OPENED after that reset, which is why the listener is kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stefanhahmann
force-pushed
the
issue-162-open-actions-api
branch
from
October 28, 2026 11:52
e9f5456 to
65563ab
Compare
A dialog that was never closed held the SonarCloud job. A 5 seconds timeout now fails the test instead, and the listener only touches the chooser's own dialog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
stefanhahmann
force-pushed
the
issue-162-open-actions-api
branch
from
October 28, 2026 11:53
65563ab to
4ac3667
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Closes #162.
OmeZarrOpenActions(the issue).withSettingsandwithDefaultBackendreturned anOmeZarr, not actions, which was confusing next toopenWithSettings. The factory method now lives on the settings class asOmeZarrOpeningSettings.createOmeZarr.Result in IDE:
OmeZarrconstructors.withPreferredMaxWidthandwithErrorHandlerinstead.Btw, this also addresses this review comment on #150 I overlooked earlier on:
showInBdv( BdvHandle )no longer installs the drop target as a side effect.OmeZarr.showInBdv( bdvHandle )only shows the image, and the caller decides about drag and drop withOmeZarrBdvDropListener.install( bdvHandle, context ). That works for a BDV opened elsewhere, e.g. with Vistools, too. Adding to such a BDV via the GUI remains #160.ome-zarr-imglib2,ome-zarr-n5,ome-zarr-zarrjavaNo API changes.
ome-zarr-fijiOmeZarrconstructor takingpreferredMaxWidthanderrorHandler. Use instead nownew OmeZarr( uri, context, backend ).withPreferredMaxWidth( … ).withErrorHandler( … ).OmeZarrconstructor takingpreferredMaxWidth(bigvolumebrowser calls it).openAnywayConfirmation.OmeZarr.withPreferredMaxWidth( Integer )andwithErrorHandler( Consumer< String > )chainables.ome-zarr-fiji-uiOmeZarrOpenActions:withSettings(…)andwithDefaultBackend(…). UseOmeZarrOpeningSettings.createOmeZarr(…)ornew OmeZarr(…).URI. Usenew OmeZarrOpenActions( omeZarr ).showInImageJ(),showInImageJ( int ),showInBdv()andshowInBdv( BdvHandle ). Call them on theOmeZarr.OmeZarrOpenActions.showHelp()is now static.OmeZarrOpeningSettings.createOmeZarr( URI, Context, Consumer< String > ).🤖 Generated with Claude Code