Skip to content

Commit 2aa1def

Browse files
committed
consumers still required
1 parent 76a4139 commit 2aa1def

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/main/java/ai/nets/samj/ij/ui/IJ1PromptsProvider.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,18 @@ public class IJ1PromptsProvider implements PromptsResultsDisplay, MouseListener,
151151
* All the points being collected that reference the background (ctrl + alt)
152152
*/
153153
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;
154166
/**
155167
* The number of words per line in the error message dialogs
156168
*/
@@ -616,6 +628,21 @@ public void improveExistingMask(File mask) {
616628
throw new IllegalArgumentException("The file selected does not correspond to an image.");
617629
}
618630
}
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+
}
619646

620647
// ===== unused events =====
621648
@Override
@@ -651,12 +678,15 @@ public void eventOccurred(int eventID) {
651678
return;
652679
if (this.isRect && !IJ.getToolName().equals("rectangle")) {
653680
this.isRect = false;
681+
this.rectIconConsumer.accept(false);
654682
return;
655683
} else if (this.isPoints && !IJ.getToolName().equals("point") && !IJ.getToolName().equals("multipoint")) {
656684
this.isPoints = false;
685+
this.pointsIconConsumer.accept(false);
657686
return;
658687
} else if (this.isFreehand && !IJ.getToolName().equals("freeline")) {
659688
this.isFreehand = false;
689+
this.freelineIconConsumer.accept(false);
660690
return;
661691
}
662692

0 commit comments

Comments
 (0)