@@ -151,6 +151,18 @@ public class IJ1PromptsProvider implements PromptsResultsDisplay, MouseListener,
151
151
* All the points being collected that reference the background (ctrl + alt)
152
152
*/
153
153
private List <Localizable > collecteNegPoints = new ArrayList <Localizable >();
154
+ /**
155
+ * Consumer to alter the state of the Rectangle ROI button
156
+ */
157
+ private BooleanConsumer rectIconConsumer ;
158
+ /**
159
+ * Consumer to alter the state of the Points ROI button
160
+ */
161
+ private BooleanConsumer pointsIconConsumer ;
162
+ /**
163
+ * Consumer to alter the state of the Freeline ROI button
164
+ */
165
+ private BooleanConsumer freelineIconConsumer ;
154
166
/**
155
167
* The number of words per line in the error message dialogs
156
168
*/
@@ -616,6 +628,21 @@ public void improveExistingMask(File mask) {
616
628
throw new IllegalArgumentException ("The file selected does not correspond to an image." );
617
629
}
618
630
}
631
+
632
+ @ Override
633
+ public void setRectIconConsumer (BooleanConsumer consumer ) {
634
+ this .rectIconConsumer = consumer ;
635
+ }
636
+
637
+ @ Override
638
+ public void setPointsIconConsumer (BooleanConsumer consumer ) {
639
+ this .pointsIconConsumer = consumer ;
640
+ }
641
+
642
+ @ Override
643
+ public void setFreelineIconConsumer (BooleanConsumer consumer ) {
644
+ this .freelineIconConsumer = consumer ;
645
+ }
619
646
620
647
// ===== unused events =====
621
648
@ Override
@@ -651,12 +678,15 @@ public void eventOccurred(int eventID) {
651
678
return ;
652
679
if (this .isRect && !IJ .getToolName ().equals ("rectangle" )) {
653
680
this .isRect = false ;
681
+ this .rectIconConsumer .accept (false );
654
682
return ;
655
683
} else if (this .isPoints && !IJ .getToolName ().equals ("point" ) && !IJ .getToolName ().equals ("multipoint" )) {
656
684
this .isPoints = false ;
685
+ this .pointsIconConsumer .accept (false );
657
686
return ;
658
687
} else if (this .isFreehand && !IJ .getToolName ().equals ("freeline" )) {
659
688
this .isFreehand = false ;
689
+ this .freelineIconConsumer .accept (false );
660
690
return ;
661
691
}
662
692
0 commit comments