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

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

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

Toolbar.getToolId介绍

[英]Returns the ID of the current tool (Toolbar.RECTANGLE, Toolbar.OVAL, etc.).
[中]返回当前工具的ID(Toolbar.RECTANGLE、Toolbar.OVAL等)。

代码示例

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

@Override
public boolean isRoiTool() {
  final int tool = Toolbar.getToolId();
  return tool == Toolbar.RECTANGLE || tool == Toolbar.OVAL ||
    tool == Toolbar.POLYGON || tool == Toolbar.FREEROI ||
    tool == Toolbar.LINE || tool == Toolbar.POLYLINE ||
    tool == Toolbar.FREELINE || tool == Toolbar.POINT || tool == Toolbar.WAND;
}

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

public FreehandRoi(int sx, int sy, ImagePlus imp) {
  super(sx, sy, imp);
  if (Toolbar.getToolId()==Toolbar.FREEROI)
    type = FREEROI;
  else
    type = FREELINE;
  if (nPoints==2) nPoints--;
}

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

@Override
public void mousePressed(MouseEvent e) {
  int id = Toolbar.getToolId();
  doDraw = id == Toolbar.SPARE1 || id == Toolbar.SPARE2 ||
    id == Toolbar.SPARE3 || id == Toolbar.SPARE4 ||
    id == Toolbar.SPARE5 || id == Toolbar.SPARE6 ||
    id == Toolbar.SPARE7 || id == Toolbar.SPARE8 ||
    id == Toolbar.SPARE9;
}

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

@Override
public void mousePressed(MouseEvent e) {
  int id = Toolbar.getToolId();
  doDraw = id == Toolbar.SPARE1 || id == Toolbar.SPARE2 ||
    id == Toolbar.SPARE3 || id == Toolbar.SPARE4 ||
    id == Toolbar.SPARE5 || id == Toolbar.SPARE6 ||
    id == Toolbar.SPARE7 || id == Toolbar.SPARE8 ||
    id == Toolbar.SPARE9;
}

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

static public int getToolId() {
  int tool = Toolbar.getToolId();
  if (Toolbar.WAND == tool) return ProjectToolbar.WAND;
  return tool;
}

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

public FreehandRoi(int sx, int sy, ImagePlus imp) {
  super(sx, sy, imp);
  if (Toolbar.getToolId()==Toolbar.FREEROI)
    type = FREEROI;
  else
    type = FREELINE;
  if (nPoints==2) nPoints--;
}

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

@Override
public boolean isPointTool() {
  return Toolbar.getToolId() == Toolbar.POINT;
}

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

@Override
public boolean isMagnifierTool() {
  return Toolbar.getToolId() == Toolbar.MAGNIFIER;
}

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

/**
 * Return true if the tool is currently present in ImageJ toolbar.
 */
public static boolean isLaunched()
{
  final Toolbar toolbar = Toolbar.getInstance();
  if ( null != toolbar && toolbar.getToolId( TOOL_NAME ) >= 0 )
    return true;
  return false;
}

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

public void mousePressed(MouseEvent me) {
  int ij_tool = Toolbar.getToolId();
  Utils.log2("Tool: " + ij_tool);
}
public void mouseReleased(MouseEvent me) {}

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

public final boolean isThisTool() {
  boolean active = Toolbar.getToolId() == toolID;
  if (toolToggleListener != null && active != toolActive)
    toolToggleListener.toolToggled(active);
  toolActive = active;
  return active;
}

代码示例来源:origin: fiji/TrackMate

/**
 * Return true if the tool is currently present in ImageJ toolbar.
 */
public static boolean isLaunched()
{
  final Toolbar toolbar = Toolbar.getInstance();
  if ( null != toolbar && toolbar.getToolId( TOOL_NAME ) >= 0 )
    return true;
  return false;
}

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

@Override
public void mouseEntered(final MouseEvent e) {
  super.mouseEntered(e);
  if (!IJ.spaceBarDown() | Toolbar.getToolId() != Toolbar.MAGNIFIER |
    Toolbar.getToolId() != Toolbar.HAND) setCursor(Cursor
    .getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
}

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

protected boolean wasToolbarCleared() {
  Toolbar current = Toolbar.getInstance();
  if (current != toolbar)
    return true;
  /*
   * We need to compare with != rather than !equals() so that subsequent calls
   * of the same plugin will not result in multiple handling.
   */
  if (Toolbar.getToolId() == toolID && Toolbar.getToolName() != savedToolName)
    return true;
  return false;
}

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

public static void restoreTools() {
  Toolbar tb = Toolbar.getInstance();
  if (tb!=null) {
    if (tb.getToolId()>=UNUSED)
      tb.setTool(RECTANGLE);
    tb.installStartupMacros();
  }
}

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

public static void removeMacroTools() {
  if (instance!=null) {
    if (instance.getToolId()>=CUSTOM1)
      instance.setTool(RECTANGLE);
    instance.resetTools();
    instance.repaint();
  }
}

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

public static void removeMacroTools() {
  if (instance!=null) {
    if (instance.getToolId()>=CUSTOM1)
      instance.setTool(RECTANGLE);
    instance.resetTools();
    instance.repaint();
  }
}

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

public static void restoreTools() {
  Toolbar tb = Toolbar.getInstance();
  if (tb!=null) {
    if (tb.getToolId()>=UNUSED)
      tb.setTool(RECTANGLE);
    tb.installStartupMacros();
  }
}

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

public void mouseEntered(final MouseEvent e) { try {
  
  if (mtrackj.settings().activateimage) {
    mtrackj.window().toFront();
    mtrackj.canvas().requestFocusInWindow();
  }
  cursor();
  oncanvas = true;
  snapctrl = e.isControlDown();
  if (Toolbar.getToolId() != Toolbar.HAND && spacedown) spacedown = false;
  redraw(); // In case snapping is on
  
} catch (Throwable x) { mtrackj.catcher().uncaughtException(Thread.currentThread(),x); } }

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

void cursor() {
  
  switch (Toolbar.getToolId()) {
    case Toolbar.POINT:
      switch (mode) {
        case ADD: case REFER: mtrackj.canvas().setCursor(crosscursor); break;
        default: mtrackj.canvas().setCursor(arrowcursor); break;
      }
      break;
    case Toolbar.MAGNIFIER: mtrackj.canvas().setCursor(magnicursor); break;
    case Toolbar.HAND: mtrackj.canvas().setCursor(handycursor); break;
    default: mtrackj.canvas().setCursor(arrowcursor); break;
  }
}

相关文章