Action Listeners

Bill Hibbard hiding at japan.com
Sun May 20 13:55:05 MDT 2007


 To answer your question, MIke, I'd have to dig into the code
and run little debugging experiments, and it sounds like you're
pretty good at doing that for yourself. I don't recall the exact
circumstances in calling doAction().

My general recommendation is that almost anything is easier
than writing a custom DataRenderer, so I'd look for more like
your clever getCloseIndex() trick.

Good luck,
Bill

  ----- Original Message -----
  From: "Kapper Michael G Civ AFRL/PRSA"
  To: visad at unidata.ucar.edu
  Subject: RE: Action Listeners
  Date: Sat, 19 May 2007 12:45:02 -0700

  Thanks Bill, PickManipulationRendererJ3D is exactly what I was
  looking for.  But I’m still having an issue with how doAction() is
  triggered.  I would like it to be triggered only when the reference
  is right-clicked, but now it is being called (I’m assuming) anytime
  one of its attributes changes (eg. position).  I did find a way
  around this by using the getCloseIndex() method as follows.

  pmr = new PickManipulationRendererJ3D();

  cell = new CellImpl()

  {   public void doAction() throws RemoteException, VisADException

  {   if( pmr.getCloseIndex() > -1 )

  {  

  ...

  }

  }

  }

  This way I’m sure that doAction() is triggered only when the
  reference was right-clicked.  However, there are some caveats when I
  try to make things a bit more complex which I think will be
  eliminated if doAction() is only triggered by a right click.  Is
  there a way to stop doAction() in all cases other than a right
  click?  Do I have to create my own custom renderer?

  Thanks again,

  Mike

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

  From: Bill Hibbard [mailto:hiding at japan.com]
  Sent: Friday, May 18, 2007 5:29 AM
  To: Kapper Michael G Civ AFRL/PRSA; visad at unidata.ucar.edu
  Subject: Re: Action Listeners

  Hi Mike,

  visad/bom/PickManipulationRendererJ3D.java may do
  what you want. You can run:

  java visad.bom.PickManipulationRendererJ3D

  to get a demo. Click the right mouse button on various
  objects in the scene. You won't change their values, but
  will trigger events.

  Good luck,
  Bill

  ----- Original Message -----
  From: "Kapper Michael G Civ AFRL/PRSA"
  To: visad at unidata.ucar.edu
  Subject: Action Listeners
  Date: Thu, 17 May 2007 19:52:55 -0700


  Hi everyone,

  I’ve been playing around with the DirectManipulationRenderer’s and
  the various Action implementations as in Ugo Taddei’s tutorial.  Very
  cool stuff, but I need to add a listener that would trigger the
  doAction() method for specific events, not just when a point is
  moved.  For example, I want to have a surface or line defined by a
  GriddedSet which could be right-clicked to bring up a dialog box.  Is
  there an easy way to do this?

  Thanks,

  Mike


  --

  [IMAGE]
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: not available
Url: http://mailman.unidata.ucar.edu/mailing_lists/archives/visad/attachments/20070520/33eff557/attachment.ksh 


More information about the visad mailing list