MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / setCommand

Method setCommand

ij/src/main/java/ij/plugin/frame/Recorder.java:178–197  ·  view source on GitHub ↗

Starts recording a command. Does nothing if the recorder is not open or the command being recorded has called IJ.run().

(String command)

Source from the content-addressed store, hash-verified

176 not open or the command being recorded has called IJ.run().
177 */
178 public static void setCommand(String command) {
179 String threadName = Thread.currentThread().getName();
180 boolean isMacro = threadName.startsWith("Run$_");
181 if (threadName.contains("Popup Menu") || threadName.contains("Developer Menu"))
182 isMacro = false;
183 if ((isMacro&&!recordInMacros) || !recordingEnabled())
184 return;
185 commandName = command;
186 commandOptions = null;
187 recordPath = true;
188 imageUpdated = false;
189 imageID = 0;
190 if (scriptMode) {
191 ImagePlus imp = WindowManager.getCurrentImage();
192 imageID = imp!=null?imp.getID():0;
193 if (imageID!=0)
194 ImagePlus.addImageListener(instance);
195 }
196 //IJ.log("setCommand: "+command+" "+Thread.currentThread().getName());
197 }
198
199 /** Returns the name of the command currently being recorded, or null. */
200 public static String getCommand() {

Callers 7

runMethod · 0.95
closeImageMethod · 0.95
calculateMethod · 0.95
runThresholdCommandMethod · 0.95
runMethod · 0.95
dialogMethod · 0.95
showDialogMethod · 0.95

Calls 7

recordingEnabledMethod · 0.95
getCurrentImageMethod · 0.95
getIDMethod · 0.95
addImageListenerMethod · 0.95
startsWithMethod · 0.80
getNameMethod · 0.65
containsMethod · 0.45

Tested by

no test coverage detected