Revision: 20129 http://sourceforge.net/p/jmol/code/20129 Author: hansonr Date: 2014-11-25 17:41:59 +0000 (Tue, 25 Nov 2014) Log Message: ----------- Jmol.___JmolVersion="14.3.9_2014.11.26"
bug fix: hover OFF disables hover callback, but should not new feature: VASP CHGCAR default cutoff set to 0.5 Modified Paths: -------------- trunk/Jmol/src/org/jmol/jvxl/readers/VaspChgcarReader.java trunk/Jmol/src/org/jmol/viewer/Jmol.properties trunk/Jmol/src/org/jmol/viewer/StatusManager.java trunk/Jmol/src/org/jmol/viewer/Viewer.java Modified: trunk/Jmol/src/org/jmol/jvxl/readers/VaspChgcarReader.java =================================================================== --- trunk/Jmol/src/org/jmol/jvxl/readers/VaspChgcarReader.java 2014-11-25 14:49:11 UTC (rev 20128) +++ trunk/Jmol/src/org/jmol/jvxl/readers/VaspChgcarReader.java 2014-11-25 17:41:59 UTC (rev 20129) @@ -25,6 +25,7 @@ import java.io.BufferedReader; +import org.jmol.util.Logger; import org.jmol.util.SimpleUnitCell; import javajs.util.SB; @@ -94,6 +95,10 @@ } swapXZ(); volumetricOrigin.set(0, 0, 0); + if (params.thePlane == null && (params.cutoffAutomatic || !Float.isNaN(params.sigma))) { + params.cutoff = 0.5f; + Logger.info("Cutoff set to " + params.cutoff); + } } private int pt; Modified: trunk/Jmol/src/org/jmol/viewer/Jmol.properties =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2014-11-25 14:49:11 UTC (rev 20128) +++ trunk/Jmol/src/org/jmol/viewer/Jmol.properties 2014-11-25 17:41:59 UTC (rev 20129) @@ -15,8 +15,14 @@ TODO: design and implement sidechain mutation -- MUTATE command ? TODO: remove HTML5 dependency on synchronous file loading (check SCRIPT command for problems) -Jmol.___JmolVersion="14.3.9_2014.11.25" +Jmol.___JmolVersion="14.3.9_2014.11.26" +bug fix: hover OFF disables hover callback, but should not + +new feature: VASP CHGCAR default cutoff set to 0.5 + +JmolVersion="14.3.9_2014.11.25" + bug fix: reading of JVXL file saved with noFill still does fill bug fix: CASTEP DENSITY surface file reader does not do downsampling Modified: trunk/Jmol/src/org/jmol/viewer/StatusManager.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/StatusManager.java 2014-11-25 14:49:11 UTC (rev 20128) +++ trunk/Jmol/src/org/jmol/viewer/StatusManager.java 2014-11-25 17:41:59 UTC (rev 20129) @@ -344,6 +344,10 @@ new Object[] { sJmol, Integer.valueOf(width), Integer.valueOf(height) }); } + boolean haveHoverCallback() { + return (jmolScriptCallbacks.containsKey(CBK.HOVER) || notifyEnabled(CBK.HOVER)); + } + synchronized void setStatusAtomHovered(int iatom, String strInfo) { String sJmol = jmolScriptCallback(CBK.HOVER); if (notifyEnabled(CBK.HOVER)) Modified: trunk/Jmol/src/org/jmol/viewer/Viewer.java =================================================================== --- trunk/Jmol/src/org/jmol/viewer/Viewer.java 2014-11-25 14:49:11 UTC (rev 20128) +++ trunk/Jmol/src/org/jmol/viewer/Viewer.java 2014-11-25 17:41:59 UTC (rev 20129) @@ -4368,12 +4368,28 @@ shm.loadShape(JC.SHAPE_HOVER); setShapeProperty(JC.SHAPE_HOVER, "label", strLabel); hoverEnabled = (strLabel != null); - if (!hoverEnabled) + if (!hoverEnabled && !sm.haveHoverCallback()) startHoverWatcher(false); } + /* + * hoverCallback reports information about the atom being hovered over. + * + * jmolSetCallback("hoverCallback", "myHoverCallback") function + * myHoverCallback(strInfo, iAtom) {} + * + * strInfo == the atom's identity, including x, y, and z coordinates iAtom == + * the index of the atom being hovered over + * + * Viewer.setStatusAtomHovered Hover.setProperty("target") Viewer.hoverOff + * Viewer.hoverOn + */ void hoverOn(int atomIndex, boolean isLabel) { - setStatusAtomHovered(atomIndex, getAtomInfoXYZ(atomIndex, false)); + g.removeParam("_objecthovered"); + g.setI("_atomhovered", atomIndex); + g.setUserVariable("hovered", SV.getVariable(BSUtil.newAndSetBit(atomIndex))); + if (sm.haveHoverCallback()) + sm.setStatusAtomHovered(atomIndex, getAtomInfoXYZ(atomIndex, false)); if (!hoverEnabled) return; if (g.modelKitMode) { @@ -4402,11 +4418,18 @@ } public void hoverOnPt(int x, int y, String text, String id, T3 pt) { - if (!hoverEnabled) - return; // from draw for drawhover on if (eval != null && isScriptExecuting()) return; + if (id != null && pt != null) { + g.setO("_objecthovered", id); + g.setI("_atomhovered", -1); + g.setUserVariable("hovered", SV.getVariable(pt)); + if (sm.haveHoverCallback()) + sm.setStatusObjectHovered(id, text, pt); + } + if (!hoverEnabled) + return; shm.loadShape(JC.SHAPE_HOVER); setShapeProperty(JC.SHAPE_HOVER, "xy", P3i.new3(x, y, 0)); setShapeProperty(JC.SHAPE_HOVER, "target", null); @@ -4414,8 +4437,6 @@ setShapeProperty(JC.SHAPE_HOVER, "text", text); hoverAtomIndex = -1; hoverText = text; - if (id != null && pt != null) - setStatusObjectHovered(id, text, pt); refresh(3, "hover on point"); } @@ -4873,30 +4894,6 @@ } /* - * hoverCallback reports information about the atom being hovered over. - * - * jmolSetCallback("hoverCallback", "myHoverCallback") function - * myHoverCallback(strInfo, iAtom) {} - * - * strInfo == the atom's identity, including x, y, and z coordinates iAtom == - * the index of the atom being hovered over - * - * Viewer.setStatusAtomHovered Hover.setProperty("target") Viewer.hoverOff - * Viewer.hoverOn - */ - - private void setStatusAtomHovered(int atomIndex, String info) { - g.setI("_atomhovered", atomIndex); - g.setUserVariable("hovered", SV.getVariable(BSUtil.newAndSetBit(atomIndex))); - sm.setStatusAtomHovered(atomIndex, info); - } - - private void setStatusObjectHovered(String id, String info, T3 pt) { - g.setO("_objecthovered", id); - sm.setStatusObjectHovered(id, info, pt); - } - - /* * loadStructCallback indicates file load status. * * jmolSetCallback("loadStructCallback", "myLoadStructCallback") function This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk _______________________________________________ Jmol-commits mailing list Jmol-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-commits