Michael, I've uploaded files to chemapps.stolaf.edu. The Java side is all
done -- when you go to the page using &debugcode:
http://chemapps.stolaf.edu/jmol/jsmol/test2.htm?USE=HTML5&debugcode
then it will use the modifications I have put in place, and right-clicking
on the applet or clicking the logo will do an alert from the method in Jmol
that is creating the menu.
I suggest figuring out how to handle it with just JavaScript objects
(probably arrays, I guess) and then only after you have that in place start
working with jQuery.
Bob
On Wed, Dec 19, 2012 at 9:10 AM, Michael Evans <[email protected]> wrote:
> Thanks, Bob. I got the sense objects would be the way to go. Working on
> this this morning. Stay tuned!
>
>
> ---
> Michael Evans
> Organic Chemistry Graduate Student, Moore Group
> University of Illinois, Urbana-Champaign
>
>
> On Wed, Dec 19, 2012 at 8:56 AM, Robert Hanson <[email protected]> wrote:
>
>> OK, Michael, here's what we actually need from the JavaScript side. From
>> org.jmol.awt2d.JSPopup:
>>
>> //TODO: jQuery menu actions, entry, and exit need to come back here
>> // to execute checkMenuClick, checkMenuFocus, and
>> checkBoxStateChanged
>>
>> // (on mouse up) checkMenuClick(e.getSource(),
>> e.getSource().getActionCommand());
>> // (on entry) checkMenuFocus(item.getName(),
>> item.getActionCommand(), true);
>> // (on exit) checkMenuFocus(item.getName(),
>> item.getActionCommand(), false);
>> // (on checkbox click) checkBoxStateChanged(e.getSource());
>>
>> //TODO: JavaScript objects:
>> // new Jmol.Menu.PopupMenu(name)
>> // new Jmol.Menu.SubMenu(entry)
>> // new Jmol.Menu.MenuItem(entry)
>> // new Jmol.Menu.ButtonGroup()
>> // new Jmol.Menu.CheckBoxMenuItem(entry)
>> // new Jmol.Menu.RadioButtonMenuItem(entry)
>> //
>> //TODO: Jmol given in j2sNative blocks, for example: setText,
>> setActionCommand
>>
>> see
>> http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol/src/org/jmol/awtjs2d/JSPopup.java?content-type=text%2Fplain
>>
>> I'll help. The interface I gave you before is actually for Java; what we
>> need to implement in JavaScript is a bit different. Look in that file for
>> @j2sNative blocks, and you will at least be able to construct a list of
>> needed functions. Many of these methods will be called from
>>
>>
>> http://jmol.svn.sourceforge.net/viewvc/jmol/trunk/Jmol/src/org/jmol/popup/GenericPopup.java?content-type=text%2Fplain
>>
>> Bob
>>
>>
>>
>> On Tue, Dec 18, 2012 at 11:57 AM, Michael Evans <[email protected]>wrote:
>>
>>> Jmol community,
>>> Here's a simple example of a context menu in JSmol:
>>>
>>> http://www.metallacycle.com/play/netmol/tests/popupMenu/popupMenu.html
>>>
>>> Dig into the document ready function and jmolPopupMenu.js for details.
>>> The whole kit and kaboodle (including jQueryUI menu, which I used to handle
>>> the visuals) is 165 KB at the moment. The JS file adds Jmol.Menu with its
>>> associated functions:
>>>
>>> initializeMenu
>>> menuAddItem(menu, item)
>>> menuRemoveItem(menu, itemId)
>>> menuAddSubmenu(menu, submenu)
>>> menuAddSeparator(menu)
>>> menuEnableItem(menu, itemId, boolEnable)
>>>
>>> Should the "items" sent to menuAddItem, etc. just be HTML, or something
>>> more abstract like Javascript objects? There are no jQueryUI objects for
>>> things like radio groups and checkboxes...these would have to be handled by
>>> us somewhere on the path from abstract menu object to final rendered menu.
>>> Would be interested to hear your thoughts on the best way to implement
>>> addItem.
>>>
>>> Cheers, Mike
>>>
>>> ---
>>> Michael Evans
>>> Organic Chemistry Graduate Student, Moore Group
>>> University of Illinois, Urbana-Champaign
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
>>> Remotely access PCs and mobile devices and provide instant support
>>> Improve your efficiency, and focus on delivering more value-add services
>>> Discover what IT Professionals Know. Rescue delivers
>>> http://p.sf.net/sfu/logmein_12329d2d
>>> _______________________________________________
>>> Jmol-users mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>>
>>>
>>
>>
>> --
>> Robert M. Hanson
>> Larson-Anderson Professor of Chemistry
>> Chair, Chemistry Department
>> St. Olaf College
>> Northfield, MN
>> http://www.stolaf.edu/people/hansonr
>>
>>
>> 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
>>
>>
>>
>> ------------------------------------------------------------------------------
>> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
>> Remotely access PCs and mobile devices and provide instant support
>> Improve your efficiency, and focus on delivering more value-add services
>> Discover what IT Professionals Know. Rescue delivers
>> http://p.sf.net/sfu/logmein_12329d2d
>> _______________________________________________
>> Jmol-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>>
>>
>
>
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Chemistry Department
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
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
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users