@@ -3176,6 +3176,9 @@ public void actionPerformed(final java.awt.event.ActionEvent e) {
31763176 // Guards posSlider.setValue() calls that are programmatic (not from the user
31773177 // dragging the slider), so slabListener does not fire a second applySlab().
31783178 final boolean [] updatingSlab = {false };
3179+ // Slab Paths defaults to following Slab View (activated whenever Slab View is turned
3180+ // on) until the user manually toggles Slab Paths themselves, at which point it decouples
3181+ final boolean [] slabPathsUserOverride = {false };
31793182
31803183 final VolumeViewerPanel viewerPanel = bvvInstance .currentBvv .getViewer ();
31813184
@@ -3421,8 +3424,12 @@ public void mousePressed(final java.awt.event.MouseEvent e) {
34213424 slabAxis .set (axis0 );
34223425 reconfigureAndApplySlab .run ();
34233426 slabPathsToggle .setEnabled (true );
3424- // Slab Paths' *selected* state is a persistent user preference (left alone on deactivation),
3425- // but renderingOptions.isClipPathsToSlab() is the actual effective flag and was forced false
3427+ // Slab Paths defaults to activating alongside Slab View (synced) unless the user has
3428+ // manually toggled Slab Paths before (decoupled)
3429+ if (!slabPathsUserOverride [0 ]) {
3430+ slabPathsToggle .setSelected (true );
3431+ }
3432+ // renderingOptions.isClipPathsToSlab() is the actual effective flag and was forced false
34263433 // on deactivation since it's meaningless while there's no active slab. Re-sync it here to
34273434 // whatever the toggle currently shows, or re-activating slab would silently render all paths
34283435 // (front and back) despite Slab Paths still looking selected
@@ -3467,6 +3474,7 @@ public void mousePressed(final java.awt.event.MouseEvent e) {
34673474 thickSpinner .addChangeListener (slabListener );
34683475
34693476 slabPathsToggle .addActionListener (ev -> {
3477+ slabPathsUserOverride [0 ] = true ; // user acted on it directly: decouple from Slab View's default
34703478 final boolean clip = slabPathsToggle .isSelected ();
34713479 renderingOptions .setClipPathsToSlab (clip );
34723480 overlayRenderer .invalidateCache ();
@@ -3507,29 +3515,34 @@ private JToolBar buildSceneControlToolbar(final BvvActions bvvActions) {
35073515 IconFactory .GLYPH .CROSSHAIR , IconFactory .GLYPH .CROSSHAIR );
35083516 crosshairToggle .setSelected (true );
35093517 bar .add (crosshairToggle );
3510- final JToggleButton axesToggle = GuiUtils .Buttons .toolbarToggleButton (
3511- BvvActions .overlayToggleAction ("Axes" , false , show -> {
3512- if (sceneOverlay != null ) { sceneOverlay .showAxes = show ; bvvInstance .repaint (); }
3513- }),
3514- "Show/hide coordinate axes at the volume origin.\n X: Red; Y: Green; Z: Blue" ,
3515- IconFactory .GLYPH .CHART_LINE , IconFactory .GLYPH .CHART_LINE );
3516- axesToggle .setSelected (false );
3517- bar .add (axesToggle );
3518- final JToggleButton boxToggle = GuiUtils .Buttons .toolbarToggleButton (
3519- BvvActions .overlayToggleAction ("Volume Box" , false , show -> {
3520- if (sceneOverlay != null ) { sceneOverlay .showBox = show ; bvvInstance .repaint (); }
3521- }),
3522- "Show/hide bounding box around all loaded volumes" ,
3523- IconFactory .GLYPH .CUBE , IconFactory .GLYPH .CUBE );
3524- boxToggle .setSelected (false );
3525- bar .add (boxToggle );
3518+ bar .add (axesButton ());
35263519 bar .addSeparator ();
35273520 bar .add (Box .createHorizontalGlue ());
35283521 bar .addSeparator ();
35293522 bar .add (optionsButton (bvvActions ));
35303523 return bar ;
35313524 }
35323525
3526+ private JButton axesButton () {
3527+ final JPopupMenu menu = new JPopupMenu ();
3528+ final JButton button = GuiUtils .Buttons .OptionsButton (IconFactory .GLYPH .CUBE , 1f , menu );
3529+ final JCheckBoxMenuItem axesItem = new JCheckBoxMenuItem (
3530+ BvvActions .overlayToggleAction ("Axes" , false , show -> {
3531+ if (sceneOverlay != null ) { sceneOverlay .showAxes = show ; bvvInstance .repaint (); }
3532+ }));
3533+ axesItem .setToolTipText ("Show/hide coordinate axes at the volume origin. X: Red; Y: Green; Z: Blue" );
3534+ axesItem .setSelected (false );
3535+ menu .add (axesItem );
3536+ final JCheckBoxMenuItem boxItem = new JCheckBoxMenuItem (
3537+ BvvActions .overlayToggleAction ("Volume Box" , false , show -> {
3538+ if (sceneOverlay != null ) { sceneOverlay .showBox = show ; bvvInstance .repaint (); }
3539+ }));
3540+ boxItem .setToolTipText ("Show/hide bounding box around all loaded volumes" );
3541+ boxItem .setSelected (false );
3542+ menu .add (boxItem );
3543+ return button ;
3544+ }
3545+
35333546 private JButton optionsButton (final BvvActions actions ) {
35343547 final JPopupMenu menu = new JPopupMenu ();
35353548 final JButton oButton = GuiUtils .Buttons .OptionsButton (IconFactory .GLYPH .OPTIONS , 1f , menu );
@@ -3796,7 +3809,7 @@ public void drawOverlays(final java.awt.Graphics g) {
37963809 final double x0 = b [0 ], y0 = b [1 ], z0 = b [2 ], x1 = b [3 ], y1 = b [4 ], z1 = b [5 ];
37973810
37983811 if (showAxes ) {
3799- g2 .setStroke (new java .awt .BasicStroke (3f ));
3812+ g2 .setStroke (new java .awt .BasicStroke (4f ));
38003813 final float axisLen = 0.20f * (float ) Math .min (x1 - x0 , Math .min (y1 - y0 , z1 - z0 ));
38013814 drawLine3D (g2 , project , new double []{x0 , y0 , z0 }, new double []{x0 + axisLen , y0 , z0 }, new java .awt .Color (220 , 60 , 60 ));
38023815 drawLine3D (g2 , project , new double []{x0 , y0 , z0 }, new double []{x0 , y0 + axisLen , z0 }, new java .awt .Color (60 , 200 , 60 ));
0 commit comments