From: Nick C. <nic...@ve...> - 2004-08-18 13:47:40
|
Tak, I can't remember if you can use an OpenSequenceGraph in batch mode, but its worth a try, I guess. Your error is the result, I think, of trying to dispose() the graph before its been shown. The dispose method in the graph should probably check for this, but in this case you'll need to check in your own code. You could either set a boolean when you call display on the graph indicating that you should be able to call dispose() or maybe just check if the controller is a gui with isGui() method on the controller. This later assumes that if you've displayed the graph if you are working with a gui controller. Nick > -----Original Message----- > From: rep...@li... > [mailto:rep...@li...]On Behalf Of > Takeshi Takama > Sent: Wednesday, August 18, 2004 5:59 AM > To: rep...@li... > Subject: [Repast-interest] Another question about OpenSequenceGraph > > > Dear All, > > I have another question, which somehow related to the question I > asked last > week. > Now, I draw a graph and write data from a OpenSequenceGraph field (i.e. > openSeqSuccessScore). And, this field exists in sub-class of Model class > that specialising GUI mode (i.e. ModelGUI). Then, I would like to uses > openSeqSuccessScore in Batch mode just to extract data with other > sub-class > (i.e. ModelBatch), so I created another class which both ModelGUI and > ModelBatch can access openSeqSuccessScore and its related nested classes. > The field name for the class is dataMger. > > The problem is that the GUI mode gets a NullPointerException at setup() > method in ModelGUI with these lines: > if (dataMger.getOpenSeqSuccessScore != null) { > dataMger.getOpenSeqSuccessScore.dispose(); > } > > I know I can use DataRecorder in ModelBatch to collect data > separately from > openSeqSuccessScore, and I actually do this way right now. But, I am > thinking if I can do the way I explained above or similar since it seems a > bit smarter. > > Thank you for your help in advance. > Best regards, > Tak > > > > > > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > Repast-interest mailing list > Rep...@li... > https://lists.sourceforge.net/lists/listinfo/repast-interest > |