ij.ImageJ.getMenuBar()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(151)

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

ImageJ.getMenuBar介绍

暂无

代码示例

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

public MenuBar getMenuBar() {
  final ImageJ ij1 = hasInstance() ? IJ.getInstance() : null;
  return ij1 == null ? null : ij1.getMenuBar();
}

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

static Runnable getX11Opener() throws NoSuchMethodException {
  @SuppressWarnings("deprecation")
  final Method method = IJ.getInstance().getMenuBar()
    .getPeer().getClass()
    .getDeclaredMethod("handleF10KeyPress",
        new Class[] { KeyEvent.class });
  method.setAccessible(true);
  return new Runnable() {
    @SuppressWarnings("deprecation")
    @Override
    public void run() {
      final ImageJ ij = IJ.getInstance();
      if (ij == null ||!ij.isFocused()) return;
      KeyEvent event = new KeyEvent(IJ.getInstance(),
        KeyEvent.VK_F10,
        System.currentTimeMillis(), 0,
        KeyEvent.VK_F10,
        KeyEvent.CHAR_UNDEFINED);
      try {
        method.invoke(ij.getMenuBar().getPeer(),
          new Object[] { event });
      } catch (Exception e) { /* ignore */ }
    }
  };
}

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

@SuppressWarnings("deprecation")
  @Override
  public void run() {
    final ImageJ ij = IJ.getInstance();
    if (ij == null ||!ij.isFocused()) return;
    KeyEvent event = new KeyEvent(IJ.getInstance(),
      KeyEvent.VK_F10,
      System.currentTimeMillis(), 0,
      KeyEvent.VK_F10,
      KeyEvent.CHAR_UNDEFINED);
    try {
      method.invoke(ij.getMenuBar().getPeer(),
        new Object[] { event });
    } catch (Exception e) { /* ignore */ }
  }
};

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

public void windowActivated(WindowEvent e) {
  if (IJ.isMacintosh() && !quitting) {
    IJ.wait(10); // may be needed for Java 1.4 on OS X
    MenuBar mb = Menus.getMenuBar();
    if (mb!=null && mb!=getMenuBar()) {
      setMenuBar(mb);
      Menus.setMenuBarCount++;
      if (IJ.debugMode) IJ.log("setMenuBar: "+Menus.setMenuBarCount);
    }
  }
}

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

public void windowActivated(WindowEvent e) {
  if (IJ.isMacintosh() && !quitting) {
    IJ.wait(10); // may be needed for Java 1.4 on OS X
    MenuBar mb = Menus.getMenuBar();
    if (mb!=null && mb!=getMenuBar()) {
      setMenuBar(mb);
      Menus.setMenuBarCount++;
      if (IJ.debugMode) IJ.log("setMenuBar: "+Menus.setMenuBarCount);
    }
  }
}

相关文章