/** Adds an 8 column text field. * @param label the label * @param defaultText the text initially displayed */ public void addStringField(String label, String defaultText) { addStringField(label, defaultText, 8); }
/** Adds an 8 column text field. * @param label the label * @param defaultText the text initially displayed */ public void addStringField(String label, String defaultText) { addStringField(label, defaultText, 8); }
void addRange(GenericDialog gd, String label, int start, int end) { gd.addStringField(label, start+"-"+end); }
@Override public void run(ImageProcessor ip) { GenericDialog gd = new GenericDialog("Transform Parameters"); gd.addStringField("files", ""); gd.addStringField("matrices", ""); gd.showDialog(); if (gd.wasCanceled()) return; String[] fileNames = gd.getNextString().split(","); FastMatrix[] matrices = FastMatrix.parseMatrices( gd.getNextString()); new AverageBrain().doit(image, fileNames, matrices); }
@Override public void addStringField(String label, String defaultString, int columns) { super.addStringField(label, defaultString, columns); if (isHeadless()) return; TextField text = (TextField)stringField.lastElement(); text.setDropTarget(null); new DropTarget(text, new TextDropTarget(text)); }
/** Allows the user to enter a string in a dialog box. Returns "" if the user cancels the dialog box. */ public static String getString(String prompt, String defaultString) { GenericDialog gd = new GenericDialog(""); gd.addStringField(prompt, defaultString, 20); gd.showDialog(); if (gd.wasCanceled()) return ""; return gd.getNextString(); }
void getBinaryValue (String title, String prompt, String defaultValue) { gd = new GenericDialog(title); gd.addStringField(prompt, defaultValue); gd.addPreviewCheckbox(pfr); gd.addDialogListener(this); gd.showDialog(); }
String promptForName(String name) { GenericDialog gd = new GenericDialog("ROI Manager"); gd.addStringField("Rename As:", name, 20); gd.showDialog(); if (gd.wasCanceled()) return null; else return gd.getNextString(); }
String getEquation() { GenericDialog gd = new GenericDialog("Formula"); gd.addStringField("Formula:", equation, 38); gd.showDialog(); if (gd.wasCanceled()) return null; equation = gd.getNextString(); return equation; }
void getBinaryValue (String title, String prompt, String defaultValue) { gd = new GenericDialog(title); gd.addStringField(prompt, defaultValue); gd.addPreviewCheckbox(pfr); gd.addDialogListener(this); gd.showDialog(); }
/** Allows the user to enter a string in a dialog box. Returns "" if the user cancels the dialog box. */ public static String getString(String prompt, String defaultString) { GenericDialog gd = new GenericDialog(""); gd.addStringField(prompt, defaultString, 20); gd.showDialog(); if (gd.wasCanceled()) return ""; return gd.getNextString(); }
String promptForName(String name) { GenericDialog gd = new GenericDialog("ROI Manager"); gd.addStringField("Rename As:", name, 20); gd.showDialog(); if (gd.wasCanceled()) return null; else return gd.getNextString(); }
String getEquation() { GenericDialog gd = new GenericDialog("Formula"); gd.addStringField("Formula:", equation, 38); gd.showDialog(); if (gd.wasCanceled()) return null; equation = gd.getNextString(); return equation; }
private void renameMaterial() { GenericDialog gd = new GenericDialog("Rename"); gd.addStringField("name", getSelectedItem()); gd.showDialog(); if (gd.wasCanceled()) return; String newName = gd.getNextString(); if (newName.indexOf(' ') >= 0) { newName = newName.replace(' ', '_'); IJ.showMessage("Names cannot contain spaces; using '" + newName + "' instead!"); } renameMaterial(newName); }
/** * Opens an input dialog to ask the user for a new name for the specified * point * * @param p */ public void renamePoint(final BenesNamedPoint p) { final GenericDialog gd = new GenericDialog("Rename point"); gd.addStringField("New name ", p.getName()); gd.showDialog(); if (gd.wasCanceled()) return; points.rename(p, gd.getNextString()); }
/** * Prompts the user to enter their LuraWave * license code in an ImageJ dialog window. */ public static String promptLicenseCode(String code, boolean first) { GenericDialog gd = new GenericDialog("LuraWave License Code"); if (!first) gd.addMessage("Invalid license code; try again."); gd.addStringField("LuraWave_License Code: ", code, 16); gd.showDialog(); if (gd.wasCanceled()) return null; code = gd.getNextString(); if (code != null) Prefs.set(LuraWaveServiceImpl.LICENSE_PROPERTY, code); return code; }
/** * Prompts the user to enter their LuraWave * license code in an ImageJ dialog window. */ public static String promptLicenseCode(String code, boolean first) { GenericDialog gd = new GenericDialog("LuraWave License Code"); if (!first) gd.addMessage("Invalid license code; try again."); gd.addStringField("LuraWave_License Code: ", code, 16); gd.showDialog(); if (gd.wasCanceled()) return null; code = gd.getNextString(); if (code != null) Prefs.set(LuraWaveServiceImpl.LICENSE_PROPERTY, code); return code; }
private void rename() { ImagePlus imp = IJ.getImage(); GenericDialog gd = new GenericDialog("Rename"); gd.addStringField("Title:", imp.getTitle(), 30); gd.showDialog(); if (!gd.wasCanceled()) imp.setTitle(gd.getNextString()); }
private void rename() { ImagePlus imp = IJ.getImage(); GenericDialog gd = new GenericDialog("Rename"); gd.addStringField("Title:", imp.getTitle(), 30); gd.showDialog(); if (!gd.wasCanceled()) imp.setTitle(gd.getNextString()); }
boolean showDialog() { GenericDialog gd=new GenericDialog("Proxy Settings"); gd.addStringField("Proxy server:", proxyhost, 15); gd.addNumericField("Port:", proxyport , 0); gd.addCheckbox("Or, use system proxy settings", Prefs.useSystemProxies); gd.addHelp(IJ.URL+"/docs/menus/edit.html#proxy"); gd.showDialog(); if (gd.wasCanceled()) return false; proxyhost = gd.getNextString(); proxyport = (int)gd.getNextNumber(); Prefs.useSystemProxies = gd.getNextBoolean(); return true; }