31
31
import javafx .scene .shape .Path ;
32
32
import javafx .scene .shape .Rectangle ;
33
33
import javafx .scene .text .TextAlignment ;
34
- import org .cirdles .squid .gui .dialogs .SquidMessageDialog ;
35
34
import org .cirdles .squid .exceptions .SquidException ;
36
35
import org .cirdles .squid .gui .dataViews .SampleNode ;
37
36
import org .cirdles .squid .gui .dataViews .SampleTreeNodeInterface ;
38
37
import org .cirdles .squid .gui .dateInterpretations .plots .PlotDisplayInterface ;
39
38
import org .cirdles .squid .gui .dateInterpretations .plots .squid .PlotRefreshInterface ;
40
39
import org .cirdles .squid .gui .dateInterpretations .plots .squid .WeightedMeanPlot ;
40
+ import org .cirdles .squid .gui .dialogs .SquidMessageDialog ;
41
41
import org .cirdles .squid .shrimp .ShrimpFractionExpressionInterface ;
42
42
import org .cirdles .squid .squidReports .squidReportCategories .SquidReportCategoryInterface ;
43
43
import org .cirdles .squid .squidReports .squidReportColumns .SquidReportColumnInterface ;
@@ -323,6 +323,7 @@ public void changed(ObservableValue<? extends SquidReportCategoryInterface> obse
323
323
@ Override
324
324
public void changed (ObservableValue <? extends SquidReportColumnInterface > observable , SquidReportColumnInterface oldValue , SquidReportColumnInterface newValue ) {
325
325
if (newValue != null ) {
326
+ PlotsController .spotsTreeViewCheckBox .setRoot (sampleItem );
326
327
String selectedExpression = newValue .getExpressionName ();
327
328
if (categoryComboBox .getSelectionModel ().getSelectedItem ().getDisplayName ().compareToIgnoreCase ("AGES" ) == 0 ) {
328
329
try {
@@ -337,9 +338,12 @@ public void changed(ObservableValue<? extends SquidReportColumnInterface> observ
337
338
PlotDisplayInterface myPlot = sampleNode .getSamplePlotWM ();
338
339
((WeightedMeanPlot ) myPlot ).setSpotSummaryDetails (spotSummaryDetailsWM );
339
340
((WeightedMeanPlot ) myPlot ).setAgeOrValueLookupString (selectedExpression );
341
+ refreshSampleCheckboxSelectionStatus (spotSummaryDetailsWM );
340
342
sortFractionCheckboxesByValue (spotSummaryDetailsWM );
341
343
PlotsController .plot = myPlot ;
342
344
} catch (SquidException squidException ) {
345
+ PlotsController .plot = null ;
346
+ PlotsController .spotsTreeViewCheckBox .setRoot (null );
343
347
}
344
348
345
349
} else {
@@ -355,12 +359,13 @@ public void changed(ObservableValue<? extends SquidReportColumnInterface> observ
355
359
WeightedMeanPlot .switchRefMatViewToCalibConst = false ;
356
360
PlotDisplayInterface myPlot = new WeightedMeanPlot (
357
361
new Rectangle (1000 , 600 ),
358
- " Sample " + sampleNode .getNodeName (),
362
+ " Reference Material " + sampleNode .getNodeName (),
359
363
spotSummaryDetailsWM ,
360
364
selectedExpression ,
361
365
0.0 ,
362
366
plotsController );
363
367
368
+ refreshSampleCheckboxSelectionStatus (spotSummaryDetailsWM );
364
369
sortFractionCheckboxesByValue (spotSummaryDetailsWM );
365
370
PlotsController .plot = myPlot ;
366
371
sampleNode .setSamplePlotWM (myPlot );
@@ -370,6 +375,7 @@ public void changed(ObservableValue<? extends SquidReportColumnInterface> observ
370
375
if (sampleNode != null ) {
371
376
String selectedSortExpression = expressionSortComboBox .getSelectionModel ().getSelectedItem ().getExpressionName ();
372
377
sampleNode .getSpotSummaryDetailsWM ().setSelectedExpressionName (selectedSortExpression );
378
+ refreshSampleCheckboxSelectionStatus (sampleNode .getSpotSummaryDetailsWM ());
373
379
sortFractionCheckboxesByValue (sampleNode .getSpotSummaryDetailsWM ());
374
380
plotsController .refreshPlot ();
375
381
}
@@ -452,6 +458,7 @@ public void changed(ObservableValue<? extends SquidReportColumnInterface> observ
452
458
String selectedExpression = newValue .getExpressionName ();
453
459
sampleNode .getSpotSummaryDetailsWM ().setSelectedExpressionName (
454
460
selectedExpression );
461
+ refreshSampleCheckboxSelectionStatus (sampleNode .getSpotSummaryDetailsWM ());
455
462
sortFractionCheckboxesByValue (sampleNode .getSpotSummaryDetailsWM ());
456
463
plotsController .refreshPlot ();
457
464
}
@@ -732,4 +739,11 @@ private void sortFractionCheckboxesByValue(SpotSummaryDetails spotSummaryDetails
732
739
return Double .compare (valueFromNode1 , valueFromNode2 );
733
740
});
734
741
}
742
+
743
+ private void refreshSampleCheckboxSelectionStatus (SpotSummaryDetails spotSummaryDetails ){
744
+ for (int i = 0 ; i < sampleItem .getChildren ().size (); i ++) {
745
+ ((CheckBoxTreeItem <SampleTreeNodeInterface >)sampleItem .getChildren ().get (i )).setSelected (!spotSummaryDetails
746
+ .getRejectedIndices ()[i ]);
747
+ }
748
+ }
735
749
}
0 commit comments