NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
Hi Isaac, you had CC-ed your email to the visad-list but had spelled it incorrectly, so my response (CC'ed to the list) also bounced. If you want to post a question to, or CC the list, use the following: visad-list@xxxxxxxxxxxxx instead of visad-list@xxxxxxxxxxxx Regards, Jim. --- Jim Koutsovasilis Bureau of Meteorology, Australia jimk@xxxxxxxxxx -------- Original Message -------- Subject: Re: visad field Date: Mon, 12 Aug 2002 14:18:34 +1000 From: Jim K <jimk@xxxxxxxxxx> To: "Brobbey,Isaac" <IBBrobbey@xxxxxxxxxxxxxxx> CC: "'visad-list@xxxxxxxxxxxx '" <visad-list@xxxxxxxxxxxx> References: <7245E2DC4775D411AE0800508B641AF301AF699F@xxxxxxxxxxxxxxx> Hi Isaac, once again, I am cc-ing the list because I think others may benefit from your question. I have only had time to fix the range-scaling problem you are having. Can anyone offer a quick fix for the pick manipulation problem? Here is a fragment of your code (with line numbers): 127 ScalarMap xmap0=new ScalarMap(xtype, Display.XAxis); 128 xmap0.getAxisScale().setScreenBased(false); 129 display.addMap(xmap0); 130 display.addMap(new ScalarMap(ytype, Display.YAxis)); 131 display.addMap(new ScalarMap(ratio, Display.ZAxis)); 132 display.addMap(new ScalarMap(ratio, Display.RGB));133 //ScalarMap timeRangeMap = new ScalarMap( xtype, Display.SelectRange );
134 135 136 137 // This is NEW! 138 // Create a RangeWidget with the ScalarMap timeMap 139 java.util.Vector mapVector = display.getMapVector(); 140 final int numMaps = mapVector.size();141 ScalarMap map1color = (ScalarMap )mapVector.elementAt(numMaps-1);
142 JPanel panel = new JPanel(); 143 panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); 144 panel.add(new LabeledColorWidget(map1color)); 145 146147 ranWid = new RangeWidget(new ScalarMap(xtype, Display.XAxis));code:
The problem is with line 147. Instead of using the "xmap0" scalar-map that was created on line 127 and added to the display on line 129, a new scalar-map is being created and passed to the RangeWidget constructor. So, RangeWidget is working with a scalar map that has not been added to the display. That's why changing the range in the widget did not work. To fix the problem, replace line 147 with the following ranWid = new RangeWidget(xmap0); Now, we're giving RangeWidget a scalar map that has been added to the display. :) Hope that helps, Jim. --- Jim Koutsovasilis Bureau of Meteorology, Australia jimk@xxxxxxxxxx Brobbey,Isaac wrote:
Dear Jim , I have a little problem with the PickManipulationRendererJ3D and the range selection, the attached code compiles and runs fine, but the only problem is that, at run time, when i enter a range value it doesnt work as it is supposed to.Secondly the PickManipulationRendererJ3D cannot pick any sample when i right click. Is it because i try to add two data references to the display ? i am confused here. The "spikes" in the display corresponds to the ratio values in the file flatxx.txt, so i expect that when i right click, the PickManipulationRendererJ3D should execute the getClosedIndex()method and pick the corresponding sample, but it is not happening. i am not sure if i am doing something wrong since i am "new" to visad, i dont have much experience with visad.I have spent about three days trying to find it out, but from the top-level, i think the doAction() method in the cellImpl() method is not working but i dont really know what i am missing in the code, and i will be glad to know any workaround. I appreciate your time and hope to hear from you very soon. Isaac Center for Vascular Biology uchc
visad
archives: