/** Returns the "Results" TextWindow. */ public static TextWindow getResultsWindow() { Frame f = WindowManager.getFrame("Results"); if (f==null || !(f instanceof TextWindow)) return null; else return (TextWindow)f; }
/** Returns the "Results" TextWindow. */ public static TextWindow getResultsWindow() { Frame f = WindowManager.getFrame("Results"); if (f==null || !(f instanceof TextWindow)) return null; else return (TextWindow)f; }
protected static TextWindow getTextWindow(final String windowtitle) { final Frame f = WindowManager.getFrame(windowtitle); if (f == null || !(f instanceof TextWindow)) return null; return (TextWindow) f; }
public void showLogWindow() { Frame log = WindowManager.getFrame("Log"); if (log!=null) log.toFront(); else IJ.log(""); }
private void toFront(String title) { if (title==null) return; Frame frame = WindowManager.getFrame(title); if (frame!=null) { frame.toFront(); WindowManager.setWindow(frame); } }
public void showLogWindow() { Frame log = WindowManager.getFrame("Log"); if (log!=null) log.toFront(); else IJ.log(""); }
private void toFront(String title) { if (title==null) return; Frame frame = WindowManager.getFrame(title); if (frame!=null) { frame.toFront(); WindowManager.setWindow(frame); } }
protected void deletePoint(int index) { super.deletePoint(index); if (index>=0 && index<=nPoints && counters!=null) { counts[counters[index]]--; for (int i=index; i<nPoints; i++) { counters[i] = counters[i+1]; positions[i] = positions[i+1]; } if (rt!=null && WindowManager.getFrame(getCountsTitle())!=null) displayCounts(); } }
protected void deletePoint(int index) { super.deletePoint(index); if (index>=0 && index<=nPoints && counters!=null) { counts[counters[index]]--; for (int i=index; i<nPoints; i++) { counters[i] = counters[i+1]; positions[i] = positions[i+1]; } if (rt!=null && WindowManager.getFrame(getCountsTitle())!=null) displayCounts(); } }
/** Changes the name of a table window from 'oldTitle' to 'newTitle'. */ public static void renameResults(String oldTitle, String newTitle) { Frame frame = WindowManager.getFrame(oldTitle); if (frame==null) { error("Rename", "\""+oldTitle+"\" not found"); return; } else if (frame instanceof TextWindow) { TextWindow tw = (TextWindow)frame; if (tw.getResultsTable()==null) { error("Rename", "\""+oldTitle+"\" is not a table"); return; } tw.rename(newTitle); } else error("Rename", "\""+oldTitle+"\" is not a table"); }
@Override public void run(String arg) { GenericDialog gd = new GenericDialog("Center Transformation"); AmiraParameters.addAmiraTableList(gd, "Model table"); AmiraParameters.addAmiraTableList(gd, "Template table"); gd.addNumericField("radius", 10, 2); gd.showDialog(); if (gd.wasCanceled()) return; String titleM = gd.getNextChoice(); String titleT = gd.getNextChoice(); float radius = (float)gd.getNextNumber(); AmiraTable tableModel = (AmiraTable)WindowManager.getFrame(titleM); AmiraTable tableTemplate = (AmiraTable)WindowManager.getFrame(titleT); bestRigid(tableModel, tableTemplate); }
/** Changes the name of a table window from 'oldTitle' to 'newTitle'. */ public static void renameResults(String oldTitle, String newTitle) { Frame frame = WindowManager.getFrame(oldTitle); if (frame==null) { error("Rename", "\""+oldTitle+"\" not found"); return; } else if (frame instanceof TextWindow) { TextWindow tw = (TextWindow)frame; if (tw.getResultsTable()==null) { error("Rename", "\""+oldTitle+"\" is not a table"); return; } tw.rename(newTitle); } else error("Rename", "\""+oldTitle+"\" is not a table"); }
try { return new TaskOnEDT<ResultsTable>(new Callable<ResultsTable>() { @Override public ResultsTable call() { final TextWindow tw = (TextWindow)WindowManager.getFrame(title); if (null != tw) { // hacking again ... missing a getResultsTable() method in TextWindow final ResultsTable rt = (ResultsTable)Utils.getField(tw.getTextPanel(), "rt"); if (null != rt) return rt; // assumes columns will be identical } // else create a new one final ResultsTable rt = new ResultsTable(); rt.setPrecision(2); for (int i=0; i<columns.length; i++) rt.setHeading(i, columns[i]); // return rt; }}).get(); } catch (final Throwable t) { IJError.print(t); return null; } }
private Variable getSelectionEnd() { int selEnd = -1; String title = getTitleArg(); if (title != null){ Frame f = WindowManager.getFrame(title); if (f!=null && (f instanceof TextWindow)){ TextWindow tWin = (TextWindow)f; selEnd = tWin.getTextPanel().getSelectionEnd(); return new Variable(selEnd); } } interp.error("Title of table missing or not found"); return new Variable(selEnd); }
/** * analyse dialog, and setup inner fields of the class. */ private void parseDialogOptions() { String tableName = this.gd.getNextChoice(); Frame tableFrame = WindowManager.getFrame(tableName); this.table = ((TextWindow) tableFrame).getTextPanel().getResultsTable(); this.selectedHeaderName = this.gd.getNextChoice(); this.minValue = this.gd.getNextNumber(); this.maxValue = this.gd.getNextNumber(); }
private Variable getSelectionStart() { int selStart = -1; String title = getTitleArg(); if (title != null){ Frame f = WindowManager.getFrame(title); if (f!=null && (f instanceof TextWindow)){ TextWindow tWin = (TextWindow)f; selStart = tWin.getTextPanel().getSelectionStart(); return new Variable(selStart); } } interp.error("Title of table missing or not found"); return new Variable(selStart); }
private Variable getSelectionStart() { int selStart = -1; String title = getTitleArg(); if (title != null){ Frame f = WindowManager.getFrame(title); if (f!=null && (f instanceof TextWindow)){ TextWindow tWin = (TextWindow)f; selStart = tWin.getTextPanel().getSelectionStart(); return new Variable(selStart); } } interp.error("Title of table missing or not found"); return new Variable(selStart); }
private Variable getSelectionEnd() { int selEnd = -1; String title = getTitleArg(); if (title != null){ Frame f = WindowManager.getFrame(title); if (f!=null && (f instanceof TextWindow)){ TextWindow tWin = (TextWindow)f; selEnd = tWin.getTextPanel().getSelectionEnd(); return new Variable(selEnd); } } interp.error("Title of table missing or not found"); return new Variable(selEnd); }
@Override public void run(ImageProcessor ip) { GenericDialog gd = new GenericDialog("Center Transformation"); AmiraParameters.addAmiraTableList(gd, "Statistics"); gd.showDialog(); if (gd.wasCanceled()) return; String titleM = gd.getNextChoice(); AmiraTable statistics = (AmiraTable)WindowManager.getFrame(titleM); ImagePlus centers = getCenters(statistics); centers.show(); centers.updateAndDraw(); }
@Override public void run(ImageProcessor ip) { GenericDialog gd = new GenericDialog("Show Label Centers"); AmiraParameters.addAmiraTableList(gd, "Statistics file"); gd.addNumericField("Radius", 10, 2); gd.showDialog(); if (gd.wasCanceled()) return; String title = gd.getNextChoice(); AmiraTable table = (AmiraTable)WindowManager.getFrame(title); double radius = gd.getNextNumber(); calculateCenters(image, table, radius).show(); }