Skip to content

Conversation

daykin
Copy link
Collaborator

@daykin daykin commented Jun 13, 2024

Two additions that allow for plugins to track the runtime state.

  1. Add a FutureTask called representation_init so others who hear about the RuntimeInstance from e.g. a ListChangeListener can wait until the display is loaded with something interesting before dealing with it. An interested client would call DisplayRuntimeInstance.getRepresentation_init().get() to block until the instance is ready.
  2. Add methods to add and remove ToolkitListeners to the instance's underlying JFXRepresentation.

For consideration: The side-effect of (2) is that anyone with a valid reference to a (perhaps critical) toolkit listener can mess with it from an additional place besides JFXRepresentation. However, JFXRepresentation.addListener/removeListener are already public, so this isn't exactly bypassing any built-in separation of concerns.

@daykin daykin force-pushed the expose-toolkit-listener-control-in-runtime-instance branch from f8c09d6 to 62b2267 Compare June 13, 2024 16:24
@daykin daykin requested review from kasemir and shroffk June 13, 2024 16:25
@kasemir
Copy link
Collaborator

kasemir commented Jun 13, 2024

A slightly more canonic phrasing for a future or future task that returns nothing might be
FutureTask<Void> instead of FutureTask<Object>. With Object, you wonder what it is.

@daykin daykin force-pushed the expose-toolkit-listener-control-in-runtime-instance branch from 62b2267 to 65f8fa2 Compare June 13, 2024 20:03
@daykin daykin force-pushed the expose-toolkit-listener-control-in-runtime-instance branch from 65f8fa2 to fa27215 Compare June 13, 2024 20:04
@daykin
Copy link
Collaborator Author

daykin commented Jun 13, 2024

A slightly more canonic phrasing for a future or future task that returns nothing might be FutureTask<Void> instead of FutureTask<Object>. With Object, you wonder what it is.

Changed to FutureTask, undid whitespace changes and moved unblocking the FutureTask to just after the call to awaitRepresentation()

@kasemir kasemir merged commit fa44289 into ControlSystemStudio:master Jun 13, 2024
@kasemir kasemir mentioned this pull request Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants