java.awt.MenuItem.getActionCommand()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(172)

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

暂无

代码示例

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

for (int i=0; i<items; i++) {
  MenuItem mItem = menu.getItem(i);
  String label = mItem.getActionCommand();
  if (mItem instanceof Menu) {
    DefaultMutableTreeNode subNode = new DefaultMutableTreeNode(label);

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

public void parseMenu(String path, Menu menu) {
  int n=menu.getItemCount();
  for (int i=0; i<n; ++i) {
    MenuItem m=menu.getItem(i);
    String label=m.getActionCommand();
    if (m instanceof Menu) {
      Menu subMenu=(Menu)m;
      parseMenu(path+">"+label,subMenu);
    } else {
      String trimmedLabel = label.trim();
      if (trimmedLabel.length()==0 || trimmedLabel.equals("-"))
        continue;
      CommandAction ca=(CommandAction)commandsHash.get(label);
      if( ca == null )
        commandsHash.put(label, new CommandAction(null,m,path));
      else {
        ca.menuItem=m;
        ca.menuLocation=path;
      }
      CommandAction caAfter=(CommandAction)commandsHash.get(label);
    }
  }
}

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

for (int i=0; i<items; i++) {
  MenuItem mItem = menu.getItem(i);
  String label = mItem.getActionCommand();
  if (mItem instanceof Menu) {
    DefaultMutableTreeNode subNode = new DefaultMutableTreeNode(label);

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

public void parseMenu(String path, Menu menu) {
  int n=menu.getItemCount();
  for (int i=0; i<n; ++i) {
    MenuItem m=menu.getItem(i);
    String label=m.getActionCommand();
    if (m instanceof Menu) {
      Menu subMenu=(Menu)m;
      parseMenu(path+">"+label,subMenu);
    } else {
      String trimmedLabel = label.trim();
      if (trimmedLabel.length()==0 || trimmedLabel.equals("-"))
        continue;
      CommandAction ca=(CommandAction)commandsHash.get(label);
      if( ca == null )
        commandsHash.put(label, new CommandAction(null,m,path));
      else {
        ca.menuItem=m;
        ca.menuLocation=path;
      }
      CommandAction caAfter=(CommandAction)commandsHash.get(label);
    }
  }
}

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

if (lastSpace>0) // remove image size (e.g., " 90K")
menuItemLabel = menuItemLabel.substring(0, lastSpace);
String idString = item.getActionCommand();
int id = (int)Tools.parseDouble(idString, 0);
ImagePlus imp = WindowManager.getImage(id);

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

if (lastSpace>0) // remove image size (e.g., " 90K")
menuItemLabel = menuItemLabel.substring(0, lastSpace);
String idString = item.getActionCommand();
int id = (int)Tools.parseDouble(idString, 0);
ImagePlus imp = WindowManager.getImage(id);

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

if (command.equals(menu.getItem(i).getActionCommand())) {
  notAvailable(command);
  return null;

相关文章