Hi Miguel!

My general thinking is that the event notification should not pass very
much information ...



I agree.


Then, there should be a separate set of entry points for querying about
the state.


As in:of an event of type 'atom-picked'
 1. you receive notification that some event occurred


The Java event listening classes usually seem to receive a subclass of java.util.EventObject.
From the docu there"""All Events are constructed with a reference to the object, the "source", that is logically deemed to be the object upon which the Event in question initially occurred upon."""


so the question for me is then, what are the sources of possible events in Jmol: the Jmol viewer, an atom, etc.? - could be that several different types of events are needed.


The external application needs
to parse this string in order to retreive info like Chain, etc. -
Correct?



You can pass the atomIndex back in and ask for information about it.



yes, just it would be nice to get a simple Interface "Atom" that allows to query the status of one atom. especially if Atom would be the Source of an event...

2. you ask and learn that the event was 'pick'


hm. shouldn't this be done by the call of the appropriate method of the EventListener?
so I could imagine something like:


public class AtomEventListener {

   public void mouseOverAtom(AtomEvent e){};
   public void atomPicked(AtomEvent e){}
   public void atomSelected(AtomEvent e){}

}

public class JmolViewerEventListener{
   public void rotationChanged(JmolViewerEvent e){}
   ...
}


 3. you ask which atom was picked
 4. you ask for information about that atom



yes. to add to the previous examples
   public void atomSelected(AtomEvent e){
      Atom a = (Atom) e.getSource();
      // do something, depending on interface "Atom"
      a.getRadius():
   }

   public void rotationChanged(JmolViewerEvent e){
      JmolViewer v = (JmolViewer) e.getSource();
  }

Q: What do you think?


What do you think ? :-)

Andreas

--
--------------------------------------------------

Andreas Prlic Wellcome Trust Sanger Institute
Hinxton, Cambridge CB10 1SA, UK






-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers

Reply via email to