draw2d "scrolling monitor" question [message #227675] |
Sat, 09 December 2006 16:35 |
Eclipse User |
|
|
|
Originally posted by: jan.infomail.ch
Hi,
I'm writing a process monitor graphing plugin with a functional much
like the graphs in Windows Task Monitor Manager.
I'm using the org.eclipse.draw2d.graph package and have pretty good grip
on using Node and Edge and related classes. So far I managed to draw the
sample points and connected them together.
However, I lack some understanding in how to offset all samples when I
run out of space on x axis. I always draw from left to right and when I
reach the end of the x axis I'd like to scroll all existing figures out
off the left side. What would the preferred way to this?
Thanks
Jan Petersen
|
|
|
Re: draw2d "scrolling monitor" question [message #227741 is a reply to message #227675] |
Mon, 11 December 2006 03:35 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
Turn the scrollbars off and start scrolling. That's probably the easiest
and most performance efficient way to do it. Of course, to free up memory,
you might also want to do occasional garbage collection (removing all
figures that are not visible anymore). Keep in mind, however, that you
can't keep growing infinitely. If that is a requirement, at some reasonable
point, you should reset the coordinates so that ints don't overflow and the
canvas doesn't become too huge. Or you can actually move the figures as
time passes. I don't think that'd be very efficient though. You might find
Graphics#translate() useful in certain situations.
"Jan Petersen" <jan@infomail.ch> wrote in message
news:eleole$gj2$1@utils.eclipse.org...
> Hi,
>
> I'm writing a process monitor graphing plugin with a functional much like
> the graphs in Windows Task Monitor Manager.
>
> I'm using the org.eclipse.draw2d.graph package and have pretty good grip
> on using Node and Edge and related classes. So far I managed to draw the
> sample points and connected them together.
>
> However, I lack some understanding in how to offset all samples when I run
> out of space on x axis. I always draw from left to right and when I reach
> the end of the x axis I'd like to scroll all existing figures out off the
> left side. What would the preferred way to this?
>
> Thanks
>
> Jan Petersen
|
|
|
Powered by
FUDForum. Page generated in 0.03037 seconds