gd = new NonBlockingGenericDialog( "Interactive Geodesic " + "Distance Map" ); gd.addChoice( "Distances", ChamferWeights.getAllLabels(), weights.toString() ); String[] outputTypes = new String[] { "32 bits", "16 bits" }; gd.addChoice( "Output Type", outputTypes, outputTypes[ resultAsFloat ? 0:1 ] ); gd.addCheckbox( "Normalize weights", normalize ); gd.addPreviewCheckbox( pfr ); gd.addDialogListener(this); previewing = true; gd.addHelp( "http://imagej.net/MorphoLibJ#Utilities_for_binary_images" ); gd.showDialog(); previewing = false; if (gd.wasCanceled()) return DONE; gd.getNextChoice()); resultAsFloat = gd.getNextChoiceIndex() == 0; normalize = gd.getNextBoolean();
public synchronized void windowClosing(WindowEvent e) { super.windowClosing(e); if (wasOKed() || wasCanceled()) notify(); }
gd = new NonBlockingGenericDialog( "Interactive Morphological " + "Reconstruction"); gd.addChoice("Type of Reconstruction", Operation.getAllLabels(), operation.label ); gd.addChoice("Connectivity", Conn2D.getAllLabels(), connectivity.label ); gd.addPreviewCheckbox( pfr ); gd.addDialogListener(this); previewing = true; gd.addHelp( "http://imagej.net/MorphoLibJ" ); gd.showDialog(); previewing = false; if (gd.wasCanceled()) return DONE; operation = Operation.fromLabel(gd.getNextChoice()); connectivity = Conn2D.fromLabel(gd.getNextChoice());
gd = new NonBlockingGenericDialog( "Interactive Geodesic " + "Reconstruction 3D" ); gd.addChoice("Type of Reconstruction", Operation.getAllLabels(), operation.label); gd.addChoice("Connectivity", Conn3D.getAllLabels(), connectivity.label); gd.addHelp( "http://imagej.net/MorphoLibJ" ); gd.showDialog(); if (gd.wasCanceled()) return; operation = Operation.fromLabel( gd.getNextChoice() ); connectivity = Conn3D.fromLabel( gd.getNextChoice() );
public void showDialog() { Color color = Toolbar.getForegroundColor(); String colorName = Colors.colorToString2(color); String name = isPencil?"Pencil":"Brush"; gd = new NonBlockingGenericDialog(name+" Options"); gd.addSlider(name+" width:", 1, 50, width); //gd.addSlider("Transparency (%):", 0, 100, transparency); gd.addChoice("Color:", Colors.getColors(colorName), colorName); gd.addCheckbox("Paint on overlay", paintOnOverlay); gd.addDialogListener(this); gd.addHelp(getHelp()); Point loc = Prefs.getLocation(LOC_KEY); if (loc!=null) { gd.centerDialog(false); gd.setLocation (loc); } gd.showDialog(); Prefs.saveLocation(LOC_KEY, gd.getLocation()); gd = null; }
public void showDialog() { Color color = Toolbar.getForegroundColor(); String colorName = Colors.colorToString2(color); String name = isPencil?"Pencil":"Brush"; gd = new NonBlockingGenericDialog(name+" Options"); gd.addSlider(name+" width:", 1, 50, width); //gd.addSlider("Transparency (%):", 0, 100, transparency); gd.addChoice("Color:", Colors.getColors(colorName), colorName); gd.addCheckbox("Paint on overlay", paintOnOverlay); gd.addDialogListener(this); gd.addHelp(getHelp()); Point loc = Prefs.getLocation(LOC_KEY); if (loc!=null) { gd.centerDialog(false); gd.setLocation (loc); } gd.showDialog(); Prefs.saveLocation(LOC_KEY, gd.getLocation()); gd = null; }
public synchronized void keyPressed(KeyEvent e) { super.keyPressed(e); if (wasOKed() || wasCanceled()) notify(); }
boolean showDialog() { validateFormat(); gd = new NonBlockingGenericDialog("Batch Process"); addPanels(gd); gd.setInsets(15, 0, 5); gd.addChoice("Output_format:", formats, format); gd.setInsets(0, 0, 5); gd.addChoice("Add macro code:", code, code[0]); if (virtualStack==null) gd.addStringField("File name contains:", "", 10); gd.setInsets(15, 10, 0); Dimension screen = IJ.getScreenSize(); gd.addTextAreas(macro, null, screen.width<=600?10:15, 60); addButtons(gd); gd.setOKLabel("Process"); Vector choices = gd.getChoices(); Choice choice = (Choice)choices.elementAt(1); if (virtualStack!=null) gd.addHelp(help); choice.addItemListener(this); gd.showDialog(); format = gd.getNextChoice(); if (virtualStack==null) filter = gd.getNextString(); macro = gd.getNextText(); return !gd.wasCanceled(); }
public synchronized void keyPressed(KeyEvent e) { super.keyPressed(e); if (wasOKed() || wasCanceled()) notify(); }
String size = PointRoi.sizes[PointRoi.getDefaultSize()]; if (multipointTool) gd = new NonBlockingGenericDialog("Point Tool"); else gd = new GenericDialog("Point Tool");
public synchronized void windowClosing(WindowEvent e) { super.windowClosing(e); if (wasOKed() || wasCanceled()) notify(); }
String size = PointRoi.sizes[PointRoi.getDefaultSize()]; if (multipointTool) gd = new NonBlockingGenericDialog("Point Tool"); else gd = new GenericDialog("Point Tool");
boolean showDialog() { validateFormat(); gd = new NonBlockingGenericDialog("Batch Process"); addPanels(gd); gd.setInsets(15, 0, 5); gd.addChoice("Output_format:", formats, format); gd.setInsets(0, 0, 5); gd.addChoice("Add macro code:", code, code[0]); if (virtualStack==null) gd.addStringField("File name contains:", "", 10); gd.setInsets(15, 10, 0); Dimension screen = IJ.getScreenSize(); gd.addTextAreas(macro, null, screen.width<=600?10:15, 60); addButtons(gd); gd.setOKLabel("Process"); Vector choices = gd.getChoices(); Choice choice = (Choice)choices.elementAt(1); if (virtualStack!=null) gd.addHelp(help); choice.addItemListener(this); gd.showDialog(); format = gd.getNextChoice(); if (virtualStack==null) filter = gd.getNextString(); macro = gd.getNextText(); return !gd.wasCanceled(); }
void arrowToolOptions() { if (!Toolbar.getToolName().equals("arrow")) IJ.setTool("arrow"); double width = Arrow.getDefaultWidth(); double headSize = Arrow.getDefaultHeadSize(); Color color = Toolbar.getForegroundColor(); colorName = Colors.colorToString2(color); int style = Arrow.getDefaultStyle(); gd = new NonBlockingGenericDialog("Arrow Tool"); gd.addSlider("Width:", 1, 50, (int)width); gd.addSlider("Size:", 0, 50, headSize); gd.addChoice("Color:", Colors.getColors(colorName), colorName); gd.addChoice("Style:", Arrow.styles, Arrow.styles[style]); gd.addCheckbox("Outline", Arrow.getDefaultOutline()); gd.addCheckbox("Double head", Arrow.getDefaultDoubleHeaded()); gd.addCheckbox("Keep after adding to overlay", Prefs.keepArrowSelections); gd.addDialogListener(this); Point loc = Prefs.getLocation(LOC_KEY); if (loc!=null) { gd.centerDialog(false); gd.setLocation (loc); } gd.showDialog(); Prefs.saveLocation(LOC_KEY, gd.getLocation()); }
void arrowToolOptions() { if (!Toolbar.getToolName().equals("arrow")) IJ.setTool("arrow"); double width = Arrow.getDefaultWidth(); double headSize = Arrow.getDefaultHeadSize(); Color color = Toolbar.getForegroundColor(); colorName = Colors.colorToString2(color); int style = Arrow.getDefaultStyle(); gd = new NonBlockingGenericDialog("Arrow Tool"); gd.addSlider("Width:", 1, 50, (int)width); gd.addSlider("Size:", 0, 50, headSize); gd.addChoice("Color:", Colors.getColors(colorName), colorName); gd.addChoice("Style:", Arrow.styles, Arrow.styles[style]); gd.addCheckbox("Outline", Arrow.getDefaultOutline()); gd.addCheckbox("Double head", Arrow.getDefaultDoubleHeaded()); gd.addCheckbox("Keep after adding to overlay", Prefs.keepArrowSelections); gd.addDialogListener(this); Point loc = Prefs.getLocation(LOC_KEY); if (loc!=null) { gd.centerDialog(false); gd.setLocation (loc); } gd.showDialog(); Prefs.saveLocation(LOC_KEY, gd.getLocation()); }
gd = new NonBlockingGenericDialog("Fonts"); gd.addChoice("Font:", getFonts(), font); gd.addChoice("Style:", styles, styles[style]);
gd = new NonBlockingGenericDialog("Fonts"); gd.addChoice("Font:", getFonts(), font); gd.addChoice("Style:", styles, styles[style]);
void rectToolOptions() { if (defaultStrokeColor==null) defaultStrokeColor = Roi.getColor(); Color strokeColor = defaultStrokeColor; Color fillColor = null; if (defaultStrokeWidth==0.0) defaultStrokeWidth = 1.0; double strokeWidth = defaultStrokeWidth; int cornerDiameter = (int)Prefs.get(Toolbar.CORNER_DIAMETER, 20); ImagePlus imp = WindowManager.getCurrentImage(); Roi roi = imp!=null?imp.getRoi():null; if (roi!=null && (roi.getType()==Roi.RECTANGLE)) { strokeColor = roi.getStrokeColor(); if (strokeColor==null) strokeColor = Roi.getColor(); fillColor = roi.getFillColor(); strokeWidth = roi.getStrokeWidth(); cornerDiameter = roi.getCornerDiameter(); } String strokec = Colors.colorToString(strokeColor); String fillc = Colors.colorToString(fillColor); gd = new NonBlockingGenericDialog("Rounded Rectangle Tool"); gd.addSlider("Stroke width:", 1, 25, (int)strokeWidth); gd.addSlider("Corner diameter:", 0, 200, cornerDiameter); gd.addStringField("Color: ", strokec); gd.addStringField("Fill color: ", fillc); gd.addDialogListener(this); gd.showDialog(); }
void rectToolOptions() { if (defaultStrokeColor==null) defaultStrokeColor = Roi.getColor(); Color strokeColor = defaultStrokeColor; Color fillColor = null; if (defaultStrokeWidth==0.0) defaultStrokeWidth = 1.0; double strokeWidth = defaultStrokeWidth; int cornerDiameter = (int)Prefs.get(Toolbar.CORNER_DIAMETER, 20); ImagePlus imp = WindowManager.getCurrentImage(); Roi roi = imp!=null?imp.getRoi():null; if (roi!=null && (roi.getType()==Roi.RECTANGLE)) { strokeColor = roi.getStrokeColor(); if (strokeColor==null) strokeColor = Roi.getColor(); fillColor = roi.getFillColor(); strokeWidth = roi.getStrokeWidth(); cornerDiameter = roi.getCornerDiameter(); } String strokec = Colors.colorToString(strokeColor); String fillc = Colors.colorToString(fillColor); gd = new NonBlockingGenericDialog("Rounded Rectangle Tool"); gd.addSlider("Stroke width:", 1, 25, (int)strokeWidth); gd.addSlider("Corner diameter:", 0, 200, cornerDiameter); gd.addStringField("Color: ", strokec); gd.addStringField("Fill color: ", fillc); gd.addDialogListener(this); gd.showDialog(); }
public void showDialog() { Color color = Toolbar.getForegroundColor(); String colorName = Colors.colorToString2(color); gd = new NonBlockingGenericDialog("Overlay Brush Options"); gd.addSlider("Brush width (pixels):", 0, 50, width); gd.addSlider("Transparency (%):", 0, 100, transparency); gd.addChoice("Color:", Colors.getColors(colorName), colorName); gd.setInsets(10, 0, 0); String ctrlString = IJ.isMacintosh()? "CMD":"CTRL"; gd.addMessage("SHIFT for horizontal or vertical lines\n"+ "ALT to draw in background color\n"+ ctrlString+"-SHIFT-drag to change brush width\n"+ ctrlString+"-(ALT) click to change foreground (background) color\n"+ "or use this dialog or the Color Picker (shift-k).", null, Color.darkGray); gd.hideCancelButton(); gd.addHelp(""); gd.setHelpLabel("Undo"); gd.setOKLabel("Close"); gd.addDialogListener(this); Point loc = Prefs.getLocation(LOC_KEY); if (loc!=null) { gd.centerDialog(false); gd.setLocation (loc); } gd.showDialog(); Prefs.saveLocation(LOC_KEY, gd.getLocation()); if (IJ.debugMode) IJ.log("Options: false"); gd = null; }