From: <mg...@us...> - 2008-05-20 22:12:39
|
Revision: 1803 http://obo.svn.sourceforge.net/obo/?rev=1803&view=rev Author: mgibson Date: 2008-05-20 15:12:44 -0700 (Tue, 20 May 2008) Log Message: ----------- old phenote now using new menu.FileMenu which has clear all annotations once this checks out old gui.FileMenu should be removed as its now irrelevant Modified Paths: -------------- phenote/trunk/src/java/phenote/gui/FileMenu.java phenote/trunk/src/java/phenote/gui/MenuManager.java phenote/trunk/src/java/phenote/gui/menu/FileMenu.java Modified: phenote/trunk/src/java/phenote/gui/FileMenu.java =================================================================== --- phenote/trunk/src/java/phenote/gui/FileMenu.java 2008-05-20 19:29:57 UTC (rev 1802) +++ phenote/trunk/src/java/phenote/gui/FileMenu.java 2008-05-20 22:12:44 UTC (rev 1803) @@ -20,7 +20,9 @@ /** This is old and only used by old non-plus regular phenote, - phenote-plus uses phenote.gui.menu.FileMenu */ + phenote-plus uses phenote.gui.menu.FileMenu + ok so old is now using new menu.FileMenu so this should probably be removed + from svn once the new file menu checks out ok on old phenote*/ class FileMenu extends JMenu { private JMenuItem loadMenuItem; Modified: phenote/trunk/src/java/phenote/gui/MenuManager.java =================================================================== --- phenote/trunk/src/java/phenote/gui/MenuManager.java 2008-05-20 19:29:57 UTC (rev 1802) +++ phenote/trunk/src/java/phenote/gui/MenuManager.java 2008-05-20 22:12:44 UTC (rev 1803) @@ -8,6 +8,7 @@ import javax.swing.JMenuBar; import javax.swing.JMenuItem; +/** this is old regular phenote - not used in plus - phase out eventually */ public class MenuManager { private JMenuBar menuBar; @@ -52,16 +53,18 @@ private void initMenus(JFrame frame) { this.menuBar = new JMenuBar(); - try { - fileMenu = new FileMenu(); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } +// try { +// fileMenu = new FileMenu(); +// } catch (FileNotFoundException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// this.menuBar.add(fileMenu); + editMenu = new EditMenu(); + menuBar.add(new phenote.gui.menu.FileMenu()); // phenote2 file menu settingsMenu = new SettingsMenu(); helpMenu = new HelpMenu(); - this.menuBar.add(fileMenu); this.menuBar.add(editMenu); this.menuBar.add(settingsMenu); this.menuBar.add(helpMenu); Modified: phenote/trunk/src/java/phenote/gui/menu/FileMenu.java =================================================================== --- phenote/trunk/src/java/phenote/gui/menu/FileMenu.java 2008-05-20 19:29:57 UTC (rev 1802) +++ phenote/trunk/src/java/phenote/gui/menu/FileMenu.java 2008-05-20 22:12:44 UTC (rev 1803) @@ -48,12 +48,15 @@ @SuppressWarnings("serial") private void init() { + // OPEN addOpenItem(); + // CLEAR addClearAnnotsItem(); add(new JSeparator()); + // SAVE final Action saveAction = new AbstractAction("Save") { public void actionPerformed(ActionEvent e) { LoadSaveManager.inst().saveData(true); @@ -62,6 +65,7 @@ saveAction.putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_S, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); add(new JMenuItem(saveAction)); + // SAVE AS final Action saveAsAction = new AbstractAction("Save As...") { public void actionPerformed(ActionEvent e) { if (!Config.inst().hasDataAdapters()) { @@ -86,6 +90,7 @@ // export.addActionListener(actionListener); // add(export); + // EXIT if (!Phenote.isRunningOnMac()) { // we don't want to add "Exit" to the File menu on Mac // instead there is "Quit" under the automatic Phenote menu @@ -106,20 +111,10 @@ } }); add(exit); } - - addSeparator(); - JMenuItem preferences = new JMenuItem("Preferences"); - preferences.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - GetInfo getInfo = new GetInfo(); -// getInfo.setVisible(true); -// getInfo.setEnabled(true); -// getInfo.setAlwaysOnTop(true); - } - }); - add(preferences); - + // PREFERENCES this doesnt work - throws null pointer - commenting out for now + //addPreferencesItem(); + for (OntologyMakerI om : Config.inst().getOntMakers()) { JMenuItem m = new JMenuItem(new MakeOntolAction(om)); add(m); @@ -159,6 +154,21 @@ clear.addActionListener(new ClearAnnots()); add(clear); } + + /** this currently doesnt work - throws null pointer - commented out above */ + private void addPreferencesItem() { + addSeparator(); + JMenuItem preferences = new JMenuItem("Preferences"); + preferences.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + GetInfo getInfo = new GetInfo(); +// getInfo.setVisible(true); +// getInfo.setEnabled(true); +// getInfo.setAlwaysOnTop(true); + } + }); + add(preferences); + } /** clear out all annots - should this bring up a are you sure popup? This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |