Closed hohonuuli closed 4 months ago
Just a quick note that when I was annotating remotely last Friday over vpn, I never lost my concept buttons on maps even after opening 12 files. It's interesting that it works from home over a slow vpn, not sure if this is a clue to help solve but thought I would add it here.
@hohonuuli This issue along with the localization box drawing issue (https://github.com/mbari-org/vars-annotation/issues/174) are high priority and hopefully can be solved together, if they are both related to timing of opening up application.
@kwalz Just a note that, while I suspect both these issues are related to timing/multithreading, they are actually unrelated to each other. ATM, I'll be prioritizing the #174 and hope to start work on it Monday.
I add the following changes:
ForceRedrawEvent
that can be sent on the internal eventbus. The App class has this lovely little hack. I change the window width by 1 pixel, allow the JavaFX internal thread to to a redraw tick (that's the sleep fro 100ms), then change it back. Works like a champ. toolBox.getEventBus()
.toObserverable()
.ofType(ForceRedrawEvent.class)
.subscribe(e -> {
var width = primaryStage.getWidth();
toolBox.getExecutorService().submit(() -> {
Platform.runLater(() -> {
primaryStage.setWidth(width + 1);
});
try {
// Let the UI thread catch up and redraw
Thread.sleep(100);
} catch (InterruptedException ex) {
// no-op
}
Platform.runLater(() -> {
primaryStage.setWidth(width);
});
});
});
Look into issues inside ConceptButtonPaneController and ConceptButtonPanesController.