[Date Prev][Date Next][Index][Thread] [SGT Mail Archive] [SGT Main Page]

problem using key_pane with JPlotLayout



*************************************************
Message from the sgt mail list.
*************************************************

I am having difficulty using extracting the key_pane from a JPlotLayout into a scrollable panel (e.g. as per the NOAATech2002 SGT Tutorials.

If I set the is_key_pane parameter to true as in:

layout_ = new JPlotLayout(false, false, false, "Trajectory Data", null, true); 

and procede with other code to extract and use the key pane.  Then when I go to add the line data I get:

 java.lang.NullPointerException 	at gov.noaa.pmel.sgt.LabelDrawer2.getFontRenderContext(LabelDrawer2.java:520) 	at gov.noaa.pmel.sgt.LabelDrawer2.computeFontSize(LabelDrawer2.java:414) 	at gov.noaa.pmel.sgt.LabelDrawer2.computeBoundsD(LabelDrawer2.java:325) 	at gov.noaa.pmel.sgt.LabelDrawer2.getBounds(LabelDrawer2.java:264) 	at gov.noaa.pmel.sgt.SGLabel.getBounds(SGLabel.java:470) 	at gov.noaa.pmel.sgt.LineKey.getBounds(LineKey.java:545) 	at gov.noaa.pmel.sgt.LineKey.getRowHeight(LineKey.java:421) 	at gov.noaa.pmel.sgt.swing.JPlotLayout.addData(JPlotLayout.java:864) 	at gov.noaa.pmel.sgt.swing.JPlotLayout.addData(JPlotLayout.java:587) 	at gov.noaa.pmel.sgt.demo.JTimeSeriesDemo.makeGraph(JTimeSeriesDemo.java:138) 	at gov.noaa.pmel.sgt.demo.JTimeSeriesDemo.main(JTimeSeriesDemo.java:96)



The problems seems to be down in or below the "line_key.getRowHeight" method which is called several times in JPlotLayout.java

Can anyone demonstate a similar problem?  Im on W2k w/JDK 1.3.1_01 - maybe I should go back to 1.2 or should this work?

Also in same tutorial, it references 2 classes that I cant find... KeyPaneLayout and LineBorder, any help there?


Thanks in advance for any help.

Rich Schramm 


*************************************************
To remove yourself from this mailing list,
send mail to <Majordomo@epic.noaa.gov> with
"unsubscribe sgt" in the message body.