OK, the first thing I notice is that I forgot to include a call to
notifyEnabled() for sync callback. It just doesn't use the method -- simply
calls notifyCallback(). So we shouldn't expect anything from notifyEnabled()
for callback #12.
I suggest adding a CALLBACK_SCRIPT notification and then doing a
case JmolConstants.CALLBACK_SCRIPT:
{
System.out.printf("callback script: " + (data != null ?
data[1] : "") + "\n");
break;
}
to see what scripts are being run. Something in there is resetting the sync
to OFF.
On Wed, Sep 30, 2009 at 10:16 AM, Joe Gatewood <j...@seirad.com> wrote:
> Bob,
> I am using sync *;set syncMouse on;set syncScript on
>
> Below are my notify calls with all the handling removed and just the print
> statements. These versions are what I am using to do the test.
>
> Included after the functions is echo from the model load and zoom and atom
> and bond picking. Atom and bond picking result in callbacks as does mouse
> down (not reported in this echo) and key released. I have omitted
> redundant
> callbacks during the model load and all the atom echos to reduce the size
> of
> the email.
>
> I fully expect one of those "boy was that dumb" moments just around the
> corner, but for now I do not see what I am missing.
>
> Thanks,
> Joe
> -
>
>
> Are you getting any callbacks at all? Something simple is wrong here....
>
> In general we recommend implementing 11.8, not 11.9, for distributions.
> Let's get this working for you in 11.8.
>
> Take a look at examples/basic/org/jmol/Export.java in the 11.8 source code.
> I've modified it to add the sync callback, and it is working just fine. I
> just start the program and enter
>
> load =1crn
> sync *;set syncMouse on;set syncScript on
>
> and it starts reporting all mouse moves and scripts
>
> Are you just not issuing "sync *"?
>
> Bob
>
> @Override
> public void setCallbackFunction(String arg0, String arg1) {
> }
>
> @Override
> public void notifyCallback(int type, Object[] data) {
> System.out.printf("in callback with %d\n",type);
> switch (type)
> {
> case JmolConstants.CALLBACK_PICK:
> {
> // arg1[0] is null
> // arg1[1] is string describing atom
> // arg1[2] is int that equals atom number
> System.out.printf("Notify pick callback\n");
> break;
> }
> case JmolConstants.CALLBACK_SYNC:
> {
> System.out.printf("Notify sync callback\n");
> break;
> }
> default:
> {
> break;
> }
> }
> }
>
> @Override
> public boolean notifyEnabled(int type) {
> System.out.printf("in notify with %d\n",type);
> switch (type)
> {
> case JmolConstants.CALLBACK_PICK:
> {
> return true;
> }
> case JmolConstants.CALLBACK_SYNC:
> {
> return true;
> }
> }
> return false;
> }
>
> (C) 2009 Jmol Development
> Jmol Version 11.8.4 2009-08-11 23:55
> java.vendor:Sun Microsystems Inc.
> java.version:1.6.0_13
> os.name:Linux
> memory:6.3/8.6
> useCommandThread: false
> in notify with 11
> disablepopupmenu = true
> in notify with 1
> in notify with 11
> in notify with 11
> in notify with 11
> bondpicking = true
> in notify with 1
> in notify with 11
> in notify with 11
> in notify with 11
> autobond = false
> in notify with 1
> in notify with 11
> in notify with 11
> in notify with 11
> syncmouse = true
> in notify with 1
> syncscript = true
> in notify with 1
> in notify with 11
> in notify with 11
> in notify with 11
> in notify with 0
> in notify with 5
> in notify with 10
> in notify with 11
> in notify with 11
> in notify with 11
> in notify with 0
> in notify with 5
> in notify with 11
> in notify with 11
> in notify with 11
> refreshing = false
> in notify with 1
> in notify with 11
> in notify with 11
> in notify with 11
> in notify with 0
> in notify with 5
> FileManager.getAtomSetCollectionFromString()
> The Resolver thinks Xyz
> ModelSet: haveSymmetry:false haveUnitcells:false haveFractionalCoord:false
> 1 model in this collection. Use getProperty "modelInfo" or getProperty
> "auxiliaryInfo" to inspect them.
> ModelSet: not autobonding; use forceAutobond=true to force automatic bond
> creation
> in notify with 0
> in notify with 5
> in notify with 11
> in notify with 11
> in notify with 11
> bondradiusmilliangstroms = 1000
> in notify with 1
> in notify with 11
> "......atom addition"
> in notify with 11
> refreshing = true
> in notify with 1
> in notify with 11
> in notify with 11
> in notify with 11
> data "model bipartite"
> |89|test|O 0 0 -120|"..more atoms.."|K -36 4 -90|
> end "model bipartite";
> in notify with 1
> in notify with 11
> in notify with 11
> setStatusAtomPicked(76,K77 #77 -2.0 36.0 -60.0)
> in notify with 9
> in callback with 9
> Notify pick callback
> setStatusAtomPicked(-3,["bond","20 1 K45 #45 -- O16 #16
> 41.243183",12.5,-13.0,-140.0])
> in notify with 9
> in callback with 9
> Notify pick callback
> in notify with 4
> setStatusAtomPicked(44,K45 #45 25.0 -26.0 -150.0)
> in notify with 9
> in callback with 9
> Notify pick callback
> Key released
> Key released
>
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry® Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay
> ahead of the curve. Join us from November 9-12, 2009. Register now!
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Jmol-developers mailing list
> Jmol-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers