[Date Prev][Date Next][Index][Thread]
[SGT Mail Archive]
[SGT Main Page]
Re: Réf. : Using SimpleGrid...?
*************************************************
Message from the sgt mail list.
*************************************************
*************************************************
Message from the sgt mail list.
*************************************************
*************************************************
Message from the sgt mail list.
*************************************************
On Fri, Apr 29, 2005 at 11:44:07AM +0200, Laurent BEIGBEDER wrote:
> Hi,
Hi Laurent,
Thanks for your reply (all 12 copies of it! :).
> What do you mean by associatedData?
I must not be using SimpleGrid correctly - I had tried passing a
SimpleGrid instance directly into the rpl.addData() call, and it
generated a Null Pointer exception, so I did some browsing through
the Java Docs and thought that perhaps I needed to pass instead
SimpleGrid.getAssociatedData()...
> I use it with double arrays with following constraints: grid.length ==
> xloc.length*yloc.length
This seems to be the problem - I was passing in values like this:
grid[0] = Z0 / xloc[0] = X0 / yloc[0] = Y0
grid[1] = Z1 / xloc[1] = X1 / yloc[1] = Y1
grid[2] = Z2 / xloc[2] = X2 / yloc[2] = Y2
. . .
So are you saying that I should have passed in:
grid[0] = Z(X0,Y0)
grid[1] = Z(X0,Y1)
grid[2] = Z(X0,Y2)
. . .
and
xloc[] = { 0, 1, 2, . . . , ncols - 1 }
yloc[] = { 0, 1, 2, . . . , nrows - 1 }
???
I thought I had already tried this, but let me look again...
Please clarify if I'm still not understanding SimpleGrid usage...!
> then, if sg is the new SimpleGrid.
> sg.setXMetaData(new SGTMetaData("Distance","km"));
> sg.setYMetaData(new SGTMetaData("Height","m"));
> sg.setZMetaData(new SGTMetaData("Depth","cm"));
Is is *necessary* to set this MetaData...?
Please let me know. I wasn't doing this either...
Thanks Much! :-)
Jim
> then put it in a JPlotLayout
> /*
> * Create the layout without a Logo image and with the
> * ColorKey on a separate Pane object.
> */
> JPlotLayout rpl = new JPlotLayout(true, false, false, "test layout",
> null, true);
> rpl.setEditClasses(false);
> /*
> * Create a GridAttribute for CONTOUR style.
> */
> Range2D datar = new Range2D(-20.0f, 45.0f, 5.0f);
> //Range2D datar = new Range2D(0.0f, 1.0f, 5.0f);
> clevels = ContourLevels.getDefault(datar);
> gridAttr_ = new GridAttribute(clevels);
> /*
> * Create a ColorMap and change the style to RASTER_CONTOUR.
> */
> ColorMap cmap = createColorMap(datar);
> gridAttr_.setColorMap(cmap);
> gridAttr_.setStyle(GridAttribute.RASTER_CONTOUR);
> /*
> * Add the grid to the layout and give a label for
> * the ColorKey.
> */
> rpl.addData(newData, gridAttr_, "Test data");
> rpl.setTitles("Demo d'essai",
> "Utilisant JPlotLayout",
> "et voila =)","");
> rpl.setSize(new Dimension(500, 400));
> rpl.setKeyLayerSizeP(new Dimension2D(2.0, 6.0));
> rpl.setKeyBoundsP(new Rectangle2D.Double(0.01, 5.99, 1.98, 5.98));
> Regards,
> Laurent BEIGBEDER
> GFI Informatique
> Toulouse - FRANCE
> Veuillez répondre à James Kohl <kohlja@ornl.gov>
> Pour : sgt@noaa.gov
> cc : kohlja@ornl.gov
> Objet : Using SimpleGrid...?
> *************************************************
> Message from the sgt mail list.
> *************************************************
> Help!
> I'm a new user, trying to use SGT for a simple applet
> demo, and cannot seem to create a valid SimpleGrid for
> passing into a JGridDemo setup... (I have started
> with your JGridDemo.java example, and am trying
> to replace the TestData with my own data grid).
> I have created a SimpleGrid using the
> ( double [] grid, double [] xloc, double [] yloc, String )
> constructor, with X and Y coordinates in xloc[] and yloc[],
> resp, and Z values in grid[], but the resulting SimpleGrid
> has null "AssociatedData"...?!
> How do I get my "Z" values (the actual data) into the grid?
> Any help would be greatly appreciated, ASAP!
> Thanks Much!
> James Kohl, PhD
> Oak Ridge National Laboratory
> *************************************************
> To remove yourself from this mailing list,
> send mail to <epic-majordomo@noaa.gov> with
> "unsubscribe sgt" in the message body.
> ==========
*************************************************
To remove yourself from this mailing list,
send mail to <epic-majordomo@noaa.gov> with
"unsubscribe sgt" in the message body.
==========
*************************************************
To remove yourself from this mailing list,
send mail to <epic-majordomo@noaa.gov> with
"unsubscribe sgt" in the message body.
==========
*************************************************
To remove yourself from this mailing list,
send mail to <epic-majordomo@noaa.gov> with
"unsubscribe sgt" in the message body.
==========
Privacy Notice,
External Links Disclaimer.