public void run(String arg) { ImagePlus imp = WindowManager.getImage(id); if (imp != null && imp.getWindow() != null) { imp.getWindow().toFront(); return; } int colorWidth = 22; int colorHeight = 16; int columns = 5; int rows = 20; int width = columns * colorWidth; int height = rows * colorHeight; ColorGenerator cg = new ColorGenerator(width, height, new int[width * height], this); cg.drawColors(colorWidth, colorHeight, columns, rows); setProcessor("CP", cg); id = getID(); show(); IJ.register(ColorPicker.class); }
void abortPluginOrMacro(ImagePlus imp) { if (imp != null) { ImageWindow win = imp.getWindow(); if (win != null) { win.running = false; win.running2 = false; } } Macro.abort(); Interpreter.abort(); if (Interpreter.getInstance() != null) IJ.beep(); }
private boolean ignoreArrowKeys(ImagePlus imp) { Frame frame = WindowManager.getFrontWindow(); String title = frame.getTitle(); if (title != null && title.equals("ROI Manager")) return true; // Control Panel? if (frame != null && frame instanceof javax.swing.JFrame) return true; ImageWindow win = imp.getWindow(); // LOCI Data Browser window? if (imp.getStackSize() > 1 && win != null && win.getClass().getName().startsWith("loci")) return true; return false; }