Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Problem loading Diagram from XML (Read 4466 times)
AR
Junior Member
**
Offline


I Love MindFusion!

Posts: 65
Joined: Jan 23rd, 2015
Problem loading Diagram from XML
Apr 30th, 2015 at 3:03pm
Print Post  
I've added a ControlNode containing a JButton to my Diagram.

When I first load the diagram everything is fine (loadFromXML() is called and returns).

However if I make a change, save the diagram (to XML, which is stored in a database) then call loadFromXML() the call does not return, and does not write any logging details I can find. I have to kill my applet. Sad

Have you any ideas about why this might be happening? What I can do to prevent it?

Copy of the XML (in a text file) is attached in case that tells you anything (I have removed some images, but these don't cause the problem as I have used them without problems on other diagrams)
  

diagram_002.txt ( 35 KB | 155 Downloads )
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem loading Diagram from XML
Reply #1 - Apr 30th, 2015 at 4:44pm
Print Post  
Do you mean Java applet running in browser? Check if it shows any errors in the Java console. The Java plugin applies some memory limits by default, so if you see out-of-memory or stack-overflow errors, you will need to allot more memory for the applet. You can find that discussed here:
http://mindfusion.eu/Forum/YaBB.pl?num=1309530790/16#16
  
Back to top
 
IP Logged
 
AR
Junior Member
**
Offline


I Love MindFusion!

Posts: 65
Joined: Jan 23rd, 2015
Re: Problem loading Diagram from XML
Reply #2 - May 6th, 2015 at 12:28pm
Print Post  
I'm running the applet within the 'applet viewer' of my IDE (IntelliJ IDEA) and I believe all logging which would normally go to the plug-in console is displayed in the IDE console - and there is nothing written there Sad

Task Manager indicates that the 'applet' process is using 190896K of private working memory after several minutes of 'hanging', when I finally decide to kill it. This memory usage doesn't seem excessive to me.

I am using Java 1.7 (64bit) to run the applet.

A diagram without the button, even with quite a lot of nodes and links causes no problems.

A diagram with the button, only 2 nodes and no links fails to load from XML as previously described.

I use Log4j for logging - is there any logging I can 'turn on' for JDiagram that might help us track down the problem?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Problem loading Diagram from XML
Reply #3 - May 6th, 2015 at 9:23pm
Print Post  
It seems to work correctly in my tests, loading the xml multiple times from both Swing application and applet running in browser. Does this work on your system?
http://mindfusion.eu/_samples/AppletXml/index.html

I had to replace your custom class identifiers in the XML with standard node and component types though.

Are you using the built-in DiagramApplet class, or your own applet hosting a DiagramView? Also do you really need that button to be a node in the diagram? If all diagrams of yours will support "change view" operation, it would be better if you just create a button as applet's child control placed over the DiagramView (e.g. using absolute layout coordinates).
  
Back to top
 
IP Logged
 
AR
Junior Member
**
Offline


I Love MindFusion!

Posts: 65
Joined: Jan 23rd, 2015
Re: Problem loading Diagram from XML
Reply #4 - May 7th, 2015 at 9:43am
Print Post  
Yes your link worked fine.

The diagram is hosted within an applet which does a lot of other things too.

I'll try putting the 'change view' functionality elsewhere as you suggest - all diagrams (subject to data availability) need to support 'change view' and any given diagram can change whether 'change view' is supported if the user changes some data!!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint