multithreading a JComponent that depends upon an InputStream
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   James_Rome
Posted On:   Thursday, June 24, 2004 07:07 AM

I have a complicated JComponent that reads a data stream (from a file or from a pipe) and plots it. In addition to plotting it on the screen, I need to be able to print the plot or to convert it to (say) a bitmep. While plotting on the screen is fast, converting to a bitmap takes eternity. Clearly I should put these time-consuming operations into a swing worker because while the plot is being converted, the on-screen plot may need to be refreshed. I can (and should) create separate JComponents for this purpose, however there is only one InputStream that contains the data. The stream needs to be accessed by the different components at different places in the stream simultaneously. I also need markers to show the beginning and end of each plot. I   More>>

I have a complicated JComponent that reads a data stream (from a file or from a pipe) and plots it. In addition to plotting it on the screen, I need to be able to print the plot or to convert it to (say) a bitmep. While plotting on the screen is fast, converting to a bitmap takes eternity.


Clearly I should put these time-consuming operations into a swing worker because while the plot is being converted, the on-screen plot may need to be refreshed. I can (and should) create separate JComponents for this purpose, however there is only one InputStream that contains the data. The stream needs to be accessed by the different components at different places in the stream simultaneously. I also need markers to show the beginning and end of each plot. Is there some way to do this?

   <<Less

Re: multithreading a JComponent that depends upon an InputStream

Posted By:   Christopher_Koenigsberg  
Posted On:   Thursday, June 24, 2004 09:24 AM

Perhaps retain a copy of the data streamed in, for other threads to use, in some kind of temp buffer/file/db BLOB.
About | Sitemap | Contact