本文整理汇总了Java中jam.framework.AbstractFrame.getSaveAsAction方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractFrame.getSaveAsAction方法的具体用法?Java AbstractFrame.getSaveAsAction怎么用?Java AbstractFrame.getSaveAsAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jam.framework.AbstractFrame
的用法示例。
在下文中一共展示了AbstractFrame.getSaveAsAction方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: populateMenu
import jam.framework.AbstractFrame; //导入方法依赖的package包/类
public void populateMenu(JMenu menu, AbstractFrame frame) {
JMenuItem item;
Application application = Application.getApplication();
menu.setMnemonic('F');
item = new JMenuItem(application.getNewAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getOpenAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAsAction());
menu.add(item);
menu.addSeparator();
// On Windows and Linux platforms, each window has its own menu so items which are not needed
// are simply missing. In contrast, on Mac, the menu is for the application so items should
// be enabled/disabled as frames come to the front.
if (frame instanceof PathogenFrame) {
// Action action = frame.getImportAction();
// if (action != null) {
// item = new JMenuItem(action);
// item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, MenuBarFactory.MENU_MASK));
// menu.add(item);
//
// menu.addSeparator();
// }
item = new JMenuItem(((PathogenFrame)frame).getExportTreeAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK));
menu.add(item);
// item = new JMenuItem(((TemporalSamplerFrame)frame).getExportGraphicAction());
// item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK + KeyEvent.ALT_MASK));
// menu.add(item);
item = new JMenuItem(((PathogenFrame)frame).getExportDataAction());
menu.add(item);
} else {
// do nothing
}
menu.addSeparator();
item = new JMenuItem(frame.getPrintAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getPageSetupAction());
menu.add(item);
menu.addSeparator();
if (application.getRecentFileMenu() != null) {
JMenu subMenu = application.getRecentFileMenu();
menu.add(subMenu);
menu.addSeparator();
}
item = new JMenuItem(application.getExitAction());
menu.add(item);
}
示例2: populateMenu
import jam.framework.AbstractFrame; //导入方法依赖的package包/类
public void populateMenu(JMenu menu, AbstractFrame frame) {
JMenuItem item;
Application application = Application.getApplication();
menu.setMnemonic('F');
item = new JMenuItem(application.getNewAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getOpenAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAsAction());
menu.add(item);
menu.addSeparator();
// On Windows and Linux platforms, each window has its own menu so items which are not needed
// are simply missing. In contrast, on Mac, the menu is for the application so items should
// be enabled/disabled as frames come to the front.
if (frame instanceof TempestFrame) {
Action action = frame.getImportAction();
if (action != null) {
item = new JMenuItem(action);
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, MenuBarFactory.MENU_MASK));
menu.add(item);
menu.addSeparator();
}
item = new JMenuItem(((TempestFrame)frame).getExportTreeAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK));
menu.add(item);
// item = new JMenuItem(((TemporalSamplerFrame)frame).getExportGraphicAction());
// item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK + KeyEvent.ALT_MASK));
// menu.add(item);
item = new JMenuItem(((TempestFrame)frame).getExportDataAction());
menu.add(item);
} else {
// do nothing
}
menu.addSeparator();
item = new JMenuItem(frame.getPrintAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getPageSetupAction());
menu.add(item);
menu.addSeparator();
if (application.getRecentFileMenu() != null) {
JMenu subMenu = application.getRecentFileMenu();
menu.add(subMenu);
menu.addSeparator();
}
item = new JMenuItem(application.getExitAction());
menu.add(item);
}
示例3: populateMenu
import jam.framework.AbstractFrame; //导入方法依赖的package包/类
public void populateMenu(JMenu menu, AbstractFrame frame) {
JMenuItem item;
Application application = Application.getApplication();
menu.setMnemonic('F');
item = new JMenuItem(application.getNewAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getOpenAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAsAction());
menu.add(item);
menu.addSeparator();
item = new JMenuItem(frame.getImportAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(((BeautiFrame)frame).getImportTraitsAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, MenuBarFactory.MENU_MASK + ActionEvent.ALT_MASK));
menu.add(item);
item = new JMenuItem(frame.getExportAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK));
menu.add(item);
menu.addSeparator();
item = new JMenuItem(frame.getPrintAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getPageSetupAction());
menu.add(item);
menu.addSeparator();
item = new JMenuItem(application.getExitAction());
menu.add(item);
}
示例4: populateMenu
import jam.framework.AbstractFrame; //导入方法依赖的package包/类
public void populateMenu(JMenu menu, AbstractFrame frame) {
JMenuItem item;
Application application = Application.getApplication();
menu.setMnemonic('F');
item = new JMenuItem(application.getNewAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getOpenAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAsAction());
menu.add(item);
menu.addSeparator();
// On Windows and Linux platforms, each window has its own menu so items which are not needed
// are simply missing. In contrast, on Mac, the menu is for the application so items should
// be enabled/disabled as frames come to the front.
if (frame instanceof MapperFileMenuHandler) {
item = new JMenuItem(((MapperFileMenuHandler)frame).getImportMeasurementsAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(((MapperFileMenuHandler)frame).getImportLocationsAction());
menu.add(item);
item = new JMenuItem(((MapperFileMenuHandler)frame).getImportTreesAction());
menu.add(item);
item = new JMenuItem(((MapperFileMenuHandler)frame).getExportDataAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(((MapperFileMenuHandler)frame).getExportPDFAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK + KeyEvent.ALT_MASK));
menu.add(item);
} else {
// If the frame is not a TracerFileMenuHandler then leave out the import/export options.
}
menu.addSeparator();
item = new JMenuItem(frame.getPrintAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getPageSetupAction());
menu.add(item);
menu.addSeparator();
item = new JMenuItem(application.getExitAction());
menu.add(item);
}
示例5: populateMenu
import jam.framework.AbstractFrame; //导入方法依赖的package包/类
public void populateMenu(JMenu menu, AbstractFrame frame) {
JMenuItem item;
Application application = Application.getApplication();
menu.setMnemonic('F');
item = new JMenuItem(application.getNewAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getImportAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, MenuBarFactory.MENU_MASK));
menu.add(item);
menu.addSeparator();
item = new JMenuItem(frame.getOpenAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAsAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MenuBarFactory.MENU_MASK));
menu.add(item);
menu.addSeparator();
item = new JMenuItem(frame.getExportAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK));
menu.add(item);
menu.addSeparator();
item = new JMenuItem(frame.getPrintAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getPageSetupAction());
menu.add(item);
menu.addSeparator();
item = new JMenuItem(application.getExitAction());
menu.add(item);
}
示例6: populateMenu
import jam.framework.AbstractFrame; //导入方法依赖的package包/类
public void populateMenu(JMenu menu, AbstractFrame frame) {
Application application = Application.getApplication();
JMenuItem item;
item = new JMenuItem(application.getNewAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, MenuBarFactory.MENU_MASK));
menu.add(item);
if (frame instanceof BeautiFrame) {
item = new JMenuItem(frame.getImportAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, MenuBarFactory.MENU_MASK));
menu.add(item);
menu.addSeparator();
item = new JMenuItem(((BeautiFrame)frame).getOpenAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAsAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MenuBarFactory.MENU_MASK));
menu.add(item);
menu.addSeparator();
item = new JMenuItem(frame.getExportAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK));
menu.add(item);
} else {
// If the frame is not a BeautiFrame then create a dummy set of disabled menu options.
// At present the only situation where this may happen is in Mac OS X when no windows
// are open and the menubar is created by the hidden frame.
item = new JMenuItem("Import NEXUS...");
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, MenuBarFactory.MENU_MASK));
item.setEnabled(false);
menu.add(item);
menu.addSeparator();
item = new JMenuItem("Apply Template...");
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MenuBarFactory.MENU_MASK));
item.setEnabled(false);
menu.add(item);
item = new JMenuItem("Save Template As...");
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MenuBarFactory.MENU_MASK));
item.setEnabled(false);
menu.add(item);
menu.addSeparator();
item = new JMenuItem("Generate BEAST File...");
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK));
item.setEnabled(false);
menu.add(item);
}
menu.addSeparator();
item = new JMenuItem(frame.getCloseWindowAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, MenuBarFactory.MENU_MASK));
menu.add(item);
menu.addSeparator();
item = new JMenuItem(frame.getPrintAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getPageSetupAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, MenuBarFactory.MENU_MASK + ActionEvent.SHIFT_MASK));
menu.add(item);
}
示例7: populateMenu
import jam.framework.AbstractFrame; //导入方法依赖的package包/类
public void populateMenu(JMenu menu, AbstractFrame frame) {
JMenuItem item;
Application application = Application.getApplication();
menu.setMnemonic('F');
item = new JMenuItem(application.getNewAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getOpenAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAsAction());
menu.add(item);
menu.addSeparator();
// On Windows and Linux platforms, each window has its own menu so items which are not needed
// are simply missing. In contrast, on Mac, the menu is for the application so items should
// be enabled/disabled as frames come to the front.
if (frame instanceof PathogenFrame) {
// Action action = frame.getImportAction();
// if (action != null) {
// item = new JMenuItem(action);
// item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, MenuBarFactory.MENU_MASK));
// menu.add(item);
//
// menu.addSeparator();
// }
item = new JMenuItem(((PathogenFrame)frame).getExportTreeAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK));
menu.add(item);
// item = new JMenuItem(((PathogenFrame)frame).getExportGraphicAction());
// item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK + KeyEvent.ALT_MASK));
// menu.add(item);
item = new JMenuItem(((PathogenFrame)frame).getExportDataAction());
menu.add(item);
} else {
// do nothing
}
menu.addSeparator();
item = new JMenuItem(frame.getPrintAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getPageSetupAction());
menu.add(item);
menu.addSeparator();
if (application.getRecentFileMenu() != null) {
JMenu subMenu = application.getRecentFileMenu();
menu.add(subMenu);
menu.addSeparator();
}
item = new JMenuItem(application.getExitAction());
menu.add(item);
}
示例8: populateMenu
import jam.framework.AbstractFrame; //导入方法依赖的package包/类
public void populateMenu(JMenu menu, AbstractFrame frame) {
Application application = Application.getApplication();
JMenuItem item;
item = new JMenuItem(application.getNewAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getOpenAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(frame.getSaveAsAction());
menu.add(item);
menu.addSeparator();
if (frame instanceof PathogenFrame) {
item = new JMenuItem(((PathogenFrame)frame).getExportTreeAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK));
menu.add(item);
// item = new JMenuItem(((PathogenFrame)frame).getExportGraphicAction());
// item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK + KeyEvent.ALT_MASK));
// menu.add(item);
item = new JMenuItem(((PathogenFrame)frame).getExportDataAction());
menu.add(item);
item = new JMenuItem(((PathogenFrame)frame).getExportTimeTreeAction());
menu.add(item);
} else {
// If the frame is not a BeautiFrame then create a dummy set of disabled menu options.
// At present the only situation where this may happen is in Mac OS X when no windows
// are open and the menubar is created by the hidden frame.
item = new JMenuItem("Export Tree...");
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK));
item.setEnabled(false);
menu.add(item);
// item = new JMenuItem("Export Graphic...");
// item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, MenuBarFactory.MENU_MASK + KeyEvent.ALT_MASK));
// item.setEnabled(false);
// menu.add(item);
item = new JMenuItem("Export Data...");
item.setEnabled(false);
menu.add(item);
}
menu.addSeparator();
item = new JMenuItem(frame.getCloseWindowAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, MenuBarFactory.MENU_MASK));
menu.add(item);
menu.addSeparator();
item = new JMenuItem(frame.getPrintAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, MenuBarFactory.MENU_MASK));
menu.add(item);
item = new JMenuItem(application.getPageSetupAction());
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P, MenuBarFactory.MENU_MASK + ActionEvent.SHIFT_MASK));
menu.add(item);
}