Skip to content

Commit

Permalink
consumers still required
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed May 31, 2024
1 parent 76a4139 commit 2aa1def
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/main/java/ai/nets/samj/ij/ui/IJ1PromptsProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,18 @@ public class IJ1PromptsProvider implements PromptsResultsDisplay, MouseListener,
* All the points being collected that reference the background (ctrl + alt)
*/
private List<Localizable> collecteNegPoints = new ArrayList<Localizable>();
/**
* Consumer to alter the state of the Rectangle ROI button
*/
private BooleanConsumer rectIconConsumer;
/**
* Consumer to alter the state of the Points ROI button
*/
private BooleanConsumer pointsIconConsumer;
/**
* Consumer to alter the state of the Freeline ROI button
*/
private BooleanConsumer freelineIconConsumer;
/**
* The number of words per line in the error message dialogs
*/
Expand Down Expand Up @@ -616,6 +628,21 @@ public void improveExistingMask(File mask) {
throw new IllegalArgumentException("The file selected does not correspond to an image.");
}
}

@Override
public void setRectIconConsumer(BooleanConsumer consumer) {
this.rectIconConsumer = consumer;
}

@Override
public void setPointsIconConsumer(BooleanConsumer consumer) {
this.pointsIconConsumer = consumer;
}

@Override
public void setFreelineIconConsumer(BooleanConsumer consumer) {
this.freelineIconConsumer = consumer;
}

// ===== unused events =====
@Override
Expand Down Expand Up @@ -651,12 +678,15 @@ public void eventOccurred(int eventID) {
return;
if (this.isRect && !IJ.getToolName().equals("rectangle")) {
this.isRect = false;
this.rectIconConsumer.accept(false);
return;
} else if (this.isPoints && !IJ.getToolName().equals("point") && !IJ.getToolName().equals("multipoint")) {
this.isPoints = false;
this.pointsIconConsumer.accept(false);
return;
} else if (this.isFreehand && !IJ.getToolName().equals("freeline")) {
this.isFreehand = false;
this.freelineIconConsumer.accept(false);
return;
}

Expand Down

0 comments on commit 2aa1def

Please sign in to comment.