[Pixelle-commit] SF.net SVN: pixelle:[243] trunk/pixelle/src/com/mebigfatguy/pixelle/actions /OpenF
Brought to you by:
dbrosius
|
From: <dbr...@us...> - 2009-02-18 06:23:17
|
Revision: 243
http://pixelle.svn.sourceforge.net/pixelle/?rev=243&view=rev
Author: dbrosius
Date: 2009-02-18 06:23:15 +0000 (Wed, 18 Feb 2009)
Log Message:
-----------
Open file should open a new window
Modified Paths:
--------------
trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java
Modified: trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java
===================================================================
--- trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java 2009-02-18 06:19:46 UTC (rev 242)
+++ trunk/pixelle/src/com/mebigfatguy/pixelle/actions/OpenFileAction.java 2009-02-18 06:23:15 UTC (rev 243)
@@ -25,11 +25,15 @@
import javax.imageio.ImageIO;
import javax.swing.AbstractAction;
import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
import javax.swing.KeyStroke;
import javax.swing.filechooser.FileFilter;
+import com.mebigfatguy.pixelle.FrameMgr;
import com.mebigfatguy.pixelle.PixelleBundle;
import com.mebigfatguy.pixelle.PixelleFrame;
+import com.mebigfatguy.pixelle.PixelleTransformException;
+import com.mebigfatguy.pixelle.utils.GuiUtils;
public class OpenFileAction extends AbstractAction {
@@ -71,8 +75,17 @@
jf.showOpenDialog(frame);
File f = jf.getSelectedFile();
if (f != null) {
- frame.openFile(f);
- lastDir = f.getParentFile();
+ try {
+ lastDir = f.getParentFile();
+ PixelleFrame pf = new PixelleFrame();
+ pf.openFile(f);
+ pf.setBounds(GuiUtils.getScreenBounds());
+ pf.setVisible(true);
+ FrameMgr.getInstance().add(pf);
+ } catch (PixelleTransformException pte) {
+ JOptionPane.showMessageDialog(frame, pte.getMessage());
+ pte.printStackTrace();
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|