Skip to main content



      Home
Home » Eclipse Projects » GEF » Ideal GEF Viewer eats up CPU
Ideal GEF Viewer eats up CPU [message #486533] Fri, 18 September 2009 00:43 Go to next message
Eclipse UserFriend
Hi,

I have a GEF viewer with large figure,
And an associated outline view for the same,

With outline view the application eats up cpu even while minimized,

Without outline view the application starts eating CPU once in focus with
no user activity,

Is this right,
How can i find out what is eating the CPU,
a break point position in GEF or draw2d classes would be appreciated...
Re: Ideal GEF Viewer eats up CPU [message #486541 is a reply to message #486533] Fri, 18 September 2009 02:46 Go to previous messageGo to next message
Eclipse UserFriend
vijay wrote:

> Hi,

> I have a GEF viewer with large figure,
> And an associated outline view for the same,

> With outline view the application eats up cpu even while minimized,

outline view thumbnail updater runs continuously, even when application is
minimized is this right???

> Without outline view the application starts eating CPU once in focus with
> no user activity,

I solved the above problem,This problem was because of
figure.setBackground calls in painFigure method,the setBackground should
be called on graphics instance not on figure instance.
(Hope this would help others)

> Is this right,
> How can i find out what is eating the CPU,
> a break point position in GEF or draw2d classes would be appreciated...
icon4.gif  Re: Ideal GEF Viewer eats up CPU [message #486808 is a reply to message #486541] Sat, 19 September 2009 07:48 Go to previous message
Eclipse UserFriend
Why does the ThubmnailUpdater of Thumbnail class update the image title by tile...

Is there a reason for this type of update...
In the run method..
public void run() {
		if (!isActive() || !isRunning())
			return;
		int v = getCurrentVTile();
		int sy1 = v * tileSize.height;
		int sy2 = Math.min((v + 1) * tileSize.height, getSourceRectangle().height);
		
		int h = getCurrentHTile();
		int sx1 = h * tileSize.width;
		int sx2 = Math.min((h + 1) * tileSize.width, getSourceRectangle().width);
		org.eclipse.draw2d.geometry.Point p = getSourceRectangle().getLocation();

		Rectangle rect = new Rectangle(sx1 + p.x, sy1 + p.y, sx2 - sx1, sy2 - sy1);
		thumbnailGraphics.pushState();
		thumbnailGraphics.setClip(rect);
		thumbnailGraphics.fillRectangle(rect);
		sourceFigure.paint(thumbnailGraphics);
		thumbnailGraphics.popState();
		
		if (getCurrentHTile() < (hTiles - 1))
			setCurrentHTile(getCurrentHTile() + 1);
		else {
			setCurrentHTile(0);
			if (getCurrentVTile() < (vTiles - 1))
				setCurrentVTile(getCurrentVTile() + 1);
			else
				setCurrentVTile(0);
		}
		
		if (getCurrentHTile() != 0 || getCurrentVTile() != 0)
			Display.getCurrent().asyncExec(this);
		else if (isDirty()) {
			setDirty(false);
			Display.getCurrent().asyncExec(this);
			repaint();
		} else {
			stop();
			repaint();
		}
	}


for every single tile update a async exec is called...

Previous Topic:Drawing JFreeChart chart in Draw2D figure
Next Topic:GEF UML auto layout
Goto Forum:
  


Current Time: Wed Jul 23 11:09:23 EDT 2025

Powered by FUDForum. Page generated in 0.03804 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top