java.awt.PopupMenu.addSeparator()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(143)

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

PopupMenu.addSeparator介绍

暂无

代码示例

代码示例来源:origin: igniterealtime/Openfire

menu.add(browserMenuItem);
menu.addSeparator();

代码示例来源:origin: RipMeApp/ripme

trayMenu.add(trayMenuMain);
trayMenu.add(trayMenuAbout);
trayMenu.addSeparator();
trayMenu.add(trayMenuAutorip);
trayMenu.addSeparator();
trayMenu.add(trayMenuExit);
try {

代码示例来源:origin: Nilhcem/FakeSMTP

/**
 * The popup menu used by the icon in the system tray.
 *
 * @param mainFrame MainFrame class.
 */
public TrayPopup(final MainFrame mainFrame) {
  // Create a popup menu components
  MenuItem aboutItem = new MenuItem(i18n.get("menubar.about"));
  aboutItem.addActionListener(new AboutActionListener(null));
  MenuItem exitItem = new MenuItem(i18n.get("menubar.exit"));
  exitItem.addActionListener(new ExitActionListener(mainFrame));
  popup.add(aboutItem);
  popup.addSeparator();
  popup.add(exitItem);
}

代码示例来源:origin: magefree/mage

popup.add(stopBlinkItem);
popup.add(preferencesItem);
popup.addSeparator();
popup.add(aboutItem);
popup.addSeparator();
popup.add(exitItem);

代码示例来源:origin: i2p/i2p.i2p

popup.addSeparator();
if (CONSOLE_ENABLED) {
  popup.add(browserLauncher);
  popup.addSeparator();
popup.addSeparator();
if (_context.hasWrapper())
  popup.add(restartItem);

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

/** Constructs a new TextPanel. */
public TextPanel(String title) {
  this();
  this.title = title;
  if (title.equals("Results")) {
    pm.addSeparator();
    addPopupItem("Clear Results");
    addPopupItem("Summarize");
    addPopupItem("Distribution...");
    addPopupItem("Set Measurements...");
  }
}

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

/** Constructs a new TextPanel. */
public TextPanel(String title) {
  this();
  this.title = title;
  if (title.equals("Results")) {
    pm.addSeparator();
    addPopupItem("Clear Results");
    addPopupItem("Summarize");
    addPopupItem("Distribution...");
    addPopupItem("Set Measurements...");
  }
}

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

void installPopupMenu(String name, Program pgm) {
  Hashtable h = pgm.getMenus();
  if (h==null) return;
  String[] commands = (String[])h.get(name);
  if (commands==null) return;
  PopupMenu popup = Menus.getPopupMenu();
  if (popup==null) return;
  popup.removeAll();
  for (int i=0; i<commands.length; i++) {
    if (commands[i].equals("-"))
      popup.addSeparator();
    else {
      MenuItem mi = new MenuItem(commands[i]);
      mi.addActionListener(this);
      popup.add(mi);
    }
  }
}

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

void installPopupMenu(String name, Program pgm) {
  Hashtable h = pgm.getMenus();
  if (h==null) return;
  String[] commands = (String[])h.get(name);
  if (commands==null) return;
  PopupMenu popup = Menus.getPopupMenu();
  if (popup==null) return;
  popup.removeAll();
  for (int i=0; i<commands.length; i++) {
    if (commands[i].equals("-"))
      popup.addSeparator();
    else {
      MenuItem mi = new MenuItem(commands[i]);
      mi.addActionListener(this);
      popup.add(mi);
    }
  }
}

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

protected void handlePopupMenu(MouseEvent e) {
  int x = e.getX();
  int y = e.getY();
  PopupMenu popup = new PopupMenu();
  String[] colors = "Grays,-,Red,Green,Blue,Yellow,Magenta,Cyan,-,Fire,Ice,Spectrum,3-3-2 RGB,Red/Green".split(",");
  for (int jj = 0; jj < colors.length; jj++) {
    if (colors[jj].equals("-")) {
      popup.addSeparator();
    } else {
      MenuItem mi = new MenuItem(colors[jj]);
      popup.add(mi);
      mi.addActionListener(this);
    }
  }
  add(popup);
  if (IJ.isMacOSX()) {
    IJ.wait(10);
  }
  popup.show(this, x, y);
  setCursor(defaultCursor);
}

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

protected void handlePopupMenu(MouseEvent e) {
  int x = e.getX();
  int y = e.getY();
  PopupMenu popup = new PopupMenu();
  String[] colors = "Grays,-,Red,Green,Blue,Yellow,Magenta,Cyan,-,Fire,Ice,Spectrum,3-3-2 RGB,Red/Green".split(",");
  for (int jj = 0; jj < colors.length; jj++) {
    if (colors[jj].equals("-")) {
      popup.addSeparator();
    } else {
      MenuItem mi = new MenuItem(colors[jj]);
      popup.add(mi);
      mi.addActionListener(this);
    }
  }
  add(popup);
  if (IJ.isMacOSX()) {
    IJ.wait(10);
  }
  popup.show(this, x, y);
  setCursor(defaultCursor);
}

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

void installPopupMenu(ImageJ ij) {
  String s;
  int count = 0;
  MenuItem mi;
  popup = new PopupMenu("");
  if (fontSize!=0 || scale>1.0)
    popup.setFont(getFont());
  while (true) {
    count++;
    s = Prefs.getString("popup" + (count/10)%10 + count%10);
    if (s==null)
      break;
    if (s.equals("-"))
      popup.addSeparator();
    else if (!s.equals("")) {
      mi = new MenuItem(s);
      mi.addActionListener(ij);
      popup.add(mi);
    }
  }
}

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

/** Prepares and returns the popupMenu of the Data>> button */
PopupMenu getDataPopupMenu() {
  dataPopupMenu = new PopupMenu();
  menuItems[SAVE] = addPopupItem(dataPopupMenu, "Save Data...");
  menuItems[COPY] = addPopupItem(dataPopupMenu, "Copy 1st Data Set");
  menuItems[COPY_ALL] = addPopupItem(dataPopupMenu, "Copy All Data");
  dataPopupMenu.addSeparator();
  menuItems[ADD_FROM_TABLE] = addPopupItem(dataPopupMenu, "Add from Table...");
  menuItems[ADD_FROM_PLOT] = addPopupItem(dataPopupMenu, "Add from Plot...");
  menuItems[ADD_FIT] = addPopupItem(dataPopupMenu, "Add Fit...");
  return dataPopupMenu;
}

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

/** Prepares and returns the popupMenu of the Data>> button */
PopupMenu getDataPopupMenu() {
  dataPopupMenu = new PopupMenu();
  menuItems[SAVE] = addPopupItem(dataPopupMenu, "Save Data...");
  menuItems[COPY] = addPopupItem(dataPopupMenu, "Copy 1st Data Set");
  menuItems[COPY_ALL] = addPopupItem(dataPopupMenu, "Copy All Data");
  dataPopupMenu.addSeparator();
  menuItems[ADD_FROM_TABLE] = addPopupItem(dataPopupMenu, "Add from Table...");
  menuItems[ADD_FROM_PLOT] = addPopupItem(dataPopupMenu, "Add from Plot...");
  menuItems[ADD_FIT] = addPopupItem(dataPopupMenu, "Add Fit...");
  return dataPopupMenu;
}

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

void addPopupMenu() {
  pm=new PopupMenu();
  addPopupItem("Save As...");
  pm.addSeparator();
  addPopupItem("Cut");
  addPopupItem("Copy");
  addPopupItem("Clear");
  addPopupItem("Select All");
  add(pm);
}

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

void addPopupMenu() {
  pm=new PopupMenu();
  addPopupItem("Save As...");
  pm.addSeparator();
  addPopupItem("Cut");
  addPopupItem("Copy");
  addPopupItem("Clear");
  addPopupItem("Select All");
  add(pm);
}

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

/** Prepares and returns the popupMenu of the More>> button */
PopupMenu getMorePopupMenu() {
  morePopupMenu = new PopupMenu();
  menuItems[SET_RANGE] = addPopupItem(morePopupMenu, "Set Range...");
  menuItems[PREV_RANGE] = addPopupItem(morePopupMenu, "Previous Range");
  menuItems[RESET_RANGE] = addPopupItem(morePopupMenu, "Reset Range");
  menuItems[FIT_RANGE] = addPopupItem(morePopupMenu, "Set Range to Fit All");
  menuItems[ZOOM_SELECTION] = addPopupItem(morePopupMenu, "Zoom to Selection");
  morePopupMenu.addSeparator();
  menuItems[AXIS_OPTIONS] = addPopupItem(morePopupMenu, "Axis Options...");
  menuItems[LEGEND] = addPopupItem(morePopupMenu, "Legend...");
  menuItems[STYLE] = addPopupItem(morePopupMenu, "Contents Style...");
  menuItems[RESET_PLOT] = addPopupItem(morePopupMenu, "Reset Format");
  menuItems[FREEZE] = addPopupItem(morePopupMenu, "Freeze Plot", true);
  menuItems[HI_RESOLUTION] = addPopupItem(morePopupMenu, "High-Resolution Plot...");
  morePopupMenu.addSeparator();
  menuItems[PROFILE_PLOT_OPTIONS] = addPopupItem(morePopupMenu, "Plot Options...");
  return morePopupMenu;
}

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

/** Prepares and returns the popupMenu of the More>> button */
PopupMenu getMorePopupMenu() {
  morePopupMenu = new PopupMenu();
  menuItems[SET_RANGE] = addPopupItem(morePopupMenu, "Set Range...");
  menuItems[PREV_RANGE] = addPopupItem(morePopupMenu, "Previous Range");
  menuItems[RESET_RANGE] = addPopupItem(morePopupMenu, "Reset Range");
  menuItems[FIT_RANGE] = addPopupItem(morePopupMenu, "Set Range to Fit All");
  menuItems[ZOOM_SELECTION] = addPopupItem(morePopupMenu, "Zoom to Selection");
  morePopupMenu.addSeparator();
  menuItems[AXIS_OPTIONS] = addPopupItem(morePopupMenu, "Axis Options...");
  menuItems[LEGEND] = addPopupItem(morePopupMenu, "Legend...");
  menuItems[STYLE] = addPopupItem(morePopupMenu, "Contents Style...");
  menuItems[RESET_PLOT] = addPopupItem(morePopupMenu, "Reset Format");
  menuItems[FREEZE] = addPopupItem(morePopupMenu, "Freeze Plot", true);
  menuItems[HI_RESOLUTION] = addPopupItem(morePopupMenu, "High-Resolution Plot...");
  morePopupMenu.addSeparator();
  menuItems[PROFILE_PLOT_OPTIONS] = addPopupItem(morePopupMenu, "Plot Options...");
  return morePopupMenu;
}

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

private void extendMenus() {
  pm.addSeparator();
  addPopupItem("Rename...");
  addPopupItem("Duplicate...");
  addPopupItem("Apply Macro...");
  addPopupItem("Sort...");
  addPopupItem("Plot...");
  if (fileMenu!=null) {
    fileMenu.add("Rename...");
    fileMenu.add("Duplicate...");
  }
  if (editMenu!=null) {
    editMenu.addSeparator();
    editMenu.add("Apply Macro...");
  }
  menusExtended = true;
}

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

private void extendMenus() {
  pm.addSeparator();
  addPopupItem("Rename...");
  addPopupItem("Duplicate...");
  addPopupItem("Apply Macro...");
  addPopupItem("Sort...");
  addPopupItem("Plot...");
  if (fileMenu!=null) {
    fileMenu.add("Rename...");
    fileMenu.add("Duplicate...");
  }
  if (editMenu!=null) {
    editMenu.addSeparator();
    editMenu.add("Apply Macro...");
  }
  menusExtended = true;
}

相关文章