From: <ha...@us...> - 2013-09-27 04:07:54
|
Revision: 18714 http://sourceforge.net/p/jmol/code/18714 Author: hansonr Date: 2013-09-27 04:07:50 +0000 (Fri, 27 Sep 2013) Log Message: ----------- ___JmolVersion="13.2.6_dev_2013.09.22" bug fix: JSON NIO port SYNC broken Modified Paths: -------------- branches/v13_2/Jmol/src/org/jmol/api/JmolStateCreator.java branches/v13_2/Jmol/src/org/jmol/modelset/ModelSet.java branches/v13_2/Jmol/src/org/jmol/script/ScriptCompiler.java branches/v13_2/Jmol/src/org/jmol/script/ScriptInterruption.java branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties branches/v13_2/Jmol/src/org/jmol/viewer/StateCreator.java branches/v13_2/Jmol/src/org/openscience/jmol/app/jsonkiosk/JsonNioService.java Modified: branches/v13_2/Jmol/src/org/jmol/api/JmolStateCreator.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/api/JmolStateCreator.java 2013-09-26 21:34:00 UTC (rev 18713) +++ branches/v13_2/Jmol/src/org/jmol/api/JmolStateCreator.java 2013-09-27 04:07:50 UTC (rev 18714) @@ -100,7 +100,7 @@ void logToFile(String data); - void quickScript(String script); + void mouseScript(String script); String getAtomDefs(Map<String, Object> names); Modified: branches/v13_2/Jmol/src/org/jmol/modelset/ModelSet.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/modelset/ModelSet.java 2013-09-26 21:34:00 UTC (rev 18713) +++ branches/v13_2/Jmol/src/org/jmol/modelset/ModelSet.java 2013-09-27 04:07:50 UTC (rev 18714) @@ -835,6 +835,8 @@ public void setDihedrals(float[] dihedralList, BS[] bsBranches, float f) { int n = dihedralList.length / 6; + if (f > 1) + f = 1; for (int j = 0, pt = 0; j < n; j++, pt += 6) { BS bs = bsBranches[j]; if (bs == null || bs.isEmpty()) Modified: branches/v13_2/Jmol/src/org/jmol/script/ScriptCompiler.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/script/ScriptCompiler.java 2013-09-26 21:34:00 UTC (rev 18713) +++ branches/v13_2/Jmol/src/org/jmol/script/ScriptCompiler.java 2013-09-27 04:07:50 UTC (rev 18714) @@ -498,12 +498,17 @@ * to be used as input. These lines start with $ and have a [...] phrase * after them. Their presence switches us to this new mode where we use * those statements as our commands and any line WITHOUT those as comments. + * + * adjusted to only do this if $ starts the FIRST line of a script + * and to accept standard $ ... entries clipped from the console Jmol 13.2.6 + * */ - if (ichToken == ichCurrentCommand && ch == '$') { + if (ichToken == ichCurrentCommand && ch == '$' && (isShowScriptOutput || ichToken == 0)) { isShowScriptOutput = true; isShowCommand = true; - while (ch != ']' && !eol(ch = charAt(ichT))) - ++ichT; + if (charAt(++ichT) == '[') + while (ch != ']' && !eol(ch = charAt(ichT))) + ++ichT; cchToken = ichT - ichToken; return CONTINUE; } else if (isShowScriptOutput && !isShowCommand) { Modified: branches/v13_2/Jmol/src/org/jmol/script/ScriptInterruption.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/script/ScriptInterruption.java 2013-09-26 21:34:00 UTC (rev 18713) +++ branches/v13_2/Jmol/src/org/jmol/script/ScriptInterruption.java 2013-09-27 04:07:50 UTC (rev 18714) @@ -25,9 +25,9 @@ package org.jmol.script; -class ScriptInterruption extends ScriptException { +public class ScriptInterruption extends ScriptException { boolean willResume; - ScriptInterruption(ScriptEvaluator eval, String why, int millis) { + public ScriptInterruption(ScriptEvaluator eval, String why, int millis) { super(eval, why, "!", eval.viewer.autoExit); willResume = (millis != Integer.MAX_VALUE); // the delay execution is here just to ensure that even a delay of 0 Modified: branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties 2013-09-26 21:34:00 UTC (rev 18713) +++ branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties 2013-09-27 04:07:50 UTC (rev 18714) @@ -13,6 +13,7 @@ ___JmolVersion="13.2.6_dev_2013.09.22" +bug fix: JSON NIO port SYNC broken bug fix: write IMAGE "t.png" not working bug fix: rotate -10 -10 not working Modified: branches/v13_2/Jmol/src/org/jmol/viewer/StateCreator.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/viewer/StateCreator.java 2013-09-26 21:34:00 UTC (rev 18713) +++ branches/v13_2/Jmol/src/org/jmol/viewer/StateCreator.java 2013-09-27 04:07:50 UTC (rev 18714) @@ -2187,51 +2187,70 @@ viewer.evalStringQuietSync(script, true, false); return; } - quickScript(script); + mouseScript(script); if (disableSend) viewer.setSyncDriver(StatusManager.SYNC_ENABLE); } - public void quickScript(String script) { + public void mouseScript(String script) { String[] tokens = Parser.getTokens(script); String key = tokens[1]; - switch (tokens.length) { - case 3: - if (key.equals("zoomByFactor")) - viewer.zoomByFactor(Parser.parseFloatStr(tokens[2]), Integer.MAX_VALUE, - Integer.MAX_VALUE); - else if (key.equals("zoomBy")) - viewer.zoomBy(Parser.parseInt(tokens[2])); - else if (key.equals("rotateZBy")) - viewer.rotateZBy(Parser.parseInt(tokens[2]), Integer.MAX_VALUE, - Integer.MAX_VALUE); - break; - case 4: - if (key.equals("rotateXYBy")) + try { + key = (key.toLowerCase() + "...............").substring(0, 15); + switch (("zoombyfactor..." + "zoomby........." + "rotatezby......" + + "rotatexyby....." + "translatexyby.." + "rotatemolecule." + + "spinxyby......." + "rotatearcball..").indexOf(key)) { + case 0: //zoombyfactor + switch (tokens.length) { + case 3: + viewer.zoomByFactor(Parser.parseFloatStr(tokens[2]), + Integer.MAX_VALUE, Integer.MAX_VALUE); + return; + case 5: + viewer.zoomByFactor(Parser.parseFloatStr(tokens[2]), Parser + .parseInt(tokens[3]), Parser.parseInt(tokens[4])); + return; + } + break; + case 15: //zoomby + switch (tokens.length) { + case 3: + viewer.zoomBy(Parser.parseInt(tokens[2])); + return; + } + break; + case 30: // rotatezby + switch (tokens.length) { + case 3: + viewer.rotateZBy(Parser.parseInt(tokens[2]), Integer.MAX_VALUE, + Integer.MAX_VALUE); + return; + case 5: + viewer.rotateZBy(Parser.parseInt(tokens[2]), Parser + .parseInt(tokens[3]), Parser.parseInt(tokens[4])); + } + break; + case 45: // rotatexyby viewer.rotateXYBy(Parser.parseFloatStr(tokens[2]), Parser .parseFloatStr(tokens[3])); - else if (key.equals("translateXYBy")) + return; + case 60: // translatexyby viewer.translateXYBy(Parser.parseInt(tokens[2]), Parser .parseInt(tokens[3])); - else if (key.equals("rotateMolecule")) - viewer.rotateSelected(Parser.parseFloatStr(tokens[2]), Parser - .parseFloatStr(tokens[3]), null); - break; - case 5: - if (key.equals("spinXYBy")) + return; + case 75:// spinxyby viewer.spinXYBy(Parser.parseInt(tokens[2]), Parser.parseInt(tokens[3]), Parser.parseFloatStr(tokens[4])); - else if (key.equals("zoomByFactor")) - viewer.zoomByFactor(Parser.parseFloatStr(tokens[2]), Parser - .parseInt(tokens[3]), Parser.parseInt(tokens[4])); - else if (key.equals("rotateZBy")) - viewer.rotateZBy(Parser.parseInt(tokens[2]), - Parser.parseInt(tokens[3]), Parser.parseInt(tokens[4])); - else if (key.equals("rotateArcBall")) + return; + case 90: // rotatearcball viewer.rotateArcBall(Parser.parseInt(tokens[2]), Parser .parseInt(tokens[3]), Parser.parseFloatStr(tokens[4])); - break; + return; + } + } catch (Exception e) { + // } + viewer.showString("error reading SYNC command: " + script, false); } public String generateOutputForExport(String type, String[] fileName, Modified: branches/v13_2/Jmol/src/org/openscience/jmol/app/jsonkiosk/JsonNioService.java =================================================================== --- branches/v13_2/Jmol/src/org/openscience/jmol/app/jsonkiosk/JsonNioService.java 2013-09-26 21:34:00 UTC (rev 18713) +++ branches/v13_2/Jmol/src/org/openscience/jmol/app/jsonkiosk/JsonNioService.java 2013-09-27 04:07:50 UTC (rev 18714) @@ -220,7 +220,7 @@ startService(port, client, jmolViewer, myName, 1); } if (msg.startsWith("Mouse:")) - msg = "{\"type\":\"move\",\"style\":\"sync\", \"sync\":\"" + msg = "{\"type\":\"sync\", \"sync\":\"" + msg.substring(6) + "\"}"; sendMessage(null, msg, null); } catch (IOException e) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ha...@us...> - 2013-10-01 15:47:59
|
Revision: 18756 http://sourceforge.net/p/jmol/code/18756 Author: hansonr Date: 2013-10-01 15:47:54 +0000 (Tue, 01 Oct 2013) Log Message: ----------- ___JmolVersion="13.2.7" JmolVersion="13.2.7_dev_2013.10.01" bug fix: translations incomplete Modified Paths: -------------- branches/v13_2/Jmol/src/org/jmol/i18n/GT.java branches/v13_2/Jmol/src/org/jmol/i18n/Resource.java branches/v13_2/Jmol/src/org/jmol/io2/ZipUtil.java branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties branches/v13_2/Jmol/src/org/openscience/jmol/app/jmolpanel/GuiMap.java Modified: branches/v13_2/Jmol/src/org/jmol/i18n/GT.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/i18n/GT.java 2013-10-01 15:46:31 UTC (rev 18755) +++ branches/v13_2/Jmol/src/org/jmol/i18n/GT.java 2013-10-01 15:47:54 UTC (rev 18756) @@ -275,14 +275,14 @@ if (doTranslate) { for (int bundle = resourceCount; --bundle >= 0;) { trans = resources[bundle].getString(string); - break; + if (trans != null) { + string = trans; + break; + } } - if (trans == null) { - if (resourceCount > 0 && allowDebug && Logger.debugging) - Logger.debug("No trans, using default: " + string); - } else { - string = trans; - } + if (resourceCount > 0 && trans == null && allowDebug && Logger.debugging) + Logger.debug("No trans, using default: " + string); + } if (trans == null) { if (string.startsWith("[")) Modified: branches/v13_2/Jmol/src/org/jmol/i18n/Resource.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/i18n/Resource.java 2013-10-01 15:46:31 UTC (rev 18755) +++ branches/v13_2/Jmol/src/org/jmol/i18n/Resource.java 2013-10-01 15:47:54 UTC (rev 18756) @@ -12,9 +12,11 @@ class Resource { private Object resource; + String className; - private Resource(Object resource) { + private Resource(Object resource, String className) { this.resource = resource; + this.className = className; } @SuppressWarnings("null") @@ -43,7 +45,7 @@ try { return (bundleClass == null || !ResourceBundle.class.isAssignableFrom(bundleClass) ? null - : new Resource(bundleClass.newInstance())); + : new Resource(bundleClass.newInstance(), className)); } catch (IllegalAccessException e) { Logger.warn("Illegal Access Exception: " + e.toString()); } catch (InstantiationException e) { @@ -138,37 +140,6 @@ { return null; } -// if (bytes == null || bytes.length == 0) -// return null; -// Hashtable<String, String> map = null; -// try { -// String[] lines = TextFormat.split(new String(bytes, "UTF-8"), '\n'); -// map = new Hashtable<String, String>(); -// int mode = 0; -// String msgstr = ""; -// String msgid = ""; -// for (int i = 0; i < lines.length; i++) { -// String line = lines[i]; -// if (line.length() <= 2) { -// if (mode == 2 && msgstr.length() != 0 && msgid.length() != 0) -// map.put(msgid, msgstr); -// } else if (line.indexOf("msgid") == 0) { -// mode = 1; -// msgid = fix(line); -// } else if (line.indexOf("msgstr") == 0) { -// mode = 2; -// msgstr = fix(line); -// } else if (mode == 1) { -// msgid += fix(line); -// } else if (mode == 2) { -// msgstr += fix(line); -// } -// } -// -// } catch (UnsupportedEncodingException e) { -// //ignore -// } -// return (map == null || map.size() == 0 ? null : new Resource(map)); } static String fix(String line) { Modified: branches/v13_2/Jmol/src/org/jmol/io2/ZipUtil.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/io2/ZipUtil.java 2013-10-01 15:46:31 UTC (rev 18755) +++ branches/v13_2/Jmol/src/org/jmol/io2/ZipUtil.java 2013-10-01 15:47:54 UTC (rev 18756) @@ -412,9 +412,18 @@ ByteArrayOutputStream bos = (outFileName == null || outFileName.startsWith("http://") ? new ByteArrayOutputStream() : null); - ZipOutputStream os = new ZipOutputStream( - bos == null ? (OutputStream) viewer.openOutputChannel(privateKey, - outFileName, false) : bos); + OutputStream os1 = (bos == null ? (OutputStream) viewer.openOutputChannel(privateKey, + outFileName, false) : bos); + ZipOutputStream os; + /** + * @j2sNative + * + * os = J.api.Interface.getInterface("java.util.zip.ZipOutputStream").setZOS(os1); + * + */ + { + os = new ZipOutputStream(os1); + } for (int i = 0; i < fileNamesAndByteArrays.size(); i += 3) { String fname = (String) fileNamesAndByteArrays.get(i); byte[] bytes = null; @@ -465,7 +474,8 @@ os.close(); Logger.info(nBytesOut + " bytes prior to compression"); if (bos == null) { - fullFilePath = viewer.getAbsolutePath(privateKey, outFileName).replace('\\', '/'); + fullFilePath = viewer.getAbsolutePath(privateKey, outFileName).replace( + '\\', '/'); nBytes = viewer.getFileLength(privateKey, outFileName); } else { byte[] bytes = bos.toByteArray(); Modified: branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties 2013-10-01 15:46:31 UTC (rev 18755) +++ branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties 2013-10-01 15:47:54 UTC (rev 18756) @@ -11,8 +11,11 @@ # The quotes above look odd for a parameter file, but they are # important for the JavaScript version of Jmol. -___JmolVersion="13.2.7_dev_2013.09.30" +___JmolVersion="13.2.7" +JmolVersion="13.2.7_dev_2013.10.01" + +bug fix: translations incomplete bug fix: state saving of echo "bottom left" instead does "top left" bug fix: multiple-file crystal structures may fail to load if there is a lattice shift bug fix: space group not being calculated automatically for user-defined space groups Modified: branches/v13_2/Jmol/src/org/openscience/jmol/app/jmolpanel/GuiMap.java =================================================================== --- branches/v13_2/Jmol/src/org/openscience/jmol/app/jmolpanel/GuiMap.java 2013-10-01 15:46:31 UTC (rev 18755) +++ branches/v13_2/Jmol/src/org/openscience/jmol/app/jmolpanel/GuiMap.java 2013-10-01 15:47:54 UTC (rev 18756) @@ -41,6 +41,7 @@ import javax.swing.JCheckBox; import org.jmol.console.GenericConsole; +import org.jmol.console.JmolButton; import org.jmol.console.KeyJMenu; import org.jmol.console.KeyJMenuItem; import org.jmol.console.KeyJCheckBox; @@ -256,7 +257,7 @@ return new KeyJCheckBox(key, getLabel(key), map, isChecked); } JButton newJButton(String key) { - JButton jb = new JButton(getLabel(key)); + JButton jb = new JmolButton(getLabel(key)); map.put(key, jb); return jb; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ha...@us...> - 2013-10-31 21:49:44
|
Revision: 18886 http://sourceforge.net/p/jmol/code/18886 Author: hansonr Date: 2013-10-31 21:49:40 +0000 (Thu, 31 Oct 2013) Log Message: ----------- ___JmolVersion="13.2.8_dev_2013.10.31" bug fix: following Java update, adding proper path check for local signed applet Modified Paths: -------------- branches/v13_2/Jmol/src/org/jmol/api/JmolMouseInterface.java branches/v13_2/Jmol/src/org/jmol/api/JmolStateCreator.java branches/v13_2/Jmol/src/org/jmol/api/JmolViewer.java branches/v13_2/Jmol/src/org/jmol/applet/Jmol.java branches/v13_2/Jmol/src/org/jmol/appletjs/Jmol.java branches/v13_2/Jmol/src/org/jmol/awt/Mouse.java branches/v13_2/Jmol/src/org/jmol/export/JmolFileDropper.java branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties branches/v13_2/Jmol/src/org/jmol/viewer/StateCreator.java branches/v13_2/Jmol/src/org/jmol/viewer/Viewer.java branches/v13_2/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java Added Paths: ----------- branches/v13_2/Jmol/src/org/jmol/api/JSmolInterface.java Added: branches/v13_2/Jmol/src/org/jmol/api/JSmolInterface.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/api/JSmolInterface.java (rev 0) +++ branches/v13_2/Jmol/src/org/jmol/api/JSmolInterface.java 2013-10-31 21:49:40 UTC (rev 18886) @@ -0,0 +1,25 @@ +package org.jmol.api; + +public interface JSmolInterface { + + int cacheFileByName(String fileName, boolean isAdd); + + void cachePut(String key, Object data); + + Object getApplet(); + + boolean processMouseEvent(int id, int x, int y, int modifiers, long time); + + void openFileAsyncSpecial(String fileName, int flags); + + void processTwoPointGesture(float[][][] touches); + + void setScreenDimension(int width, int height); + + void startHoverWatcher(boolean enable); + + void updateJS(int width, int height); + + +} + Modified: branches/v13_2/Jmol/src/org/jmol/api/JmolMouseInterface.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/api/JmolMouseInterface.java 2013-10-31 21:47:57 UTC (rev 18885) +++ branches/v13_2/Jmol/src/org/jmol/api/JmolMouseInterface.java 2013-10-31 21:49:40 UTC (rev 18886) @@ -7,5 +7,8 @@ void clear(); void dispose(); + + void processTwoPointGesture(float[][][] touches); + } Modified: branches/v13_2/Jmol/src/org/jmol/api/JmolStateCreator.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/api/JmolStateCreator.java 2013-10-31 21:47:57 UTC (rev 18885) +++ branches/v13_2/Jmol/src/org/jmol/api/JmolStateCreator.java 2013-10-31 21:49:40 UTC (rev 18886) @@ -94,7 +94,7 @@ OutputStream getOutputStream(String localName, String[] fullPath); - void openFileAsync(String fileName, boolean pdbCartoons); + void openFileAsync(String fileName, int flags); void showEditor(String[] file_text); Modified: branches/v13_2/Jmol/src/org/jmol/api/JmolViewer.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/api/JmolViewer.java 2013-10-31 21:47:57 UTC (rev 18885) +++ branches/v13_2/Jmol/src/org/jmol/api/JmolViewer.java 2013-10-31 21:49:40 UTC (rev 18886) @@ -49,7 +49,7 @@ * **/ -abstract public class JmolViewer { +abstract public class JmolViewer implements JSmolInterface { // several; methods were deprecated and removed in 13.1.15. All are accessible via "getXxxx" methods: @@ -511,9 +511,9 @@ abstract public JmolAdapter getModelAdapter(); - abstract public void openFileAsyncPDB(String fileName, boolean pdbCartoons); + abstract public void openFileAsyncSpecial(String fileName, int flags); public void openFileAsync(String fileName) { - openFileAsyncPDB(fileName, false); + openFileAsyncSpecial(fileName, 0); } abstract public Object getFileAsBytes(String fullPathName, OutputStringBuilder osb); @@ -534,12 +534,12 @@ abstract public void processMultitouchEvent(int groupID, int eventType, int touchID, int iData, P3 pt, long time); - abstract public boolean handleOldJvm10Event(int id, int x, int y, int modifiers, + abstract public boolean processMouseEvent(int id, int x, int y, int modifiers, long when); public void mouseEvent(int id, int x, int y, int modifiers, long when) { - handleOldJvm10Event(id, x, y, modifiers, when); + processMouseEvent(id, x, y, modifiers, when); } public ApiPlatform apiPlatform; // used in Viewer and JmolViewer Modified: branches/v13_2/Jmol/src/org/jmol/applet/Jmol.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/applet/Jmol.java 2013-10-31 21:47:57 UTC (rev 18885) +++ branches/v13_2/Jmol/src/org/jmol/applet/Jmol.java 2013-10-31 21:49:40 UTC (rev 18886) @@ -267,29 +267,31 @@ } private void initWindows() { - String options = "-applet"; + Map<String, Object> info = new Hashtable<String, Object>(); + addValue(info, null, "applet", Boolean.TRUE); isSigned = getBooleanValue("signed", false) || appletWrapper.isSigned(); if (isSigned) - options += "-signed"; + addValue(info, null, "signedApplet", Boolean.TRUE); if (getBooleanValue("useCommandThread", isSigned)) - options += "-threaded"; + addValue(info, null, "useCommandThread", Boolean.TRUE); + String options = ""; if (isSigned && getBooleanValue("multiTouchSparshUI-simulated", false)) options += "-multitouch-sparshui-simulated"; else if (isSigned && getBooleanValue("multiTouchSparshUI", false)) // true for testing JmolAppletSignedMT.jar options += "-multitouch-sparshui"; - String s = getValue("MaximumSize", null); - if (s != null) - options += "-maximumSize " + s; - // note, -appletProxy must be the LAST item added - s = getValue("JmolAppletProxy", null); - if (s != null) - options += "-appletProxy " + s; + addValue(info, null, "options", options); + addValue(info, null, "display", appletWrapper); + addValue(info, null, "statusListener", new MyStatusListener()); + addValue(info, null, "fullName", fullName); + addValue(info, null, "documentBase", appletWrapper.getDocumentBase()); + addValue(info, null, "codeBase", appletWrapper.getCodeBase()); if (getBooleanValue("noScripting", false)) - options += "-noScripting "; - - viewer = JmolViewer.allocateViewer(appletWrapper, null, fullName, - appletWrapper.getDocumentBase(), appletWrapper.getCodeBase(), options, - new MyStatusListener()); + addValue(info, null, "noScripting", Boolean.TRUE); + + addValue(info, "MaximumSize", "maximumSize", null); + addValue(info, "JmolAppletProxy", "appletProxy", null); + addValue(info, "documentLocation", null, null); + viewer = new Viewer(info); String menuFile = getParameter("menuFile"); if (menuFile != null) viewer.getProperty("DATA_API", "setMenu", viewer @@ -338,6 +340,14 @@ } } + private void addValue(Map<String, Object> info, String key, String putKey, + Object value) { + if (key != null) + value = getValue(key, null); + if (value != null) + info.put(putKey == null ? key : putKey, value); + } + private void initApplication() { viewer.pushHoldRepaint(); { @@ -597,7 +607,7 @@ public boolean handleEvent(Event e) { if (viewer == null) return false; - return viewer.handleOldJvm10Event(e.id, e.x, e.y, e.modifiers, e.when); + return viewer.processMouseEvent(e.id, e.x, e.y, e.modifiers, e.when); } // code to record last and average times Modified: branches/v13_2/Jmol/src/org/jmol/appletjs/Jmol.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/appletjs/Jmol.java 2013-10-31 21:47:57 UTC (rev 18885) +++ branches/v13_2/Jmol/src/org/jmol/appletjs/Jmol.java 2013-10-31 21:49:40 UTC (rev 18886) @@ -291,7 +291,7 @@ public boolean handleEvent(Event e) { if (viewer == null) return false; - return viewer.handleOldJvm10Event(e.id, e.x, e.y, e.modifiers, e.when); + return viewer.processMouseEvent(e.id, e.x, e.y, e.modifiers, e.when); } private String scriptProcessor(String script, String statusParams, Modified: branches/v13_2/Jmol/src/org/jmol/awt/Mouse.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/awt/Mouse.java 2013-10-31 21:47:57 UTC (rev 18885) +++ branches/v13_2/Jmol/src/org/jmol/awt/Mouse.java 2013-10-31 21:49:40 UTC (rev 18886) @@ -359,6 +359,10 @@ return ((modifiers & Binding.BUTTON_MASK) == 0) ? (modifiers | Binding.LEFT) : modifiers; } + + public void processTwoPointGesture(float[][][] touches) { + // n/a JavaScript only + } private int xWhenPressed, yWhenPressed, modifiersWhenPressed10; Modified: branches/v13_2/Jmol/src/org/jmol/export/JmolFileDropper.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/export/JmolFileDropper.java 2013-10-31 21:47:57 UTC (rev 18885) +++ branches/v13_2/Jmol/src/org/jmol/export/JmolFileDropper.java 2013-10-31 21:49:40 UTC (rev 18886) @@ -99,7 +99,7 @@ // ignore } } - viewer.openFileAsyncPDB(fname, true); + viewer.openFileAsyncSpecial(fname, 1); } private void loadFiles(List<File> fileList) { Modified: branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties 2013-10-31 21:47:57 UTC (rev 18885) +++ branches/v13_2/Jmol/src/org/jmol/viewer/Jmol.properties 2013-10-31 21:49:40 UTC (rev 18886) @@ -9,8 +9,9 @@ # The quotes above look odd for a parameter file, but they are # important for the JavaScript version of Jmol. -___JmolVersion="13.2.8_dev_2013.10.29" +___JmolVersion="13.2.8_dev_2013.10.31" +bug fix: following Java update, adding proper path check for local signed applet bug fix: {xxx}.property_xx not saved in state (broken 8/7/2013 rev 18518) bug fix: write <type> <filename> fails bug fix: applet scriptWait() method broken Modified: branches/v13_2/Jmol/src/org/jmol/viewer/StateCreator.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/viewer/StateCreator.java 2013-10-31 21:47:57 UTC (rev 18885) +++ branches/v13_2/Jmol/src/org/jmol/viewer/StateCreator.java 2013-10-31 21:49:40 UTC (rev 18886) @@ -2416,7 +2416,8 @@ } } - public void openFileAsync(String fileName, boolean pdbCartoons) { + public void openFileAsync(String fileName, int flags) { + boolean pdbCartoons = (flags == 1); fileName = fileName.trim(); boolean allowScript = (!fileName.startsWith("\t")); if (!allowScript) Modified: branches/v13_2/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- branches/v13_2/Jmol/src/org/jmol/viewer/Viewer.java 2013-10-31 21:47:57 UTC (rev 18885) +++ branches/v13_2/Jmol/src/org/jmol/viewer/Viewer.java 2013-10-31 21:49:40 UTC (rev 18886) @@ -236,6 +236,10 @@ GData gdata; Object applet; // j2s only + + public Object getApplet() { + return applet; + } ActionManager actionManager; AnimationManager animationManager; @@ -524,6 +528,13 @@ setJmolStatusListener(statusListener); if (isApplet) { Logger.info("viewerOptions: \n" + Escape.escapeMap(viewerOptions)); + // Java only, because Signed applet can't find correct path when local. + String path = (String) viewerOptions.get("documentLocation"); + if (!isJS && path != null && path.startsWith("file:/")) { + path = path.substring(0, path.substring(0, (path + "?").indexOf("?")).lastIndexOf("/")); + Logger.info("setting current directory to " + path); + cd(path); + } jsDocumentBase = appletDocumentBase; i = jsDocumentBase.indexOf("#"); if (i >= 0) @@ -683,7 +694,7 @@ } @Override - public boolean handleOldJvm10Event(int id, int x, int y, int modifiers, + public boolean processMouseEvent(int id, int x, int y, int modifiers, long time) { // also used for JavaScript from jQuery return mouse.handleOldJvm10Event(id, x, y, modifiers, time); @@ -1980,8 +1991,8 @@ * */ @Override - public void openFileAsyncPDB(String fileName, boolean pdbCartoons) { - getStateCreator().openFileAsync(fileName, pdbCartoons); + public void openFileAsyncSpecial(String fileName, int flags) { + getStateCreator().openFileAsync(fileName, flags); } /** @@ -10405,4 +10416,9 @@ return getStateCreator().getLogFileName(); } + public void processTwoPointGesture(float[][][] touches) { + mouse.processTwoPointGesture(touches); + } + + } Modified: branches/v13_2/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java =================================================================== --- branches/v13_2/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java 2013-10-31 21:47:57 UTC (rev 18885) +++ branches/v13_2/Jmol/src/org/openscience/jmol/app/jmolpanel/JmolPanel.java 2013-10-31 21:49:40 UTC (rev 18886) @@ -1308,9 +1308,9 @@ if (selection == null || selection.length() == 0) return; if (selection.endsWith(" (*)")) - viewer.openFileAsyncPDB(selection.substring(0, selection.length() - 4), true); + viewer.openFileAsyncSpecial(selection.substring(0, selection.length() - 4), 1); else - viewer.openFileAsyncPDB(selection, false); + viewer.openFileAsyncSpecial(selection, 0); } } @@ -1480,7 +1480,7 @@ if (fileName.startsWith("load append")) viewer.scriptWait(fileName); else - viewer.openFileAsyncPDB(fileName, pdbCartoons); + viewer.openFileAsyncSpecial(fileName, pdbCartoons ? 1 : 0); } static final String chemFileProperty = "chemFile"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |