From f5a5ad7e35fb3a095362bb286abb0f5deb40ec2d Mon Sep 17 00:00:00 2001 From: Stephan Saalfeld Date: Thu, 3 Sep 2015 09:08:30 -0500 Subject: [PATCH] put match intensities commands into workers to block input accordingly --- .../src/main/java/ini/trakem2/display/Display.java | 26 +++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/TrakEM2_/src/main/java/ini/trakem2/display/Display.java b/TrakEM2_/src/main/java/ini/trakem2/display/Display.java index 813d6f40..db37cb23 100644 --- a/TrakEM2_/src/main/java/ini/trakem2/display/Display.java +++ b/TrakEM2_/src/main/java/ini/trakem2/display/Display.java @@ -5546,21 +5546,31 @@ public final class Display extends DBObject implements ActionListener, IJEventLi } }); } else if (command.equals("Match intensities (layer-wise)...")) { - final MatchIntensities matching = new MatchIntensities(); - matching.invoke(getActive()); + Bureaucrat.createAndStart(new Worker.Task("Match intensities") { + @Override + public void exec() { + final MatchIntensities matching = new MatchIntensities(); + matching.invoke(getActive()); + } + }, project); } else if (command.equals("Remove intensity maps (layer-wise)...")) { final GenericDialog gd = new GenericDialog("Remove intensity maps"); Utils.addLayerRangeChoices(Display.this.layer, gd); gd.showDialog(); if (gd.wasCanceled()) return; - for (final Layer layer : getLayerSet().getLayers(gd.getNextChoiceIndex(), gd.getNextChoiceIndex())) { - for (final Displayable p : layer.getDisplayables(Patch.class)) { - final Patch patch = (Patch)p; - if (patch.clearIntensityMap()) { - patch.updateMipMaps(); + Bureaucrat.createAndStart(new Worker.Task("Match intensities") { + @Override + public void exec() { + for (final Layer layer : getLayerSet().getLayers(gd.getNextChoiceIndex(), gd.getNextChoiceIndex())) { + for (final Displayable p : layer.getDisplayables(Patch.class)) { + final Patch patch = (Patch)p; + if (patch.clearIntensityMap()) { + patch.updateMipMaps(); + } + } } } - } + }, project); } else if (command.equals("Montage")) { final Set affected = new HashSet(selection.getAffected()); // make an undo step! -- 2.11.4.GIT