Sure. All the menus do this. The toolbar buttons in the Java application,
the surface tool dialog does this. File...Export...Gaussian has buttons. So
check out org.openscience.jmol.app and included classes. The template is
something like this:

JButton goButton;
JmolViewer viewer;
...
    goButton = new JButton("Turn the background to red");
    goButton.setActionCommand("background red");
    goButton.addActionListener(this);
...

  @Override
  public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();
    if (source == goButton) {
      viewer.script(((JButton)goButton).getActionCommand());
    }
  }


Various ways to embellish upon that.

Bob






On Mon, May 5, 2014 at 9:21 AM, eric henon <eric.he...@univ-reims.fr> wrote:

> Dear all,
>
> Last year, I built an web application using the jmolApplet.
> This applet (JBox) allows for embedding a protein in a boundbox,
> which can interactively be translated, zoomed in, or
> even individually rotated about three axis.
>
> I would like now to built my own java application
> embedding jmol that would allow for the same possibilities
> (rotating, ... boundBox).
>
>
> I have already used the Integration.java example
> to create a JmolPanel. It  works fine. However, instead of using the
> "text" AppConsole possibilities, I would like to add buttons
> in my own application that would automatically pass script commands
> (functions)
> directly to jmol.  Is this possible ?  Are there any example for something
> like that ?
>
> Thanks in advance.
> Eric
>
>
> ------------------------------------------------------------------------------
> Is your legacy SCM system holding you back? Join Perforce May 7 to find
> out:
> &#149; 3 signs your SCM is hindering your productivity
> &#149; Requirements for releasing software faster
> &#149; Expert tips and advice for migrating your SCM now
> http://p.sf.net/sfu/perforce
> _______________________________________________
> Jmol-developers mailing list
> Jmol-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>



-- 
Robert M. Hanson
Larson-Anderson Professor of Chemistry
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
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to