private void setForegroundColor(Color c) { Toolbar.setForegroundColor(c); if (Recorder.record) Recorder.record("setForegroundColor", c.getRed(), c.getGreen(), c.getBlue()); }
private void setForegroundColor(Color c) { Toolbar.setForegroundColor(c); if (Recorder.record) Recorder.record("setForegroundColor", c.getRed(), c.getGreen(), c.getBlue()); }
public static void setBrushWidth(int width) { if (brushInstance!=null) { Color c = Toolbar.getForegroundColor(); brushInstance.setWidth(width); Toolbar.setForegroundColor(c); } }
public static void setBrushWidth(int width) { if (brushInstance!=null) { Color c = Toolbar.getForegroundColor(); brushInstance.setWidth(width); Toolbar.setForegroundColor(c); } }
static void setColor(int red, int green, int blue, boolean foreground) { if (red<0) red=0; if (green<0) green=0; if (blue<0) blue=0; if (red>255) red=255; if (green>255) green=255; if (blue>255) blue=255; Color c = new Color(red, green, blue); if (foreground) { Toolbar.setForegroundColor(c); ImagePlus img = WindowManager.getCurrentImage(); if (img!=null) img.getProcessor().setColor(c); } else Toolbar.setBackgroundColor(c); }
static void setColor(int red, int green, int blue, boolean foreground) { if (red<0) red=0; if (green<0) green=0; if (blue<0) blue=0; if (red>255) red=255; if (green>255) green=255; if (blue>255) blue=255; Color c = new Color(red, green, blue); if (foreground) { Toolbar.setForegroundColor(c); ImagePlus img = WindowManager.getCurrentImage(); if (img!=null) img.getProcessor().setColor(c); } else Toolbar.setBackgroundColor(c); }
void setDrawingColor(int x, int y, boolean setBackground) { int p = ip.getPixel(x, y); int r = (p&0xff0000)>>16; int g = (p&0xff00)>>8; int b = p&0xff; Color c = new Color(r, g, b); if (setBackground) { Toolbar.setBackgroundColor(c); if (Recorder.record) Recorder.setBackgroundColor(c); } else { Toolbar.setForegroundColor(c); if (Recorder.record) Recorder.setForegroundColor(c); } }
void setDrawingColor(int x, int y, boolean setBackground) { int p = ip.getPixel(x, y); int r = (p&0xff0000)>>16; int g = (p&0xff00)>>8; int b = p&0xff; Color c = new Color(r, g, b); if (setBackground) { Toolbar.setBackgroundColor(c); if (Recorder.record) Recorder.setBackgroundColor(c); } else { Toolbar.setForegroundColor(c); if (Recorder.record) Recorder.setForegroundColor(c); } }
Toolbar.setBackgroundColor(color); else { Toolbar.setForegroundColor(color); if (gd != null) options.setColor(color);
void editColor() { Color c = background?Toolbar.getBackgroundColor():Toolbar.getForegroundColor(); ColorChooser cc = new ColorChooser((background?"Background":"Foreground")+" Color", c, false); c = cc.getColor(); if (background) Toolbar.setBackgroundColor(c); else Toolbar.setForegroundColor(c); }
void editColor() { Color c = background?Toolbar.getBackgroundColor():Toolbar.getForegroundColor(); ColorChooser cc = new ColorChooser((background?"Background":"Foreground")+" Color", c, false); c = cc.getColor(); if (background) Toolbar.setBackgroundColor(c); else Toolbar.setForegroundColor(c); }
public void colorOptions(ColorRGB fgColor, ColorRGB bgColor) { Toolbar.setForegroundColor(AWTColors.getColor(fgColor)); Toolbar.setBackgroundColor(AWTColors.getColor(bgColor)); OptionsChannels options = optionsService.getOptions(OptionsChannels.class); options.setLastFgColor(fgColor, false); options.setLastBgColor(bgColor, false); //options.save(); BDZ - shouldn't be necessary - see OptionsChannels impl }
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) { if (e!=null && e.toString().contains("Undo")) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) IJ.run("Undo"); return true; } width = (int)gd.getNextNumber(); if (gd.invalidNumber() || width<0) width = (int)Prefs.get(widthKey, 1); //transparency = (int)gd.getNextNumber(); //if (gd.invalidNumber() || transparency<0 || transparency>100) // transparency = 100; String colorName = gd.getNextChoice(); paintOnOverlay = gd.getNextBoolean(); Color color = Colors.decode(colorName, null); Toolbar.setForegroundColor(color); Prefs.set(widthKey, width); Prefs.set(OVERLAY_KEY, paintOnOverlay); return true; } }
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) { if (e!=null && e.toString().contains("Undo")) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null) IJ.run("Undo"); return true; } width = (int)gd.getNextNumber(); if (gd.invalidNumber() || width<0) width = (int)Prefs.get(widthKey, 1); //transparency = (int)gd.getNextNumber(); //if (gd.invalidNumber() || transparency<0 || transparency>100) // transparency = 100; String colorName = gd.getNextChoice(); paintOnOverlay = gd.getNextBoolean(); Color color = Colors.decode(colorName, null); Toolbar.setForegroundColor(color); Prefs.set(widthKey, width); Prefs.set(OVERLAY_KEY, paintOnOverlay); return true; } }
public void itemStateChanged(ItemEvent e) { Choice choice = (Choice)e.getSource(); String item = choice.getSelectedItem(); Color color = getColor(item, Color.black); if (choice==fchoice) Toolbar.setForegroundColor(color); else if (choice==bchoice) Toolbar.setBackgroundColor(color); else if (choice==schoice) { Roi.setColor(color); ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null && imp.getRoi()!=null) imp.draw(); Toolbar.getInstance().repaint(); } }
public void itemStateChanged(ItemEvent e) { Choice choice = (Choice)e.getSource(); String item = choice.getSelectedItem(); Color color = getColor(item, Color.black); if (choice==fchoice) Toolbar.setForegroundColor(color); else if (choice==bchoice) Toolbar.setBackgroundColor(color); else if (choice==schoice) { Roi.setColor(color); ImagePlus imp = WindowManager.getCurrentImage(); if (imp!=null && imp.getRoi()!=null) imp.draw(); Toolbar.getInstance().repaint(); } }
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) { if (e!=null && e.toString().contains("Undo")) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return true; Overlay overlay = imp.getOverlay(); if (overlay!=null && overlay.size()>0) { overlay.remove(overlay.size()-1); imp.draw(); } return true; } width = (float)gd.getNextNumber(); if (gd.invalidNumber() || width<0) width = (float)Prefs.get(WIDTH_KEY, 5); transparency = (int)gd.getNextNumber(); if (gd.invalidNumber() || transparency<0 || transparency>100) transparency = 100; String colorName = gd.getNextChoice(); Color color = Colors.decode(colorName, null); Toolbar.setForegroundColor(color); Prefs.set(WIDTH_KEY, width); return true; }
public boolean dialogItemChanged(GenericDialog gd, AWTEvent e) { if (e!=null && e.toString().contains("Undo")) { ImagePlus imp = WindowManager.getCurrentImage(); if (imp==null) return true; Overlay overlay = imp.getOverlay(); if (overlay!=null && overlay.size()>0) { overlay.remove(overlay.size()-1); imp.draw(); } return true; } width = (float)gd.getNextNumber(); if (gd.invalidNumber() || width<0) width = (float)Prefs.get(WIDTH_KEY, 5); transparency = (int)gd.getNextNumber(); if (gd.invalidNumber() || transparency<0 || transparency>100) transparency = 100; String colorName = gd.getNextChoice(); Color color = Colors.decode(colorName, null); Toolbar.setForegroundColor(color); Prefs.set(WIDTH_KEY, width); return true; }
if (colorName!=null && !colorName2.equals(colorName)) { Color color = Colors.decode(colorName2, null); Toolbar.setForegroundColor(color); colorName = colorName2;
if (colorName!=null && !colorName2.equals(colorName)) { Color color = Colors.decode(colorName2, null); Toolbar.setForegroundColor(color); colorName = colorName2;