/** Adds an image to the dialog. */ public void addImage(ImagePlus image) { ImagePanel imagePanel = new ImagePanel(image); addPanel(imagePanel); if (imagePanels==null) imagePanels = new Vector(); imagePanels.add(imagePanel); }
/** Adds a Panel to the dialog. */ public void addPanel(Panel panel) { addPanel(panel, GridBagConstraints.WEST, addToSameRow ? c.insets : getInsets(5,0,0,0)); }
/** Adds an image to the dialog. */ public void addImage(ImagePlus image) { ImagePanel imagePanel = new ImagePanel(image); addPanel(imagePanel); if (imagePanels==null) imagePanels = new Vector(); imagePanels.add(imagePanel); }
/** Adds a Panel to the dialog. */ public void addPanel(Panel panel) { addPanel(panel, GridBagConstraints.WEST, addToSameRow ? c.insets : getInsets(5,0,0,0)); }
@Override public void run(String args) { GenericDialog gd = new GenericDialog("3D Test"); Panel p = createPanel(); gd.addPanel(p); gd.showDialog(); }
public void run(String arg) { Pattern macOSPattern = Pattern.compile("^Mac ?OS.*$",Pattern.CASE_INSENSITIVE); String osName = (String)System.getProperties().get("os.name"); if( osName != null && macOSPattern.matcher(osName).matches() ) { IJ.error("The Shaped-Based Averaging plugin "+ "is currently disabled on Mac OS due to Bug 29."); return; } GenericDialog gd = new GenericDialog("Rohlfing"); fg = new FileGroup("files"); FileGroupDialog fgd = new FileGroupDialog(fg, false); gd.addPanel(fgd); gd.showDialog(); if(gd.wasCanceled()) return; init(); doit(); }
public static MyMultiLineLabel addMessage( final GenericDialog gd, final String[] text, final Font font, final Color color ) { final Panel panel = new Panel(); final MyMultiLineLabel l = new MyMultiLineLabel( gd, panel, text ); l.setFont( font ); l.setForeground( color ); panel.add( l ); gd.addPanel( panel ); return l; }
static String showPathDialog(final String title, final String msg) { final GenericDialog gd = new GenericDialog(title); gd.addMessage(msg); final Panel p = new Panel(new FlowLayout()); final TextField tf = new TextField(30); p.add(tf); final Button b = new Button("..."); p.add(b); b.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { final SaveDialog sd = new SaveDialog("Select path", "untitled", ".obj"); final String dir = sd.getDirectory(); final String file = sd.getFileName(); final File f = new File(dir, file); tf.setText(f.getAbsolutePath()); } }); gd.addPanel(p); gd.showDialog(); if (gd.wasCanceled()) return null; return new File(tf.getText()).getAbsolutePath(); }
/** Displays a color selection dialog and returns the color selected by the user. */ public Color getColor() { GenericDialog gd = frame!=null?new GenericDialog(title, frame):new GenericDialog(title); gd.addSlider("Red:", 0, 255, red); gd.addSlider("Green:", 0, 255, green); gd.addSlider("Blue:", 0, 255, blue); panel = new ColorPanel(initialColor); gd.addPanel(panel, GridBagConstraints.CENTER, new Insets(10, 0, 0, 0)); colors = gd.getNumericFields(); for (int i=0; i<colors.size(); i++) ((TextField)colors.elementAt(i)).addTextListener(this); sliders = gd.getSliders(); for (int i=0; i<sliders.size(); i++) ((Scrollbar)sliders.elementAt(i)).addAdjustmentListener(this); gd.showDialog(); if (gd.wasCanceled()) return null; int red = (int)gd.getNextNumber(); int green = (int)gd.getNextNumber(); int blue = (int)gd.getNextNumber(); return new Color(red, green, blue); }
/** Displays a color selection dialog and returns the color selected by the user. */ public Color getColor() { GenericDialog gd = frame!=null?new GenericDialog(title, frame):new GenericDialog(title); gd.addSlider("Red:", 0, 255, red); gd.addSlider("Green:", 0, 255, green); gd.addSlider("Blue:", 0, 255, blue); panel = new ColorPanel(initialColor); gd.addPanel(panel, GridBagConstraints.CENTER, new Insets(10, 0, 0, 0)); colors = gd.getNumericFields(); for (int i=0; i<colors.size(); i++) ((TextField)colors.elementAt(i)).addTextListener(this); sliders = gd.getSliders(); for (int i=0; i<sliders.size(); i++) ((Scrollbar)sliders.elementAt(i)).addAdjustmentListener(this); gd.showDialog(); if (gd.wasCanceled()) return null; int red = (int)gd.getNextNumber(); int green = (int)gd.getNextNumber(); int blue = (int)gd.getNextNumber(); return new Color(red, green, blue); }
void addPanels(GenericDialog gd) { Panel p = new Panel(); p.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0)); input = new Button("Input..."); input.addActionListener(this); p.add(input); inputDir = new TextField(Prefs.get("batch.input", ""), 45); p.add(inputDir); gd.addPanel(p); p = new Panel(); p.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0)); output = new Button("Output..."); output.addActionListener(this); p.add(output); outputDir = new TextField(Prefs.get("batch.output", ""), 45); p.add(outputDir); gd.addPanel(p); }
void addPanels(GenericDialog gd) { Panel p = new Panel(); p.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0)); input = new Button("Input..."); input.addActionListener(this); p.add(input); inputDir = new TextField(Prefs.get("batch.input", ""), 45); p.add(inputDir); gd.addPanel(p); p = new Panel(); p.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0)); output = new Button("Output..."); output.addActionListener(this); p.add(output); outputDir = new TextField(Prefs.get("batch.output", ""), 45); p.add(outputDir); gd.addPanel(p); }
void addPanels(GenericDialog gd) { Panel p = new Panel(); p.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0)); if (virtualStack==null) { input = new Button("Input..."); input.addActionListener(this); p.add(input); inputDir = new TextField(Prefs.get("batch.input", ""), 45); p.add(inputDir); gd.addPanel(p); } p = new Panel(); p.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0)); output = new Button("Output..."); output.addActionListener(this); p.add(output); outputDir = new TextField(Prefs.get("batch.output", ""), 45); p.add(outputDir); gd.addPanel(p); }
void addButtons(GenericDialog gd) { Panel p = new Panel(); p.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0)); test = new Button("Test"); test.addActionListener(this); p.add(test); open = new Button("Open..."); open.addActionListener(this); p.add(open); save = new Button("Save..."); save.addActionListener(this); p.add(save); gd.addPanel(p); }
public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr) { gd = new GenericDialog("Convolver..."); gd.addTextAreas(kernelText, null, 10, 30); gd.addPanel(makeButtonPanel(gd)); gd.addCheckbox("Normalize Kernel", normalizeFlag); gd.addPreviewCheckbox(pfr); gd.addDialogListener(this); gd.showDialog(); if (gd.wasCanceled()) return DONE; this.pfr = pfr; return IJ.setupDialog(imp, flags); }
void addButtons(GenericDialog gd) { Panel p = new Panel(); p.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 0)); test = new Button("Test"); test.addActionListener(this); p.add(test); open = new Button("Open..."); open.addActionListener(this); p.add(open); save = new Button("Save..."); save.addActionListener(this); p.add(save); gd.addPanel(p); }
public int showDialog(ImagePlus imp, String command, PlugInFilterRunner pfr) { gd = new GenericDialog("Convolver..."); gd.addTextAreas(kernelText, null, 10, 30); gd.addPanel(makeButtonPanel(gd)); gd.addCheckbox("Normalize Kernel", normalizeFlag); gd.addPreviewCheckbox(pfr); gd.addDialogListener(this); gd.showDialog(); if (gd.wasCanceled()) return DONE; this.pfr = pfr; return IJ.setupDialog(imp, flags); }
public void run(String arg) { if (!RJ.check()) return; final ImagePlus input = RJ.imageplus(); if (input == null) return; RJ.log(RJ.name()+" "+RJ.version()+": Exponential"); RJ.options(); GenericDialog gd = new GenericDialog(RJ.name()+": Exponential"); gd.addStringField("Lambda:",lambda); gd.addPanel(new Panel(),GridBagConstraints.EAST,new Insets(0,0,0,0)); gd.addChoice("Insertion:",inserts,inserts[insert]); if (position.x >= 0 && position.y >= 0) { gd.centerDialog(false); gd.setLocation(position); } else gd.centerDialog(true); gd.addWindowListener(this); gd.showDialog(); if (gd.wasCanceled()) return; lambda = gd.getNextString(); insert = gd.getNextChoiceIndex(); (new RJExponential()).run(input,lambda,insert); }
public void run(String arg) { if (!RJ.check()) return; final ImagePlus input = RJ.imageplus(); if (input == null) return; RJ.log(RJ.name()+" "+RJ.version()+": Gamma"); RJ.options(); GenericDialog gd = new GenericDialog(RJ.name()+": Gamma"); gd.addStringField("Order:",order); gd.addPanel(new Panel(),GridBagConstraints.EAST,new Insets(0,0,0,0)); gd.addChoice("Insertion:",inserts,inserts[insert]); if (position.x >= 0 && position.y >= 0) { gd.centerDialog(false); gd.setLocation(position); } else gd.centerDialog(true); gd.addWindowListener(this); gd.showDialog(); if (gd.wasCanceled()) return; order = gd.getNextString(); insert = gd.getNextChoiceIndex(); (new RJGamma()).run(input,order,insert); }
gd.addStringField("Min:",min); gd.addStringField("Max:",max); gd.addPanel(new Panel(),GridBagConstraints.EAST,new Insets(0,0,0,0)); gd.addChoice("Insertion:",inserts,inserts[insert]);