[Date Prev][Date Next][Index][Thread]
[SGT Mail Archive]
[SGT Main Page]
Re: Plotting vectors problem; PRIOR: Problem using SGT library / Java/ ...
*************************************************
Message from the sgt mail list.
*************************************************
Sorry for the delay. I have been out of the office for the past 2 weeks.
>Dear colleagues.
>
>Fist excuse my poor English :)
>
>I'm engaged in programming some applets/applications that will output
>oceanographic data. We get raw measured data from our oceanographic buoy
>in Gulf of Trieste (http://boja.msp.nib.si/ for more info), and then we
>compute the values we want to show on internet and than display them.
>
>Prior upgrading our buoy, we used matlab to do images of our computations
>(old images can be found at http://boja.msp.nib.si/kafe/clani/ (you can
>register for a free user/pass or just use my u: dezo/p: korte).
>I already port the scalar plot to Java
>(http://www.dezo.org/FileStore/Plot/demo/ - it gets its data from
>http://www.dezo.org/FileStore/Plot/demo/data.txt ... source file is
>available on http://www.dezo.org/FileStore/Plot/sources/).
>There I encountered the first problem. I can't print my applet from e.g.
>MS IE (prior upgrading JVM to SUN JVM, I can print applets which was
>caused by but MS JVM which permit accessing printer from web browser ...
>the downside of MS JVM is that it supports Java 1.1 only so I have to
>upgrade). I solve the problem as follows:
>- I update my applet so that it can run as stand-alone application which
>display a new button 'Print' which print the graph (e.g.
>http://www.dezo.org/FileStore/Plot/demo/dezo.jar - 'java dezo.jar
>mbp.ScalarPlot');
>- I made some investigation in signing .jar files ... For this I have to
>purchase a certificate from CA or set-up my own CA and than distribute my
>CA's public key (I will do this for the last one, because I already
>implemented a workaround)
>Any other suggestion how to solve this problem?
I have jdk1.4 installed on my machine (Win2000) and when running IE with
your plot demo I didn't have any problem printing the applet (well it did
cut off the right side a bit). I suspect that one solution is to have the
jdk1.4 plug-in installed then it is not necessary to run as stand-alone
application or use signed jar's. The sun plug-in understands the Java2
print system which SGT supports. Back to an old point ... Information
about the HtmlConverter can be found at
http://java.sun.com/j2se/1.4.1/docs/guide/plugin/developer_guide/html_converter_more.html.
The converter appears to now be a standard part of the j2se platform. This
will convert a standard <APPLET> tag to the necessary code for both MS IE
and Netscape.
>Now I want to port our feather plot (vector plot) to java (e.g. of a
>feather plot can be found at:
>http://www.dezo.org/FileStore/Plot/images/VectorPlot.jpg). I encountered
>there some problems:
>- I'm very confused by JVectorDemo.java found at SGT homepage ... I found
>that it is using a JPlorLayout to output vectors. There are some things I
>don't understand:
> 1. What is VectorCartesianRenderer class meant to be?
The various Renderer classes are used to do the actual rendering of the
data. There are several different renderer classes, LineCartesianRenderer,
PointCartesianRenderer, etc., but in all cases the renderer is
automatically determined by the CartesianGraph.setData(SGTData data,
Attribute attr) method. You never need to construct a renderer yourself.
> 2. How can I output all the vectors only on one line (see below) - for
>example of such a plot, please check feather plot above.
Each vector component is a SGTGrid. A SGTGrid has X, Y, and Z values. For
a vector, both grids must have the same X & Y values. To create a single
line, then the Y axis would only have a single value, while the X would
have many. The X, Y coordinates define the vector's tail location. If you
are using autoscaling on Y axis, then with only one Y value the scaling
will not necessary work as you might want. Therefore it is necessary to
set the Y axis Range to be large enough.
> 3. SGTVector(uComp, vComp) accepts two set of data. For e.g. for
>Cartesian plots the fist one is the N component of the vector and the
>second one the E component, but why those data contains also more
>components (ex. JVectorDemo.java)? And how can I specify where to be the
>beginning of the vector (Y=0, X='time_of_mesurement') and what is the
>'vector power' - the length and the direction of the vector?
See the above explanation. If your uComp and vComp have X arrays that are
GeoDate, then the X axis will be time. The VectorAttribute determines the
scale of the vector and allows for a angle offset. The scale is relates
the length of the vector in user units to the length in "physical" units.
> 4. Is there any other way to output vector plots (like
>CartesianGraph(String) class - in this way I can call c = new
>CartesianGraph("Blah"); c.addXAxis(TimeAxis); c.addYAxis(PlainAxis);
>c.setData(MyData); << like in my ScalarPlot.java ?
Yes. You will need to set the AxisTransforms properly, but the above
should work if the X axis data in the vector are GeoDate objects.
> 5. Is there any other available Vector plot example source?
I don't have another example. The beta version of ncBrowse can create
vector plots. Feel free to look at the ncBrowse source code (warning, the
code wasn't written to be an example :-) See below for ncBrowse link.
>I have some other questions:
>- Is it interesting to add my sample code to the SGT sources so other
>people can easly start using SGT?
>- Are there any recommendations for the file format of the data containing
>oceanographic measurements (we will make our data publicly available)?
>- FROM Donald's replay:
> > For the applet (remember you need jdk1.2 or newer!), the code
> > attribute shouldn't include the class designator code="ScalarPlot" .
> > You may need to download the applet plug-in converter tool from sun,
> > called HtmlConverter.
> > It will translate your applet code to work with the plug-in.
>What is this tool used for - I search the SUN homepage but I don't found
>it (I will recheck for it later)?
>
>Regards,
>Dezo
==================================================
Donald W. Denbo dwd@pmel.noaa.gov
Ph: (206) 526-4487 Fax: (206) 526-6744
Collaborative tools: http://www.epic.noaa.gov/collab/
Netcdf Browser: http://www.epic.noaa.gov/java/ncBrowse
Scientific Java Graphics: http://www.epic.noaa.gov/java/sgt
EPIC Oceangraphic Data Management: http://www.pmel.noaa.gov/epic
==================================================
*************************************************
To remove yourself from this mailing list,
send mail to <Majordomo@epic.noaa.gov> with
"unsubscribe sgt" in the message body.