/** Display the contents of the active edge table*/ void printActiveEdges() { for (int i=0; i<activeEdges; i++) { int index =aedge[i]; IJ.log(i+" "+ex[index]+" "+ey1[index]+" "+ey2[index] ); } }
void log(String s) { if (evaluating) evalOutput = s; else IJ.log(s); }
/** Returns the ResultsTable associated with this TextPanel, or null. */ public ResultsTable getResultsTable() { if (IJ.debugMode) IJ.log("getResultsTable: "+rt); return rt; }
void enlargeSymbolTable() { Symbol[] tmp = new Symbol[maxSymbols*2]; System.arraycopy(table, 0, tmp, 0, maxSymbols); table = tmp; maxSymbols *= 2; if (IJ.debugMode) IJ.log("enlargeSymbolTable: "+table.length); }
String getString(int length) throws IOException { byte[] b = new byte[length]; f.readFully(b); if (IJ.debugMode) IJ.log(new String(b)); return new String(b); }
protected static int getInt(Properties props, String key) { String s = props.getProperty(key); if (s!=null) { try { return Integer.decode(s).intValue(); } catch (NumberFormatException e) {IJ.log(""+e);} } return -1; }
/** Finds an int in IJ_Props or IJ_Prefs.txt. */ public static int getInt(String key, int defaultValue) { if (props==null) //workaround for Netscape JIT bug return defaultValue; String s = props.getProperty(key); if (s!=null) { try { return Integer.decode(s).intValue(); } catch (NumberFormatException e) {IJ.log(""+e);} } return defaultValue; }
/** Runs the RunAtStartup and AutoRun macros, on the current thread if 'batchMode' true, otherwise on a separate thread. */ public void run(boolean batchMode) { if (IJ.debugMode) IJ.log("StartupRunner: "+batchMode); if (batchMode) run(); else { Thread thread = new Thread(this, "StartupRunner"); thread.start(); } }
private synchronized void showSimplex(double[][] simp, String heading) { IJ.log("Minimizer: "+heading); for (int i = 0; i < numVertices; i++) showVertex(simp[i], null); } private synchronized void showVertex(double[] vertex, String heading) {
Options() { if (gd != null) { gd.toFront(); return; } options = this; if (IJ.debugMode) IJ.log("Options: true"); showDialog(); }
/** Returns the directory selected by the user. */ public String getDirectory() { if (IJ.debugMode) IJ.log("DirectoryChooser.getDirectory: "+directory); if (Recorder.record && !IJ.isMacOSX()) Recorder.recordPath(title, directory); return directory; }
static void repaintTool(int tool) { if (IJ.getInstance()!=null) { Toolbar tb = getInstance(); Graphics g = tb.getGraphics(); if (IJ.debugMode) IJ.log("Toolbar.repaintTool: "+tool+" "+g); if (g==null) return; if (Prefs.antialiasedTools) ((Graphics2D)g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); tb.drawButton(g, tool); if (g!=null) g.dispose(); } }
public void keyTyped(KeyEvent e) { char keyChar = e.getKeyChar(); int flags = e.getModifiers(); if (IJ.debugMode) IJ.log("keyTyped: char=\"" + keyChar + "\" (" + (int)keyChar + "), flags= "+Integer.toHexString(flags)+ " ("+KeyEvent.getKeyModifiersText(flags)+")"); if (keyChar=='\\' || keyChar==171 || keyChar==223) { if (((flags&Event.ALT_MASK)!=0)) doCommand("Animation Options..."); else doCommand("Start Animation [\\]"); } }
void compileAndRun() { if (path==null) saveAs(); if (path!=null) { save(); String text = ta.getText(); if (text.contains("implements PlugInFilter") && text.contains("IJ.run(")) IJ.log("<<Plugins that call IJ.run() should probably implement PlugIn, not PlugInFilter.>>"); IJ.runPlugIn("ij.plugin.Compiler", path); } }
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; }
public void windowStateChanged(WindowEvent e) { int oldState = e.getOldState(); int newState = e.getNewState(); if (IJ.debugMode) IJ.log("windowStateChanged: "+oldState+" "+newState); if ((oldState&Frame.MAXIMIZED_BOTH)==0 && (newState&Frame.MAXIMIZED_BOTH)!=0) maximize(); }
/** Frees RAM by setting the snapshot (undo) buffer in the current ImageProcessor to null. */ public void trimProcessor() { ImageProcessor ip2 = ip; if (!locked && ip2!=null) { if (IJ.debugMode) IJ.log(title + ": trimProcessor"); Roi roi2 = getRoi(); if (roi2!=null && roi2.getPasteMode()!=Roi.NOT_PASTING) roi2.endPaste(); ip2.setSnapshotPixels(null); } }
/** Upon window closing, the panel removes itself from the vector of visible panels (member of pcp). * Then, if this is the only visible panel left, the properties are saved; else, if this is the * main panel, all other visible panels are also closed and properties * are saved */ public void windowClosing(WindowEvent e) { if (IJ.debugMode) IJ.log("CP.windowClosing: "+isMainPanel); if (isMainPanel) pcp.saveProperties(); pcp.unsetPanelShowingProperty(getRootPath().toString()); }
public void dragOver(DropTargetDragEvent e) { if (IJ.debugMode) IJ.log("DragOver: "+e.getLocation()); Point loc = e.getLocation(); int buttonSize = Toolbar.getButtonSize(); int width = IJ.getInstance().getSize().width; openAsVirtualStack = width-loc.x<=buttonSize; if (openAsVirtualStack) IJ.showStatus("<<Open as Virtual Stack>>"); else IJ.showStatus("<<Drag and Drop>>"); }