From: <ha...@us...> - 2010-04-29 02:04:40
|
Revision: 12969 http://jmol.svn.sourceforge.net/jmol/?rev=12969&view=rev Author: hansonr Date: 2010-04-29 02:04:34 +0000 (Thu, 29 Apr 2010) Log Message: ----------- version=11.8.24_dev # bug fix: fix for write POVRAY "xxx" not writing file for signed applet Modified Paths: -------------- branches/v11_8/Jmol/src/org/jmol/viewer/FileManager.java branches/v11_8/Jmol/src/org/jmol/viewer/Jmol.properties branches/v11_8/Jmol/src/org/jmol/viewer/RepaintManager.java branches/v11_8/Jmol/src/org/jmol/viewer/Viewer.java Modified: branches/v11_8/Jmol/src/org/jmol/viewer/FileManager.java =================================================================== --- branches/v11_8/Jmol/src/org/jmol/viewer/FileManager.java 2010-04-28 21:57:41 UTC (rev 12968) +++ branches/v11_8/Jmol/src/org/jmol/viewer/FileManager.java 2010-04-29 02:04:34 UTC (rev 12969) @@ -780,7 +780,7 @@ if (localDir.length() == 0) return (viewer.isApplet() ? null : new File(System.getProperty("user.dir"))); if (viewer.isApplet() && localDir.indexOf("file:/") == 0) - localDir =setLocalPathForWritingFile(viewer, localDir); + localDir =getLocalPathForWritingFile(viewer, localDir); File f = new File(localDir); return f.isDirectory() ? f : f.getParentFile(); @@ -795,7 +795,7 @@ viewer.setStringProperty("defaultDirectoryLocal", path); } - public static String setLocalPathForWritingFile(JmolViewer viewer, String file) { + public static String getLocalPathForWritingFile(JmolViewer viewer, String file) { if (file.indexOf("file:/") == 0) return file.substring(6); if (file.indexOf("/") == 0 || file.indexOf(":") >= 0) Modified: branches/v11_8/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v11_8/Jmol/src/org/jmol/viewer/Jmol.properties 2010-04-28 21:57:41 UTC (rev 12968) +++ branches/v11_8/Jmol/src/org/jmol/viewer/Jmol.properties 2010-04-29 02:04:34 UTC (rev 12969) @@ -4,6 +4,7 @@ version=11.8.24_dev +# bug fix: fix for write POVRAY "xxx" not writing file for signed applet # bug fix: CSF reader upgrade # bug fix: writing MOL files with aromatic bonds fails # bug fix: It is possible for PDB files (1tmv) to include non-crystallographic Modified: branches/v11_8/Jmol/src/org/jmol/viewer/RepaintManager.java =================================================================== --- branches/v11_8/Jmol/src/org/jmol/viewer/RepaintManager.java 2010-04-28 21:57:41 UTC (rev 12968) +++ branches/v11_8/Jmol/src/org/jmol/viewer/RepaintManager.java 2010-04-29 02:04:34 UTC (rev 12969) @@ -174,8 +174,6 @@ String generateOutput(String type, Graphics3D g3d, ModelSet modelSet, String fileName) { - viewer.finalizeTransformParameters(); - JmolRendererInterface g3dExport = null; Object output = null; boolean isOK = false; Modified: branches/v11_8/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- branches/v11_8/Jmol/src/org/jmol/viewer/Viewer.java 2010-04-28 21:57:41 UTC (rev 12968) +++ branches/v11_8/Jmol/src/org/jmol/viewer/Viewer.java 2010-04-29 02:04:34 UTC (rev 12969) @@ -3428,12 +3428,14 @@ int height) { if (isDataOnly) return ""; + fileName = getFileNameFromDialog(fileName, Integer.MIN_VALUE); mustRender = true; saveState("_Export"); int saveWidth = dimScreen.width; int saveHeight = dimScreen.height; resizeImage(width, height, true, true, false); setModelVisibility(); + finalizeTransformParameters(); String data = repaintManager.generateOutput(type, g3d, modelSet, fileName); // mth 2003-01-09 Linux Sun JVM 1.4.2_02 // Sun is throwing a NullPointerExceptions inside graphics routines @@ -7372,7 +7374,7 @@ boolean forceDialog = (fileName.indexOf("?") == 0); if (forceDialog) fileName = fileName.substring(1); - fileName = FileManager.setLocalPathForWritingFile(this, fileName); + fileName = FileManager.getLocalPathForWritingFile(this, fileName); String[] aFileName = new String[] { (forceDialog || isApplet && useDialog ? "?" : "") + fileName }; err = statusManager @@ -7399,6 +7401,18 @@ } + private String getFileNameFromDialog(String fileName, int quality) { + boolean useDialog = (fileName.indexOf("?") == 0); + if (useDialog) + fileName = fileName.substring(1); + useDialog |= isApplet; + fileName = FileManager.getLocalPathForWritingFile(this, fileName); + if (useDialog) + fileName = dialogAsk(quality == Integer.MIN_VALUE ? "save" + : "saveImage", fileName); + return fileName; + } + private void setImageFontScaling(int width, int height) { float screenDimNew = (global.zoomLarge == (height > width) ? height : width); imageFontScaling = screenDimNew / getScreenDim(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |