Skip to content

Commit 77cbc65

Browse files
committed
Bvv: Add options for slab bounding box and paths visibility only in slab
1 parent d782d54 commit 77cbc65

3 files changed

Lines changed: 285 additions & 129 deletions

File tree

‎src/main/java/sc/fiji/snt/BookmarkManager.java‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public class BookmarkManager {
6464

6565
private final SNTUI sntui;
6666
private final Bvv bvv;
67+
/** BVV-injected toolbar components (e.g. slab toggle). Added via {@link #addBvvToolbarButton}. */
68+
private final java.util.List<javax.swing.JComponent> bvvToolbarButtons = new java.util.ArrayList<>();
6769
private final GuiUtils guiUtils;
6870
private final BookmarkModel model;
6971
private final BookmarkTable table;
@@ -134,6 +136,17 @@ public JFrame getBvvPanel() {
134136
return bvvFrame;
135137
}
136138

139+
/**
140+
* Adds a component to the BVV toolbar section of this panel.
141+
* The component is appended after a separator the first time this method is called.
142+
* Bvv uses this to inject context-specific controls (e.g. a slab-clip toggle).
143+
*
144+
* @param component the component to add; must not be {@code null}
145+
*/
146+
public void addBvvToolbarButton(final javax.swing.JComponent component) {
147+
bvvToolbarButtons.add(component);
148+
}
149+
137150
/** Shows or hides the floating BVV marker panel. */
138151
public void toggleBvvPanel() {
139152
final JFrame f = getBvvPanel();
@@ -566,11 +579,22 @@ private JToolBar assembleToolbar() {
566579
final int target = (row < 0 || row >= table.getRowCount() - 1) ? 0 : row + 1;
567580
if (target < table.getRowCount()) { table.setRowSelectionInterval(target, target); flyTo(target); }
568581
});
582+
final JButton resetButton = new JButton(IconFactory.menuIcon(IconFactory.GLYPH.EXPAND));
583+
resetButton.setToolTipText("Reset view to fit volume");
584+
resetButton.addActionListener(e -> bvv.resetView());
569585
final JButton helpButton = GuiUtils.Buttons.help(null);
570586
helpButton.addActionListener(e -> displayMarkerHelp());
571587
tb.add(prevButton);
572588
tb.add(nextButton);
573589
tb.addSeparator();
590+
tb.add(resetButton);
591+
tb.addSeparator();
592+
tb.add(Box.createHorizontalGlue());
593+
// Inject any BVV-provided toolbar buttons (e.g. slab-clip toggle)
594+
if (!bvvToolbarButtons.isEmpty()) {
595+
tb.addSeparator();
596+
bvvToolbarButtons.forEach(tb::add);
597+
}
574598
tb.add(Box.createHorizontalGlue());
575599
tb.add(helpButton);
576600
}

‎src/main/java/sc/fiji/snt/gui/cmds/ShortcutWindowCmd.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ private JPanel getPanel() {
8686
"Create a 2D rendering of a reconstruction file (traces/json/swc)"));
8787
shortcuts.add(new Shortcut("Rec. Viewer", ReconstructionViewerCmd.class,
8888
"Initialize SNT's neuroanatomy viewer. For analysis/visualization start here."));
89-
shortcuts.add(new Shortcut("BVV", BvvCmd.class,
89+
shortcuts.add(new Shortcut("BVV...", BvvCmd.class,
9090
"Initialize SNT's Big Volume Viewer with support for big data pyramidal images."));
9191
addButtons(shortcuts);
9292
final ScriptInstaller si = new ScriptInstaller(getContext(), getFrame());

0 commit comments

Comments
 (0)