Search the web
Sign In
New User? Sign Up
jsci
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Hear how Yahoo! Groups has changed the lives of others. Take me there.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Alternative to fireDataChanged()   Message List  
Reply | Forward Message #119 of 369 |
Re: Alternative to fireDataChanged()


Hi,

A data acquisition program in Java, neat!!!

If you have subclassed AbstractGraphModel then fireGraphDataChanged()
is the correct method to use. (Note it has been renamed from
fireDataChanged() in recent versions). If you are using one of the
DefaultGraphModels then you should not be using fireGraphDataChanged()
at all, but a changeSeries() method. Further, fireGraphDataChanged()
should only be called from within the event-dispatching loop (see Java
tutorial). If you are calling it from another thread, you should be
using something like

SwingUtilities.invokeLater(new Runnable() {
public void run() {fireGraphDataChanged();}
});

or

EventQueue.invokeLater(new Runnable() {
public void run() {fireGraphDataChanged();}
});

see also invokeAndWait().

I hope this resolves your problem.

Regards,

Mark


--- In jsci@yahoogroups.com, bleu_c <no_reply@y...> wrote:
> Hi, I'm a using this nice Jsci api to create line graphs for my
> school project, which really saves me the trouble of reinventing the
> wheel.
>
> I'm acquiring data from the serial port RS-232, using the serial
> communication api from java.sun.com, then plot them on 2 line graphs.
> Everything works fine on my computer at home, but not on the laptop
> computer at school. This laptop has WindowsME, running the Sun One
> Studio 4 update 1 Community Edition.
>
> And so, I keep getting problems with the function fireDataChanged
> during compilation, and even when I try to run the class files of my
> program compiled from my CPU at home. If I don't call fireDataChanged
> at all, everything compiles and runs smoothly, except now the line
> graph won't refresh... :(
>
> So I'm searching for another way to refresh line graphs without
> fireDataChanged. If any of you guys have some ideas, or have seen
> similar problem, plz let me know, I really apreciate it.
>
> Thanks for your time, and good day to you all!




Wed Nov 12, 2003 4:55 pm

mj_hale
Offline Offline

Forward
Message #119 of 369 |
Expand Messages Author Sort by Date

Hi, I'm a using this nice Jsci api to create line graphs for my school project, which really saves me the trouble of reinventing the wheel. I'm acquiring data...
bleu_c
Offline
Nov 10, 2003
4:36 pm

Hi, A data acquisition program in Java, neat!!! If you have subclassed AbstractGraphModel then fireGraphDataChanged() is the correct method to use. (Note it...
mj_hale
Offline
Nov 12, 2003
4:55 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help