From: <ha...@us...> - 2010-06-19 16:48:23
|
Revision: 13435 http://jmol.svn.sourceforge.net/jmol/?rev=13435&view=rev Author: hansonr Date: 2010-06-19 16:48:17 +0000 (Sat, 19 Jun 2010) Log Message: ----------- Modified Paths: -------------- trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2010-06-19 16:45:49 UTC (rev 13434) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2010-06-19 16:48:17 UTC (rev 13435) @@ -95,6 +95,7 @@ import javax.vecmath.AxisAngle4f; import java.net.URL; +import java.net.URLEncoder; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.BufferedReader; @@ -105,6 +106,7 @@ import java.io.OutputStream; import java.io.Reader; import java.io.StringReader; +import java.io.UnsupportedEncodingException; /* * @@ -4185,23 +4187,24 @@ public Object setLoadFormat(String name, char type, boolean withPrefix) { String f = name.substring(1); - switch(type) { + switch (type) { case '=': return TextFormat.formatString(global.loadFormat, "FILE", f); case '$': - /* + try { - f = URLEncoder.encode(f, "US-ASCII"); - f = TextFormat.simpleReplace(f, "%2F", "/"); - } catch (UnsupportedEncodingException e) { - // - } - */ - return (withPrefix ? "MOL::" : "") - + TextFormat.formatString(global.smilesUrlFormat, "FILE", f); + f = URLEncoder.encode(f, "US-ASCII"); + f = TextFormat.simpleReplace(f, "%2F", "/"); + } catch (UnsupportedEncodingException e) { + // + } + + return (withPrefix ? "MOL::" : "") + + TextFormat.formatString(global.smilesUrlFormat, "FILE", f); case '_': // isosurface "=...", but we code that type as '-' String server = FileManager.fixFileNameVariables(global.edsUrlFormat, f); - String strCutoff = FileManager.fixFileNameVariables(global.edsUrlCutoff, f); + String strCutoff = FileManager.fixFileNameVariables(global.edsUrlCutoff, + f); return new String[] { server, strCutoff }; } return name.substring(1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |