https://projects.ecoinformatics.org/ecoinfo/https://projects.ecoinformatics.org/ecoinfo/ecoinfo/favicon.ico?14691340362009-08-07T16:54:03ZEcoinformatics RedmineKepler - Bug #4112: make kepler use OSX dialog boxeshttps://projects.ecoinformatics.org/ecoinfo/issues/4112?journal_id=139312009-08-07T16:54:03ZChad Berkleyberkley@nceas.ucsb.edu
<ul></ul><p>In order to do this, we need to not use JFileChooser and instead use java.awt.FileDialog. This is the only way to get the JDK to use the native mac dialogs according to Apple.</p>
<p><a class="external" href="http://developer.apple.com/documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html">http://developer.apple.com/documentation/Java/Conceptual/Java14Development/07-NativePlatformIntegration/NativePlatformIntegration.html</a></p> Kepler - Bug #4112: make kepler use OSX dialog boxeshttps://projects.ecoinformatics.org/ecoinfo/issues/4112?journal_id=139322009-08-07T21:16:41ZTimothy McPhillipsmcphillips@ecoinformatics.org
<ul></ul><p>This would be great because it apparently would allow me to quickly save or load workflows in my home directory, etc. In other apps I really appreciate having immediate access to those shortcuts in the "Devices/Shared/Places" pane on the left side of the Finder open/save dialog.</p> Kepler - Bug #4112: make kepler use OSX dialog boxeshttps://projects.ecoinformatics.org/ecoinfo/issues/4112?journal_id=139332009-08-07T21:27:34ZDavid Welkerwelker4kepler@gmail.com
<ul></ul><p>I think we should consider requiring users to upgrade to Java 1.6 Update 12 or higher for Kepler 2.0.</p>
<p>Before then, it was definitely a heavily discouraged practice to mix AWT and Swing since they do not respect their Z-order. I think that this is an important enough issue that we should require users to upgrade. I also think it would be sensible for an upgrade of Java to occur with the release of 2.0.</p> Kepler - Bug #4112: make kepler use OSX dialog boxeshttps://projects.ecoinformatics.org/ecoinfo/issues/4112?journal_id=139342009-08-08T19:55:16ZChristopher Brookscxh@eecs.berkeley.edu
<ul></ul><p>The easiest way to use java.awt.FileDialog for File =>Open etc. would be<br />to modify ptolemy.gui.Top. Modifyig ptolemy.gui.Query would solve the<br />problem for FileParameter. I'm not sure where to fix "Open Archive (KAR)".<br />See also<br /><a class="external" href="http://bugzilla.ecoinformatics.org/show_bug.cgi?id=3801">http://bugzilla.ecoinformatics.org/show_bug.cgi?id=3801</a></p>
<p>The way I'd fix this is to look at creating a class called PtFileDialog<br />that would work either on a JFileDialog or a java.awt.FileDialog depending<br />on whether ptolemy.gui.PtGUIUtilities.macOSXLookAndFeel returned true.<br />I'm not sure if it would be easy to write PtFileDialog.</p>
<p>One issue is that ptolemy.gui should not depend on Mac specific classes or<br />on anything other than ptolemy.util.</p> Kepler - Bug #4112: make kepler use OSX dialog boxeshttps://projects.ecoinformatics.org/ecoinfo/issues/4112?journal_id=139352012-06-11T21:23:02ZDaniel Crawldanielcrawl@gmail.com
<ul></ul><p>Christopher, did you finish this? The file dialogs on mac appear to be using java.awt.FileDialog.</p> Kepler - Bug #4112: make kepler use OSX dialog boxeshttps://projects.ecoinformatics.org/ecoinfo/issues/4112?journal_id=139362012-06-11T21:59:39ZChristopher Brookscxh@eecs.berkeley.edu
<ul></ul><p>Ptolemy II now uses java.awt.FileDialog for file open etc.<br />ptolemy.gui.PtFileChooser is a FileDialog or a FileChooser.<br />See ./ptolemy/src/ptolemy/vergil/basic/BasicGraphFrame.java for example code</p>
<p>There are a few places in Ptolemy that still need to be fixed.</p>
<p>Below are the files that need to be reviewed.<br />I can handle the ptolemy/ files, can someone else handle the kepler files?</p>
<p>bash-3.2$ cd ~/src/kepler<br />bash-3.2$ find . -name "*.java" >& /tmp/kj<br />bash-3.2$ cat /tmp/kj | xargs grep JFileChooser | grep new | grep -v BugFix<br />./actors/src/org/cipres/kepler/NexusFileReader.java: JFileChooser fileChooser = new JFileChooser();<br />./data-handling/src/org/ecoinformatics/seek/querybuilder/QBApp.java: JFileChooser chooser = new JFileChooser("Save " + aTitle);<br />./data-handling/src/org/ecoinformatics/seek/querybuilder/QBApp.java: JFileChooser chooser = new JFileChooser("Open " + aTitle);<br />./gui/src/org/kepler/gui/ComponentLibraryPreferencesTab.java: JFileChooser jfc = new JFileChooser(saveRepo);<br />./gui/src/org/kepler/gui/kar/DeleteArchiveAction.java: JFileChooser chooser = new JFileChooser();<br />./gui/src/org/kepler/gui/kar/ExportArchiveAction.java: JFileChooser chooser = new JFileChooser();<br />./gui/src/org/kepler/gui/kar/OpenArchiveAction.java: JFileChooser chooser = new JFileChooser();<br />./gui/src/org/kepler/gui/kar/RefreshFolderAction.java: JFileChooser chooser = new JFileChooser();<br />./gui/src/org/kepler/gui/kar/ViewManifestAction.java: JFileChooser chooser = new JFileChooser();<br />./module-manager-gui/src/org/kepler/modulemanager/gui/CurrentSuitePanel.java: JFileChooser fc = new JFileChooser();<br />./module-manager-gui/src/org/kepler/modulemanager/gui/CurrentSuitePanel.java: JFileChooser fc = new JFileChooser();<br />./ptolemy/src/diva/gui/BasicStoragePolicy.java: JFileChooser fc = new JFileChooser(dir);<br />./ptolemy/src/diva/gui/BasicStoragePolicy.java: JFileChooser fc = new JFileChooser(dir);<br />./ptolemy/src/diva/gui/DefaultStoragePolicy.java: private JFileChooser _openFileChooser = new JFileChooser();<br />./ptolemy/src/diva/gui/DefaultStoragePolicy.java: private JFileChooser _saveFileChooser = new JFileChooser();<br />./ptolemy/src/diva/gui/ExtensionFileFilter.java: * JFileChooser chooser = new JFileChooser();<br />./ptolemy/src/org/mlc/swing/layout/LayoutFrame.java: final JFileChooser fileChooser = new JFileChooser();<br />./ptolemy/src/ptdb/gui/DatabaseSetupFrame.java: JFileChooser fileChooser = new JFileChooser();<br />./ptolemy/src/ptdb/gui/ModelMigrationFrame.java: JFileChooser fileChooser = new JFileChooser();<br />./ptolemy/src/ptdb/gui/SimpleSearchFrame.java: JFileChooser chooser = new JFileChooser();<br />./ptolemy/src/ptdb/gui/SimpleSearchFrame.java: JFileChooser chooser = new JFileChooser();<br />./ptolemy/src/ptolemy/actor/gui/PlotTableauFrame.java: JFileChooser fileDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/actor/gui/PlotTableauFrame.java: JFileChooser fileDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/domains/giotto/cgc/GiottoCEmachineFrameworkGenerator.java: JFileChooser dirDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/gui/ExtensionFilenameFilter.java: * JFileChooser chooser = new JFileChooser();<br />./ptolemy/src/ptolemy/gui/PtFileChooser.java: _jFileChooser = new JFileChooser();<br />./ptolemy/src/ptolemy/gui/Query.java: JFileChooser fileChooser = new JFileChooser(_startingDirectory) {<br />./ptolemy/src/ptolemy/gui/Top.java: JFileChooser fileDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/gui/Top.java: JFileChooser fileDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/homer/gui/HomerMenu.java: _fileChooser = new JFileChooser();<br />./ptolemy/src/ptolemy/plot/PlotFrame.java: JFileChooser fileDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/plot/PlotFrame.java: JFileChooser fileDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/plot/PlotFrame.java: JFileChooser fileDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/vergil/fsm/fmv/FmvAutomatonGraphFrame.java: JFileChooser fileSaveDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/vergil/fsm/fmv/FmvAutomatonGraphFrame.java: JFileChooser fileDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/vergil/fsm/ia/InterfaceAutomatonGraphController.java: JFileChooser fileDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/vergil/kernel/attributes/DocumentationAttribute.java: JFileChooser fileDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/vergil/modal/fmv/FmvAutomatonGraphFrame.java: JFileChooser fileSaveDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/vergil/modal/fmv/FmvAutomatonGraphFrame.java: JFileChooser fileDialog = new JFileChooser();<br />./ptolemy/src/ptolemy/vergil/modal/ia/InterfaceAutomatonGraphController.java: JFileChooser fileDialog = new JFileChooser();</p> Kepler - Bug #4112: make kepler use OSX dialog boxeshttps://projects.ecoinformatics.org/ecoinfo/issues/4112?journal_id=139372012-06-12T00:53:41ZDaniel Crawldanielcrawl@gmail.com
<ul></ul><p>OpenArchiveAction.java and ExportArchiveAction.java were already fixed and use PtGUIUtilities.useFileDialog(). I fixed the rest in Kepler.</p> Kepler - Bug #4112: make kepler use OSX dialog boxeshttps://projects.ecoinformatics.org/ecoinfo/issues/4112?journal_id=139382012-06-27T15:22:18ZDaniel Crawldanielcrawl@gmail.com
<ul></ul><p>When saving, JFileChooser does not ask to overwrite existing files, but FileDialog does. It would be nice if PtFileChooser.showDialog would ask when using JFileChooser.</p> Kepler - Bug #4112: make kepler use OSX dialog boxeshttps://projects.ecoinformatics.org/ecoinfo/issues/4112?journal_id=139392012-06-27T17:44:51ZChristopher Brookscxh@eecs.berkeley.edu
<ul></ul><p>Dan writes:</p>
<blockquote>
<p>When saving, JFileChooser does not ask to overwrite existing files, but<br />FileDialog does. It would be nice if PtFileChooser.showDialog would ask when<br />using JFileChooser.</p>
</blockquote>
<p>I'm a little nervous about modifying PtFileChooser.showDialog() to check<br />to see if the file exists because showDialog() can be called to open<br />a file as well as save a file.</p>
<p>Also, we would need to update the places where we call showDialog() so that<br />they would not then check again to see if we want to overwrite a file.</p>
<p>Note that BasicGraphFrame has convoluted code like:</p>
<p>// The Mac OS X FileDialog will ask if we want to save before this point.<br />if (imageFile.exists() && !PtGUIUtilities.useFileDialog()) {<br /> if (!MessageHandler.yesNoQuestion("Overwrite \"" <br /> + imageFile.getName() + "\"?")) {<br /> return;<br /> }<br />}</p>
<p>Adding new method that did the check could be useful though.<br />Perhaps the method could be called <br />PtFileChooser.showDialog(boolean askAboutOverwrite)<br />or something.</p>
<p>Dan, do you want to give it a shot?</p> Kepler - Bug #4112: make kepler use OSX dialog boxeshttps://projects.ecoinformatics.org/ecoinfo/issues/4112?journal_id=139402013-03-27T21:25:42ZRedmine Admin
<ul></ul><p>Original Bugzilla ID was 4112</p>