APISonar


ijx.IJ.log

> ijx > IJ > log
ijx APIs IJ APIs log APIs

Example 1
public void dumpProgram() {
		IJ.log("");
		IJ.log("Tokenized Program");
		String str;
		int token, address;
		for (int i=0; i<=pc; i++) 
			IJ.log(i+"	 "+lineNumbers[i]+"   "+(code[i]&TOK_MASK)+"   "+decodeToken(code[i]));
	}
Example 2
public Object readPixels(String url) {
		java.net.URL theURL;
		InputStream is;
		try {theURL = new URL(url);}
		catch (MalformedURLException e) {IJ.log(""+e); return null;}
		try {is = theURL.openStream();}
		catch (IOException e) {IJ.log(""+e); return null;}
		return readPixels(is);
	}
Example 3
public void dragEnter(DropTargetDragEvent e)  {
	    	IJ.showStatus("<<Drag and Drop>>");
			if (IJ.debugMode) IJ.log("DragEnter: "+e.getLocation());
			e.acceptDrag(DnDConstants.ACTION_COPY);
			openAsVirtualStack = false;
	    }
Example 4
public int[] s2ints(String s) {
		StringTokenizer st = new StringTokenizer(s, ", \t");
		int nInts = st.countTokens();
		int[] ints = new int[nInts];
		for(int i=0; i<nInts; i++) {
			try {ints[i] = Integer.parseInt(st.nextToken());}
			catch (NumberFormatException e) {IJ.log(""+e); return null;}
		}
		return ints;
	}
Example 5
IjxImagePlus openPngUsingURL(String title, URL url) {
		if (url==null) return null;
		Image img = null;
		try {
			img = ImageIO.read(url);
		} catch (IOException e) {
			IJ.log(""+e);
		}
		if (img!=null) {
			IjxImagePlus imp = IJ.getFactory().newImagePlus(title, img);
			return imp;
		} else
			return null;
	}
Example 6
public void dumpSymbolTable() {
		IJ.log("");
		IJ.log("Symbol Table");
		for (int i=0; i<=maxSymbols; i++) {
			Symbol symbol = table[i];
			if (symbol==null)
				break;
			IJ.log(i+" "+symbol);
		}
	}
Example 7
void print(IjxImagePlus imp) {
		PrinterJob pj = PrinterJob.getPrinterJob();
		pj.setPrintable(this);
		//pj.pageDialog(pj.defaultPage());
		if (IJ.macroRunning() || pj.printDialog()) {
			imp.startTiming();
			try {pj.print(); }
			catch (PrinterException e) {
				IJ.log(""+e);
			}
		}
	}
Example 8
private static void loadClasses() {
		if (IJ.isMacOSX() && !IJ.isJava16() && IJ.getApplet()==null) {
			try {
				if (new File("/System/Library/Java/com/apple/cocoa/application/NSWorkspace.class").exists()) {
					ClassLoader classLoader = new URLClassLoader(new URL[]{new File("/System/Library/Java").toURL()});
					mrjFileUtilsClass = Class.forName("com.apple.cocoa.application.NSWorkspace", true, classLoader);
				} else
					mrjFileUtilsClass = Class.forName("com.apple.cocoa.application.NSWorkspace");
				openURL = mrjFileUtilsClass.getDeclaredMethod("openURL", new Class[] { java.net.URL.class });
			} catch (Exception e) {
				IJ.log("BrowserLauncher"+e);
				error = true;
			}
		}
	}
Example 9
private void openURL(String url) {
			if (IJ.debugMode) IJ.log("DragAndDrop.openURL: "+url);
			if (url!=null)
				IJ.open(url);
		}
Example 10
public static void recordCall(String call) {
		if (IJ.debugMode) IJ.log("recordCall: "+call+"  "+commandName);
		if (textArea!=null && scriptMode && !IJ.macroRunning()) {
			textArea.append(call+"\n");
			commandName = null;
 		}
	}
Example 11
public void mousePressed(MouseEvent e) {
        Undo.reset();
        IJ.showStatus("Memory: " + IJ.freeMemory());
        if (IJ.debugMode) {
            IJ.log("Windows: " + WindowManager.getWindowCount());
        }
    }
Example 12
static void showList() {
        if (IJ.debugMode) {
            for (int i = 0; i < imageList.size(); i++) {
                IjxImageWindow win = (IjxImageWindow) imageList.elementAt(i);
                IjxImagePlus imp = win.getImagePlus();
                IJ.log(i + " " + imp.getTitle() + (win == currentWindow ? "*" : ""));
            }
            IJ.log(" ");
        }
    }
Example 13
static void error(String msg, FileInfo fi, long offset, long length) {
		String msg2 = "FileInfo parameter error. \n"
			+msg + "\n \n"
			+"  Width: " + fi.width + "\n"
			+"  Height: " + fi.height + "\n"
			+"  Offset: " + offset + "\n"
			+"  Bytes/pixel: " + fi.getBytesPerPixel() + "\n"
			+(length>0?"  File length: " + length + "\n":"");
		if (silentMode) {
			IJ.log("Error opening "+fi.directory+fi.fileName);
			IJ.log(msg2);
		} else
			IJ.error("FileOpener", msg2);
	}
Example 14
public void addDialogListener(DialogListener dl) {
        if (dialogListeners == null)
            dialogListeners = new Vector();
        dialogListeners.addElement(dl);
        if (IJ.debugMode) IJ.log("GenericDialog: Listener added: "+dl);
    }
Example 15
public TextRoi(int x, int y, String text, Font font) {
		super(x, y, 1, 1);
		String[] lines = Tools.split(text, "\n");
		int count = Math.min(lines.length, MAX_LINES);
		for (int i=0; i<count; i++)
			theText[i] = lines[i];
		if (font==null) font = new Font(name, style, size);
		instanceFont = font;
		firstChar = false;
		if (IJ.debugMode) IJ.log("TextRoi: "+theText[0]+"  "+width+","+height);
	}
Example 16
public static void updateMenus() {
        long start = System.currentTimeMillis();
        IjxMenus m = CentralLookup.getDefault().lookup(IjxMenus.class);
        m.updateImageJMenus();
        if (IJ.debugMode) {
            IJ.log("Refresh Menus: " + (System.currentTimeMillis() - start) + " ms");
        }
    }
Example 17
public static void record(String method, String arg) {
		if (IJ.debugMode) IJ.log("record: "+method+"  "+arg);
		boolean sw = method.equals("selectWindow");
		if (textArea!=null && !(scriptMode&&sw||commandName!=null&&sw)) {
			if (scriptMode && method.equals("roiManager"))
				textArea.append("rm.runCommand(\""+arg+"\");\n");
			else {
				if (method.equals("setTool"))
					method = "//"+(scriptMode?"IJ.":"")+method;
				textArea.append(method+"(\""+arg+"\");\n");
			}
		}
	}
Example 18
public void dragOver(DropTargetDragEvent e) {
			if (IJ.debugMode) IJ.log("DragOver: "+e.getLocation());
			Point loc = e.getLocation();
			int buttonSize = ((IjxToolbar) CentralLookup.getDefault().lookup(IjxToolbar.class)).getButtonSize();
			int width = IJ.getTopComponent().getSize().width;
			openAsVirtualStack = width-loc.x<=buttonSize;
			if (openAsVirtualStack)
	    		IJ.showStatus("<<Open as Virtual Stack>>");
	    	else
	    		IJ.showStatus("<<Drag and Drop>>");
	    }
Example 19
public ImageProcessor getProcessor(int n) {
		if (n<1 || n>nImages)
			throw new IllegalArgumentException("Argument out of range: "+n);
		if (IJ.debugMode) IJ.log("FileInfoVirtualStack.getProcessor: "+n);
		info[n-1].nImages = 1; // why is this needed?
		FileOpener fo = new FileOpener(info[n-1]);
		IjxImagePlus imp = fo.open(false);
		if (imp!=null)
			return imp.getProcessor();
		else
			return null;
	 }
Example 20
public IjxImageStack sort(IjxImageStack stack) {
		if (IJ.debugMode) IJ.log("DICOM_Sorter: sorting by image number");
		if (stack.getSize()==1) return stack;
		String[] strings = getSortStrings(stack, "0020,0013");
		if (strings==null) return stack;
		StringSorter.sort(strings);
		IjxImageStack stack2 = sortStack(stack, strings);
		return stack2!=null?stack2:stack;
	}
Example 21
public FileOpener(FileInfo fi) {
		this.fi = fi;
		if (fi!=null) {
			width = fi.width;
			height = fi.height;
		}
		if (IJ.debugMode) IJ.log("FileInfo: "+fi);
	}
Example 22
void deleteParticle(int x, int y, ByteProcessor ip, Wand wand) {
        wand.autoOutline(x, y, 255, 255);
        if (wand.npoints==0) {
            IJ.log("wand error selecting edge particle at x, y = "+x+", "+y);
            return;
        }
        Roi roi = new PolygonRoi(wand.xpoints, wand.ypoints, wand.npoints, Roi.TRACED_ROI);
        ip.snapshot();                  //prepare for reset outside of mask
        ip.setRoi(roi);
        ip.fill();
        ip.reset(ip.getMask());
    }