scenerygraphics / sciview

sciview is a tool for visualization and interaction with ND image and mesh data
BSD 2-Clause "Simplified" License
66 stars 17 forks source link

Cannot add box or line #470

Closed ctrueden closed 1 year ago

ctrueden commented 1 year ago

When I run Edit → Add → Box... or Line..., I receive the error:

'color' is required but unset

Sphere... works, although the ... would indicate a dialog box should be shown, and none is shown—it just adds the sphere straight away.

kephale commented 1 year ago

You should be able to rerun and select a color. However, we should have a default color, the fact that it is unset is a problem.

kephale commented 1 year ago

This issue slips by easily because the color @Parameter's are persistent.

ctrueden commented 1 year ago

@kephale I think I have it fixed by removing the lateinit in favor of just assigning the default color to the non-nullable parameters...

kephale commented 1 year ago

ok it also works with required=false

ctrueden commented 1 year ago

I think the core issue is that no dialog box ever appears when I run these commands. It just adds the shape directly, and then I need to use the properties editor to change things. It's supposed to pop a dialog box, right? Maybe it's because SciJava thinks there is no UI visible, and so does not run the SwingInputHarvester?

kephale commented 1 year ago

How are you running it? I get a dialog box. When I test I run the ImageJMain class....

ctrueden commented 1 year ago

I am running the sc.iview.Main class from IntelliJ. And yeah, that is the difference: no uiService.showUI() in the Main. Should we combine these two entry points?

kephale commented 1 year ago

I'm happy to. IIRC the separation was related to testing how things behaved when run separate for IJ and not. However, all we really care about now is playing nicely with IJ (and there are some bugs that affect standalone only).