Giter VIP home page Giter VIP logo

Comments (5)

rimadoma avatar rimadoma commented on September 25, 2024 1

@ctrueden That sounds very handy, but frankly here I'm just trying to make the UI look like something is happening, so that the user doesn't BoneJ has frozen. In any case most of the action happens inside ops, so the bar wouldn't be updated that often even it worked in finer detail than per subspace.

Is there a way to create a progress bar for a task with unknown number of iterations / time? Just something that darts back and forth while processing happens.

from bonej2.

ctrueden avatar ctrueden commented on September 25, 2024

I think there is opportunity to improve the SciJava core here. The StatusService is a singleton progress bar and message, same as ImageJ1. There is now a TaskService that lets you spawn new tasks and keep track of their progress individually. What I have wanted for a long time is to tie in the tasks to the StatusService, so that you can do something like:

Task task = taskService.createTask("Processing subspaces");
for (int i=0; i<subspaceCount; i++) {
  Task subtask = taskService.createTask("Processing subspace #" + i);
  task.addSubtask(subtask);
}
subspaceProcessor.launch(task); // or launch each subtasks, if multithreaded
statusService.setTask(task);

And then the status bar would reflect the status of the running tasks, including messages and progress, automatically. Some day, the ImageJ UI could even be improved to provide a dropdown details view similar to Eclipse with its subtasks, so that you can see everything currently going on.

The above is very rough off the top of my head—see the org.scijava.download package where I really used the TaskService in practice.

The two things needed to make the above a reality:

  1. Adding API to the StatusService to tie in with Tasks.
  2. Add API to the Task to allow for nested tasks.

What do you think @rimadoma? Does it make sense?

from bonej2.

ctrueden avatar ctrueden commented on September 25, 2024

Is there a way to create a progress bar for a task with unknown number of iterations / time?

No. ImageJ1 uses its own progress bar implementation which does not have an indeterminate mode, unlike Swing's JProgressBar. And we are stuck with the ImageJ1 UI. The way ImageJ1 handles this is to simply keep updating the status message, with no visible progress bar.

from bonej2.

imagejan avatar imagejan commented on September 25, 2024

Maybe we can trick ImageJ1's "Double Progress Bar" into showing an indeterminate cycling dot?

from bonej2.

ctrueden avatar ctrueden commented on September 25, 2024

@imagejan Wow, that's crazy!

Relatedly: digging in the source, I realize I made a mistake: ij.gui.ProgressBar extends java.awt.Canvas—there is no java.awt.ProgressBar. Sorry for steering people wrong there. I edited my message above to correct it.

from bonej2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.