From: <mg...@us...> - 2008-05-21 16:15:20
|
Revision: 1805 http://obo.svn.sourceforge.net/obo/?rev=1805&view=rev Author: mgibson Date: 2008-05-21 09:15:15 -0700 (Wed, 21 May 2008) Log Message: ----------- clear out current file on new/clear Modified Paths: -------------- phenote/trunk/src/java/phenote/dataadapter/CharacterListManager.java phenote/trunk/src/java/phenote/gui/menu/FileMenu.java Modified: phenote/trunk/src/java/phenote/dataadapter/CharacterListManager.java =================================================================== --- phenote/trunk/src/java/phenote/dataadapter/CharacterListManager.java 2008-05-21 15:41:14 UTC (rev 1804) +++ phenote/trunk/src/java/phenote/dataadapter/CharacterListManager.java 2008-05-21 16:15:15 UTC (rev 1805) @@ -99,6 +99,7 @@ characterList.clear(); // notify listeners??? - i think so, need to clear out gui fireChangeEvent(this,characterList); // empty char list + currentFile = null; // i think this belongs here? } public File getCurrentDataFile() { Modified: phenote/trunk/src/java/phenote/gui/menu/FileMenu.java =================================================================== --- phenote/trunk/src/java/phenote/gui/menu/FileMenu.java 2008-05-21 15:41:14 UTC (rev 1804) +++ phenote/trunk/src/java/phenote/gui/menu/FileMenu.java 2008-05-21 16:15:15 UTC (rev 1805) @@ -57,13 +57,7 @@ add(new JSeparator()); // SAVE - final Action saveAction = new AbstractAction("Save") { - public void actionPerformed(ActionEvent e) { - LoadSaveManager.inst().saveData(true); - } - }; - saveAction.putValue(Action.ACCELERATOR_KEY, getKeyStroke(KeyEvent.VK_S)); - add(new JMenuItem(saveAction)); + addSaveItem(); // SAVE AS final Action saveAsAction = new AbstractAction("Save As...") { @@ -122,6 +116,18 @@ } + /** Save to previously saved/loaded file name */ + private void addSaveItem() { + final Action saveAction = new AbstractAction("Save") { + public void actionPerformed(ActionEvent e) { + LoadSaveManager.inst().saveData(true); + } + }; + saveAction.putValue(Action.ACCELERATOR_KEY, getKeyStroke(KeyEvent.VK_S)); + add(new JMenuItem(saveAction)); + } + + /** Open Menu item, for getting new data */ private void addOpenItem() { final Action openAction = new AbstractAction("Open...") { @@ -154,6 +160,13 @@ clear.addActionListener(new ClearAnnots()); add(clear); } + /** clear out all annots - should this bring up a are you sure popup? + also clears transactions */ + private class ClearAnnots implements ActionListener { + public void actionPerformed(ActionEvent e) { + CharacterListManager.clearAnnotations(); // ?? + } + } /** this currently doesnt work - throws null pointer - commented out above */ private void addPreferencesItem() { @@ -171,13 +184,6 @@ } - /** clear out all annots - should this bring up a are you sure popup? - also clears transactions */ - private class ClearAnnots implements ActionListener { - public void actionPerformed(ActionEvent e) { - CharacterListManager.clearAnnotations(); // ?? - } - } // for testing public void clickLoad() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |