JMenu pexport = new JMenu(Messages.getString("MainFrame.MENU_EXPORT")); //$NON-NLS-1$
pimport.setMnemonic(KeyEvent.VK_I);
pexport.setMnemonic(KeyEvent.VK_E);
PluginLoader pluginLoader = new PluginLoader();
Collection<String> errors = pluginLoader.loadPlugins();
if (!errors.isEmpty()) {
showPluginErrors(errors);
}
pexport.add(createMenuItem(EXPORT_ATLAS));
pexport.add(createMenuItem(EXPORT_PROJECT));
pexport.add(createMenuItem(EXPORT_ANIMATION));
if (pluginLoader.hasExportPlugins()) {
pexport.addSeparator();
for (ExportPlugin plugin : pluginLoader.getExportPlugins()) {
pexport.add(new ExportPlugunAction(this, factory, plugin));
}
}
pimport.add(createMenuItem(IMPORT_ANIMATION));
pimport.add(createMenuItem(IMPORT_TEXTURE));
pimport.add(createMenuItem(IMPORT_TILED_TEXTURE));
if (pluginLoader.hasImportPlugins()) {
pimport.addSeparator();
for (ImportPlugin plugin : pluginLoader.getImportPlugins()) {
pimport.add(new ImportPlugunAction(this, factory, plugin));
}
}
project.add(createMenuItem(NEW_PROJECT));
project.add(createMenuItem(OPEN_PROJECT));
project.add(createMenuItem(SAVE_PROJECT));
project.add(createMenuItem(SAVE_PROJECT_AS));
project.addSeparator();
project.add(createMenuItem(VIEW_ATLAS));
project.add(createMenuItem(SETTINGS_PROJECT));
project.addSeparator();
project.add(pexport);
project.add(pimport);
project.add(createMenuItem(SETTINGS_APPLICATION));
project.addSeparator();
project.add(createMenuItem(EXIT_APPLICATION));
animation.add(createMenuItem(CREATE_ANIMATION));
animation.add(createMenuItem(RENAME_ANIMATION));
animation.add(createMenuItem(REMOVE_ANIMATION));
animation.addSeparator();
animation.add(createMenuItem(MOVE_ANIMATION_UP));
animation.add(createMenuItem(MOVE_ANIMATION_DOWN));
animation.addSeparator();
animation.add(createMenuItem(ALIGN_ANIMATIONS));
animation.add(createMenuItem(OFFSET_ANIMATION));
animation.add(createMenuItem(CENTER_ANIMATION));
sprite.add(createMenuItem(CREATE_SPRITE));
sprite.add(createMenuItem(RENAME_SPRITE));
sprite.add(createMenuItem(REMOVE_SPRITE));
sprite.addSeparator();
sprite.add(createMenuItem(MOVE_SPRITE_UP));
sprite.add(createMenuItem(MOVE_SPRITE_DOWN));
sprite.addSeparator();
sprite.add(createMenuItem(OFFSET_SPRITE));
sprite.add(createMenuItem(SPRITE_TEXTURE));
texture.add(createMenuItem(MERGE_SIMILAR_TEXTURES));
texture.add(createMenuItem(REMOVE_TEXTURE));
if (pluginLoader.hasServicePlugins()) {
JMenu plugins = new JMenu(
Messages.getString("MainFrame.MENU_PLUGINS")); //$NON-NLS-1$)
int index = menuBar.getComponentCount() - 1;
for (ServicePlugin plugin : pluginLoader.getServicePlugins()) {
plugins.add(new ServicePlugunAction(this, factory, plugin));
}
menuBar.add(plugins, index);
}