ij.gui.Toolbar.getForegroundColor()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中ij.gui.Toolbar.getForegroundColor()方法的一些代码示例,展示了Toolbar.getForegroundColor()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Toolbar.getForegroundColor()方法的具体详情如下:
包路径:ij.gui.Toolbar
类名称:Toolbar
方法名:getForegroundColor

Toolbar.getForegroundColor介绍

暂无

代码示例

代码示例来源:origin: sc.fiji/TrakEM2_

/** The luminance of the foreground color. */
  static public final int getForegroundColorValue() {
    return Utils.luminance(Toolbar.getForegroundColor());
  }
}

代码示例来源:origin: sc.fiji/VIB_

public synchronized static void fill(int sx, int sy, int sz) {
  fill(IJ.getImage(), sx, sy, sz,
    Toolbar.getForegroundColor().getRGB());
}

代码示例来源:origin: net.imagej/ij

public static void setBrushWidth(int width) {
  if (brushInstance!=null) {
    Color c = Toolbar.getForegroundColor();
    brushInstance.setWidth(width);
    Toolbar.setForegroundColor(c);
  }
}

代码示例来源:origin: net.imagej/ij

public Arrow(int sx, int sy, ImagePlus imp) {
  super(sx, sy, imp);
  setStrokeWidth(defaultWidth);
  style = defaultStyle;
  headSize = defaultHeadSize;
  doubleHeaded = defaultDoubleHeaded;
  outline = defaultOutline;
  setStrokeColor(Toolbar.getForegroundColor());
}

代码示例来源:origin: imagej/ImageJA

public static void setBrushWidth(int width) {
  if (brushInstance!=null) {
    Color c = Toolbar.getForegroundColor();
    brushInstance.setWidth(width);
    Toolbar.setForegroundColor(c);
  }
}

代码示例来源:origin: imagej/ImageJA

public Arrow(int sx, int sy, ImagePlus imp) {
  super(sx, sy, imp);
  setStrokeWidth(defaultWidth);
  style = defaultStyle;
  headSize = defaultHeadSize;
  doubleHeaded = defaultDoubleHeaded;
  outline = defaultOutline;
  setStrokeColor(Toolbar.getForegroundColor());
}

代码示例来源:origin: net.imagej/ij

void setForegroundColor(ImageProcessor ip) {
  if (defaultColor!=null)
    ip.setColor(defaultColor);
  else if (!Double.isNaN(defaultValue))
    ip.setValue(defaultValue);
  else
    ip.setColor(Toolbar.getForegroundColor());
  colorSet = true;
}

代码示例来源:origin: imagej/ImageJA

void setForegroundColor(ImageProcessor ip) {
  if (defaultColor!=null)
    ip.setColor(defaultColor);
  else if (!Double.isNaN(defaultValue))
    ip.setValue(defaultValue);
  else
    ip.setColor(Toolbar.getForegroundColor());
  colorSet = true;
}

代码示例来源:origin: net.imagej/ij

/**
* @deprecated
* replaced by ImageProcessor.draw(Roi)
*/
public void draw(ImageProcessor ip) {
  ip.setColor(Toolbar.getForegroundColor());
  roi.drawPixels(ip);
  if (IJ.altKeyDown())
    drawLabel(ip);
 }

代码示例来源:origin: imagej/ImageJA

/**
* @deprecated
* replaced by ImageProcessor.draw(Roi)
*/
public void draw(ImageProcessor ip) {
  ip.setColor(Toolbar.getForegroundColor());
  roi.drawPixels(ip);
  if (IJ.altKeyDown())
    drawLabel(ip);
 }

代码示例来源:origin: net.imagej/ij

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);
}

代码示例来源:origin: sc.fiji/TrakEM2_

@Override
public void eventOccurred(final int eventID) {
  if (IJEventListener.FOREGROUND_COLOR_CHANGED == eventID) {
    if (this != front || null == active || !project.isInputEnabled()) return;
    selection.setColor(Toolbar.getForegroundColor());
    Display.repaint(front.layer, selection.getBox(), 0);
  } else if (IJEventListener.TOOL_CHANGED == eventID) {
    Display.repaintToolbar();
  }
}

代码示例来源:origin: imagej/ImageJA

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);
}

代码示例来源:origin: sc.fiji/Fiji_Plugins

public void run(ImageProcessor ip) {
  Roi roi = image.getRoi();
  if (roi == null || roi.getType() != roi.LINE) {
    IJ.error("Need a linear selection");
    return;
  }
  Line line = (Line)roi;
  if (line.getLength() == 0) {
    IJ.error("Line too short");
    return;
  }
  int from = Toolbar.getBackgroundColor().getRGB();
  int to = Toolbar.getForegroundColor().getRGB();
  makeLinearGradient(ip, from, to, line);
  image.updateAndDraw();
}

代码示例来源:origin: net.imagej/ij

public void refreshForeground(boolean backgroundInFront) {
  //Boundary for Foreground Selection
  setColor(0x444444);
  drawRect(8, 266, (w*2)+4, (h*2)+4);
  setColor(0x999999);
  drawRect(9, 267, (w*2)+2, (h*2)+2);
  setRoi(10, 268, w*2, h*2); //Paints the Foreground Color
  Color fg = Toolbar.getForegroundColor();
  setColor(fg);
  fill();
  if (backgroundInFront)
    drawLabel("F", fg, 12, 268+14);
}

代码示例来源:origin: net.imagej/ij

/**
* @deprecated
* replaced by ImageProcessor.fill(Roi)
*/
public void fill(ImageProcessor ip) {
  ip.setColor(Toolbar.getForegroundColor());
  if (isLineSelection()) {
    if (isStraightLine() && roi.getStrokeWidth()>1 && !(roi instanceof Arrow))
      ip.fillPolygon(roi.getPolygon());
    else
      roi.drawPixels(ip);
  } else
    ip.fill(); // fill with foreground color
}

代码示例来源:origin: imagej/ImageJA

public void refreshForeground(boolean backgroundInFront) {
  //Boundary for Foreground Selection
  setColor(0x444444);
  drawRect(8, 266, (w*2)+4, (h*2)+4);
  setColor(0x999999);
  drawRect(9, 267, (w*2)+2, (h*2)+2);
  setRoi(10, 268, w*2, h*2); //Paints the Foreground Color
  Color fg = Toolbar.getForegroundColor();
  setColor(fg);
  fill();
  if (backgroundInFront)
    drawLabel("F", fg, 12, 268+14);
}

代码示例来源:origin: imagej/ImageJA

/**
* @deprecated
* replaced by ImageProcessor.fill(Roi)
*/
public void fill(ImageProcessor ip) {
  ip.setColor(Toolbar.getForegroundColor());
  if (isLineSelection()) {
    if (isStraightLine() && roi.getStrokeWidth()>1 && !(roi instanceof Arrow))
      ip.fillPolygon(roi.getPolygon());
    else
      roi.drawPixels(ip);
  } else
    ip.fill(); // fill with foreground color
}

代码示例来源:origin: net.imagej/ij

public void clear(ImageProcessor ip) {
   ip.setColor(Toolbar.getBackgroundColor());
  if (isLineSelection()) {
    if (isStraightLine() && roi.getStrokeWidth()>1)
      ip.fillPolygon(roi.getPolygon());
    else
      roi.drawPixels();
  } else if (roi!=null && roi instanceof TextRoi)
    ((TextRoi)roi).clear(ip);
  else
     ip.fill(); // fill with background color
  ip.setColor(Toolbar.getForegroundColor());
}

代码示例来源:origin: imagej/ImageJA

public void clear(ImageProcessor ip) {
   ip.setColor(Toolbar.getBackgroundColor());
  if (isLineSelection()) {
    if (isStraightLine() && roi.getStrokeWidth()>1)
      ip.fillPolygon(roi.getPolygon());
    else
      roi.drawPixels();
  } else if (roi!=null && roi instanceof TextRoi)
    ((TextRoi)roi).clear(ip);
  else
     ip.fill(); // fill with background color
  ip.setColor(Toolbar.getForegroundColor());
}

相关文章