Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic OverflowException using SpringLayout + NoWrap (Read 2612 times)
Alex.kg
YaBB Newbies
*
Offline



Posts: 7
Joined: May 21st, 2009
OverflowException using SpringLayout + NoWrap
May 21st, 2009 at 3:15am
Print Post  
The code below throws OverflowException when trying to expand ShapeNode:

[code]
MindFusion.Diagramming.Layout.SpringLayout _diagramLayout;

private void Form1_Load ( object sender, EventArgs e )
{
_diagramLayout = new MindFusion.Diagramming.Layout.SpringLayout ( 100, 15, true, true );
_diagramLayout.MultipleGraphsPlacement = MindFusion.Diagramming.Layout.MultipleGraphsPlacement.Horizontal;

ShapeNode center = createDomainShape ( "center" );

}

private ShapeNode createDomainShape ( string name )
{
ShapeNode b = view2D.Diagram.Factory.CreateShapeNode ( 1F, 1F, 10F, 8F );
b.Expandable = true;
b.Expanded = false;

b.EnableStyledText = true;
b.TextFormat.FormatFlags = StringFormatFlags.NoWrap;
b.Text = String.Format ( "<b>{0}</b>", name );

b.ResizeToFitText ( FitSize.KeepHeight );

return b;

}

private void _diagram_ExpandButtonClicked ( object sender, NodeEventArgs e )
{
for ( int i = 0; i < 19; i++ )
{
ShapeNode nested = createDomainShape ( String.Format ( "Nested #{0}", i ) );
DiagramLink dlink = _diagram.Factory.CreateDiagramLink ( e.Node, nested );
}

if ( _diagramLayout != null && _diagram.Nodes.Count > 0 )
_diagramLayout.Arrange ( _diagram );
}
[/code]

[b]To reproduce the error please to the following:[/b]
- create new WinForms project
- open 'Form1'
- paste the code above to 'Form1.cs' file
- assign handler 'Form1_Load ' to 'Form.OnLoad' event
- put on form Mindfusion.DiagramView
- set ExpandButtonAction = RaiseEvents
- assign handler '_diagram_ExpandButtonClicked' to 'Diagram.ExpandButtonClicked' event
- run application
- expand node 'Center'

[b]Mindfusion's assemblies version:[/b]
MindFusion.Diagramming                   5.2.1.22983
MindFusion.Diagramming.WinForms   5.2.1.22984
MindFusion.Common                          1.2.3368.20041



[b]Note[/b]
If code below is commented then all is working expectedly:
[code]b.EnableStyledText = true;
b.TextFormat.FormatFlags = StringFormatFlags.NoWrap;[/code]

Also if count of created nested nodes less than 15 then exception is not thrown too.

Please let me know if you unable reproduce the error, I'll provide more details.

Thanks,
Alex
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: OverflowException using SpringLayout + NoWrap
Reply #1 - May 21st, 2009 at 1:33pm
Print Post  
Hi Alex,

This version should work:
https://mindfusion.eu/_beta/fcnet_sl.zip

Stoyan
  
Back to top
 
IP Logged
 
Alex.kg
YaBB Newbies
*
Offline



Posts: 7
Joined: May 21st, 2009
Re: OverflowException using SpringLayout + NoWrap
Reply #2 - May 21st, 2009 at 4:36pm
Print Post  
Hi Stoyan,

This fix works great!

Thank you for the quick update.

Provided by the link fix contains trial libraries, how can I get licensed libraries with included fix( as now I already have licensed libraries)?


Thanks,
Alex
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: OverflowException using SpringLayout + NoWrap
Reply #3 - May 22nd, 2009 at 7:32am
Print Post  
Hi Alex,

Email your company name to support@mindfusion.eu and we'll send you the updated assemblies.

Thanks,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint