File tree Expand file tree Collapse file tree
src/main/java/sc/fiji/snt/viewer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,6 +160,11 @@ public boolean syncPathManagerList() {
160160 if (snt == null )
161161 throw new IllegalArgumentException ("Only available in SNT-tethered instances" );
162162 final java .util .Collection <Tree > trees = snt .getPathAndFillManager ().getTrees ();
163+ if (trees .isEmpty ()) {
164+ clearAllTrees ();
165+ return false ;
166+ }
167+
163168 final java .util .Set <String > currentLabels = trees .stream ().map (Tree ::getLabel )
164169 .collect (java .util .stream .Collectors .toSet ());
165170 // See renderedTreesLock: this method can run concurrently with another instance of
@@ -178,10 +183,6 @@ public boolean syncPathManagerList() {
178183 syncedPathManagerLabels .clear ();
179184 syncedPathManagerLabels .addAll (currentLabels );
180185 }
181- if (trees .isEmpty ()) {
182- syncOverlays ();
183- return false ;
184- }
185186 addCollection (trees , true );
186187 return true ;
187188 }
@@ -889,11 +890,7 @@ Action syncPathManagerAction() {
889890 return new AbstractAction ("Sync Path Manager Changes" , IconFactory .menuIcon (IconFactory .GLYPH .SYNC )) {
890891 @ Override
891892 public void actionPerformed (final java .awt .event .ActionEvent e ) {
892- if (syncPathManagerList ()) {
893- showViewerMessage ("Path Manager synced" );
894- } else {
895- showViewerMessage ("No paths or SNT unavailable" );
896- }
893+ showViewerMessage ((syncPathManagerList ()) ? "Path Manager synced" : "No paths to sync" );
897894 }
898895 };
899896 }
You can’t perform that action at this time.
0 commit comments