Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic FlowcharLayout problem ? (Read 4330 times)
Marcelo_Saccone
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Feb 4th, 2010
FlowcharLayout problem ?
Feb 4th, 2010 at 6:29pm
Print Post  
Hi,

I'm getting this exception

java.lang.NullPointerException
at com.mindfusion.common.Helper.as(Unknown Source)
at com.mindfusion.diagramming.jlayout.FlowchartLayout.arrange(Unknown Source)
at com.mindfusion.diagramming.FlowchartLayout.arrange(Unknown Source)
at com.mindfusion.diagramming.AbstractLayout.arrange(Unknown Source)
at org.apache.jsp.index_jsp.onFlowchartLayout(index_jsp.java:149)

My source code, based on your JSP example is

diagram.setShapeBrush(new SolidBrush(new Color(255, 255, 255)));

Factory factory = diagram.getFactory();

ShapeNode node0 = factory.createShapeNode(1, 1, 30, 20);
node0.setText("0");
node0.setTextFormat(new TextFormat(Align.Center, Align.Far));
node0.setTransparent(false);

ShapeNode node1 = factory.createShapeNode(1, 1, 30, 20);
node1.setText("1");
node1.setTextFormat(new TextFormat(Align.Center, Align.Far));
node1.setTransparent(false);
factory.createDiagramLink(node0, node1);

ShapeNode node2 = factory.createShapeNode(1, 1, 30, 20);
node2.setText("2");
node2.setTextFormat(new TextFormat(Align.Center, Align.Far));
node2.setTransparent(false);
factory.createDiagramLink(node1, node2);

ShapeNode node3 = factory.createShapeNode(1, 1, 30, 20);
node3.setText("3");
node3.setTextFormat(new TextFormat(Align.Center, Align.Far));
node3.setTransparent(false);
factory.createDiagramLink(node2, node3);

for(int i=0;i<10;i++){
ShapeNode node4 = factory.createShapeNode(1, 1, 30, 20);
node4.setText(String.valueOf(4+i));
node4.setTextFormat(new TextFormat(Align.Center, Align.Far));
node4.setTransparent(false);
factory.createDiagramLink(node3, node4);
}

ShapeNode node5 = factory.createShapeNode(1, 1, 30, 20);
node5.setText("14");
node5.setTextFormat(new TextFormat(Align.Center, Align.Far));
node5.setTransparent(false);

DiagramNodeList nodes = diagram.getNodes();
int nodeCount = nodes.size();

for(int i=nodeCount-1;i>=(nodeCount-10);i--){
DiagramNode nodei = nodes.get(i-1);
factory.createDiagramLink(nodei, node5);
}

for(int i=0;i<10;i++){
ShapeNode node6 = factory.createShapeNode(1, 1, 30, 20);
node6.setText(String.valueOf(i+nodeCount));
node6.setTextFormat(new TextFormat(Align.Center, Align.Far));
node6.setTransparent(false);
factory.createDiagramLink(node5, node6);
}

ShapeNode node7 = factory.createShapeNode(1, 1, 30, 20);
node7.setText("25");
node7.setTextFormat(new TextFormat(Align.Center, Align.Far));
node7.setTransparent(false);

nodeCount = nodes.size();

for(int i=nodeCount-1;i>=(nodeCount-10);i--){
DiagramNode nodei = nodes.get(i-1);
factory.createDiagramLink(nodei, node7);
}

ShapeNode node8 = factory.createShapeNode(1, 1, 30, 20); // ERROR

factory.createDiagramLink(node7, node8); // ERROR

FlowchartLayout fl = new FlowchartLayout();
fl.arrange(diagram);

Everyting works fine, until I added those lines marked with // ERROR

The same code without those lines has no problems. Also, other layouts like Tree, Orthogonal, Anneal works fine (including the lines)

Including one more node below node 14, and modifying links located in the iterator, to this new node, it also works.

Any help would be appreciated.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowcharLayout problem ?
Reply #1 - Feb 5th, 2010 at 9:22am
Print Post  
Hi,

Our layout developer will try to fix this next week.

Stoyan
  
Back to top
 
IP Logged
 
Marcelo_Saccone
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Feb 4th, 2010
Re: FlowcharLayout problem ?
Reply #2 - Feb 5th, 2010 at 11:14am
Print Post  
Thanks Stoyan!!!

I'll be waiting for this fix.-
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowcharLayout problem ?
Reply #3 - Feb 11th, 2010 at 12:38pm
Print Post  
Hi Marcelo,

This version should fix that:
https://mindfusion.eu/_beta/jdiag301.zip

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Marcelo_Saccone
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Feb 4th, 2010
Re: FlowcharLayout problem ?
Reply #4 - Feb 11th, 2010 at 3:39pm
Print Post  
Stoyan, thanks for your reply.

I've just verify this versión, and it also has this issue.

With the dummy node works fine, but the Flowchart Layout throws an exception without this node

java.lang.NullPointerException
com.mindfusion.common.Helper.as(Unknown Source)
com.mindfusion.diagramming.jlayout.FlowchartLayout.arrange(Unknown Source)
com.mindfusion.diagramming.FlowchartLayout.arrange(Unknown Source)
com.mindfusion.diagramming.AbstractLayout.arrange(Unknown Source)
org.apache.jsp.index_jsp.onFlowchartLayout(index_jsp.java:171)


Could you check it again?

Thanks in advance.-
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: FlowcharLayout problem ?
Reply #5 - Feb 11th, 2010 at 3:52pm
Print Post  
It works fine here. Try restarting apache in case it keeps a cached .war file with an older JDiagram.

Stoyan
  
Back to top
 
IP Logged
 
Marcelo_Saccone
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 4
Joined: Feb 4th, 2010
Re: FlowcharLayout problem ?
Reply #6 - Feb 11th, 2010 at 4:04pm
Print Post  
Thks Stoyan, you're absolutly right.

It was my mistake!  I copied the jar in the wrong folder.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint