Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic NoSuchElement exception on FlowChart (Read 2761 times)
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
NoSuchElement exception on FlowChart
Nov 1st, 2007 at 10:55am
Print Post  
This happens with the regular v1.2.1 jar (before the latest fixes).
A user got this exception on screen:

I don't know the scenario, it was during a regular usage of the FlowChart.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: NoSuchElement exception on FlowChart
Reply #1 - Nov 1st, 2007 at 11:16am
Print Post  
drawShadows is implemented like this -

Code
Select All
private void drawShadows(Graphics2D g, Rectangle2D rc, boolean exclModf)
{
	// iterate all types of items
	for (Item item: zOrder)
	{
	Rectangle2D rcObj = item.getRepaintRect(false);
	if (!rcObj.intersects(rc)) continue;
	if (!(exclModf && item.getModifying()))
		item.draw(g, true);
	}
}
 



You can get such exception if you delete a flowchart element while this method executes, either from a second thread or from some custom-draw event handler.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: NoSuchElement exception on FlowChart
Reply #2 - Nov 1st, 2007 at 1:24pm
Print Post  
I have a command chart.clearAll() that may be responsible for the items removal.
The problem is that I can't control if another thread refreshes the flowChart or not during that time.
Shouldn't the exception be caught and the method abandoned if this happened? In that case it is ok to fail repaint.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint