Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) swimlane layout (Read 7432 times)
Michael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Joined: Nov 9th, 2012
swimlane layout
Nov 9th, 2012 at 2:39pm
Print Post  
Hi every body
I have a Problem with swimlane layout. I’m trying to get a layout with three Columns and one Row that has the size off 100%. That I wound to split up my nodes between these three Columns. But when I create the lanes it creates me something between the Colum Header and the first row => looks like empty space => please see attached file swimlane.png.
And when I use a FlowLayout to Arrange the Items. My Diagram looks like on the swimlane.png
What I’m doing wrong? Is there any Body how can send me an example for this?
I'm running on Version 5.3.2.23276
My Code for the Flow Layout
[size=9]FlowLayout fl = new FlowLayout();
fl.LayoutRules.PreferredRules = PreferredRules.ConnectorRules;
fl.LayoutRules.ConnectorRules.UpOriented = new string[] { "NN" };
fl.LaneType = LaneType.LaneGrid;
fl.LayoutRules.NodeRules.GroupStartNodes = new string[] { "Start" };
fl.AutoRoute = true;
fl.HorizontalGroupOffset = 8;
fl.VerticalGroupOffset = 2;
fl.NodeDistance = 5;
fl.LevelOffset = 5;
fl.ChangeLaneDimensions = true;
fl.LayoutRules.NodeRules.MainConnectorOrientation = SimpleOrientation.LeftToRight;
fl.Arrange(diagramView1.Diagram);[/size]
Best regards
Michael
  

swimlane.png (Attachment deleted)
swimlane2.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: swimlane layout
Reply #1 - Nov 12th, 2012 at 10:26am
Print Post  
Quote:
looks like empty space


Set diagram.LaneGrid.HookHeaders = false to remove that space.

To arrange nodes along lanes, set their LayoutTraits[SwimlaneLayoutTraits.Lane] to the index of the respective lane, and run SwimlaneLayout.

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


I Love MindFusion!

Posts: 17
Joined: Nov 9th, 2012
Re: swimlane layout
Reply #2 - Nov 12th, 2012 at 12:24pm
Print Post  
Hi Stoyan
thank you for the replay. But I'm always using the HookHeader and SwimlaneLayoutTraits.Lane.
Here is the complete Code I’m running maybe there is something else wrong.
Best regards Michael

this.diagramView1.BackColor = System.Drawing.Color.White;
this.diagramView1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center;
this.diagramView1.Behavior = MindFusion.Diagramming.Behavior.Modify;
this.diagramView1.ControlHandlesStyle = MindFusion.Diagramming.HandlesStyle.HatchHandles;
this.diagramView1.ControlMouseAction = MindFusion.Diagramming.ControlMouseAction.SelectNode;
this.diagramView1.DelKeyAction = MindFusion.Diagramming.DelKeyAction.DeleteSelectedItems;
this.diagramView1.Diagram = this.diagram1;
this.diagramView1.Dock = System.Windows.Forms.DockStyle.Fill;
this.diagramView1.Location = new System.Drawing.Point(0, 0);
this.diagramView1.MiddleButtonActions = MindFusion.Diagramming.MouseButtonActions.None;
this.diagramView1.ModificationStart = MindFusion.Diagramming.ModificationStart.SelectedOnly;
this.diagramView1.RightButtonActions = MindFusion.Diagramming.MouseButtonActions.Cancel;
this.diagramView1.TabIndex = 7;
this.diagramView1.Text = "";
this.diagram1.BackBrush = new MindFusion.Drawing.SolidBrush("#FFE2E2E2");

Grid grid = diagram1.LaneGrid;
HeaderCollection columns = grid.ColumnHeaders;

grid.MinHeaderSize = 8;
grid.HookHeaders = false;
grid.HeadersOnTop = false;
grid.ColumnHeadersHeights = new float[] { 8, 8 };
grid.AlignCells = false;
grid.AllowResizeHeaders = true;
columns.Add(new Header("System Elements") { Width = 100f, Height=70 });
columns.Add(new Header("Function") { Width = 100f, Height = 70 });
columns.Add(new Header("Defect") { Width = 100f, Height = 70 });
grid.RowHeaders.Add(new Header("") { Height = 300f});
grid.AlignCells = true;

diagram1.EnableLanes = true;
diagram1.AlignToGrid = false;

ControlNode SSE = CreateSystemElement("Test FMEA MIK", true);
SSE.LayoutTraits.Add(MindFusion.Layout.FlowLayoutTraits.Lane, 0);
SSE.LayoutTraits[FlowLayoutTraits.LogicID] = "NotSpecified";


private ControlNode CreateSystemElement(string header, bool IsSystem)
{
//PointF location = new PointF(30, 30);
// SizeF size = new SizeF(47f, 88f);

ControlNode node = new ControlNode(diagram1);
SystemElement tc = new SystemElement(node, header, IsSystem);
//node.Bounds = new RectangleF(location.X, location.Y, size.Width, size.Height);
node.Control = (Control)tc;
node.ControlMouseAction = ControlMouseAction.IgnoreControl;
node.Brush = new MindFusion.Drawing.SolidBrush(Color.White);

node.ForceControlRedraw = true;
tc.setupStartSize();
diagram1.Nodes.Add(node);
tc.OpenCloseChange += new EventHandler(RouteAllLinks);
tc.LocationChanged += new EventHandler(RouteAllLinks);
return node;
}

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: swimlane layout
Reply #3 - Nov 12th, 2012 at 3:05pm
Print Post  
Hi,

I am talking about the SwimlaneLayout class and respective traits enumeration, it is not the same as FlowLayout. You can set SwimlaneLayout.Orientation to Vertical to make it treat grid columns as lanes, while that's not supported in FlowLayout. So using SwimlaneLayout, set nodes' SwimlaneLayoutTraits.Lane to the respective column number and it should work.

Regarding space between headers to cells, check is HookHeaders is not enabled later, or it's not loaded as true from an older diagram file.

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


I Love MindFusion!

Posts: 17
Joined: Nov 9th, 2012
Re: swimlane layout
Reply #4 - Nov 12th, 2012 at 3:58pm
Print Post  
Where can I find this SwimlaneLayout (Namespace, DLL)???
I have a reference to all Mindfusion DLLs but there is now SwimlaneLayout. Or is this a Problem from the Version 5.3.2.23276?
Where can I find an Example for this?
Best regards
Michael
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: swimlane layout
Reply #5 - Nov 12th, 2012 at 5:07pm
Print Post  
SwimlaneLayout is not available in V5.3. If you install latest version, it is demonstrated in the ProcessLayout sample project (which did show FlowLayout in older versions). FlowLayout does not support vertical layouts even in newer releases.

Best regards,
Stoyan
  
Back to top
 
IP Logged
 
Michael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Joined: Nov 9th, 2012
Re: swimlane layout
Reply #6 - Nov 12th, 2012 at 7:17pm
Print Post  
ok then I first have to bye an update to the newes Version
thx for the Help
  
Back to top
 
IP Logged
 
Michael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Joined: Nov 9th, 2012
Re: swimlane layout
Reply #7 - Nov 22nd, 2012 at 12:05pm
Print Post  
Hi Stoyan
I'm back and I'm nearly there. The only Problem that is left is that my first node start in the Header like you can see on the Screenshot. Is there a Way to tell the node to move down a bit?
  

screen_001.jpg (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: swimlane layout
Reply #8 - Nov 22nd, 2012 at 2:41pm
Print Post  
Could you attach the saved diagram as xml file and post your layout code? I can't see this happening with the default layout settings and only layout.Orientation set to Vertical.
  
Back to top
 
IP Logged
 
Michael
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 17
Joined: Nov 9th, 2012
Re: swimlane layout
Reply #9 - Nov 22nd, 2012 at 2:59pm
Print Post  
Here the Export and the Layout Code

if (layout == null)
{
layout = new SwimlaneLayout();
layout.Anchoring = Anchoring.Ignore;
layout.CollapseEmptyLanes = false;
layout.CompactNodes = false;
layout.Direction = Direction.Straight;
layout.KeepGroupLayout = false;
layout.KeepLaneSizes = true;
layout.LaneDistance = 100;
layout.NodeDistance = 20;
layout.Orientation = MindFusion.Diagramming.Layout.Orientation.Vertical;
layout.Margins = new Size(
(int)diagram1.LaneGrid.GetRowHeaderBounds().Width,
(int)diagram1.LaneGrid.GetColumnHeaderBounds().Height);
}
layout.Arrange(diagram1);

Regards Michael
  

DiagramExport.zip (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: swimlane layout
Reply #10 - Nov 22nd, 2012 at 4:49pm
Print Post  
This seems to happen because of HookHeaders, now the headers overlap the upper part of the grid because of Y scroll offset. It should look ok if you disable HookHeaders. Also try setting diagram1.LaneGrid.ColumnHeadersHeights = new float[] { 8 } to remove the space between headers and grid.

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


I Love MindFusion!

Posts: 17
Joined: Nov 9th, 2012
Re: swimlane layout
Reply #11 - Nov 26th, 2012 at 2:38pm
Print Post  
Hi Stoyan,
Disable the HookHeaders is not an Option because this removes the Header completely. And the diagram1.LaneGrid.ColumnHeadersHeights = new float[] { 8 } has no effect. Sad
Regards Michael

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: swimlane layout
Reply #12 - Nov 26th, 2012 at 3:12pm
Print Post  
Hi,

Your diagram.Bounds starts from 13 and the header is hidden above the top boundary if you disable HookHeaders. Set Bounds to a rectangle with origin at 0,0 and the header will be visible. If the diagram starts from 0, the header will be visible with HookHeaders too and will not overlap the nodes when at top scroll position.

Alternatively you can make the layout class move the whole grid down the diagram by setting its Margin:

Code
Select All
diagram.LaneGrid.ColumnHeadersHeights = new float[] { 8 };
SwimlaneLayout l = new SwimlaneLayout();
l.Orientation = MindFusion.Diagramming.Layout.Orientation.Vertical;
l.Margins = new SizeF(
  diagram.LaneGrid.GetRowHeaderBounds().Width + diagram.Bounds.X,
  diagram.LaneGrid.GetColumnHeaderBounds().Height + diagram.Bounds.Y);
l.Arrange(diagram); 



That too should make the headers visible and not overlapping nodes when HookHeaders is disabled or if it's enabled and the diagram is not scrolled.

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


I Love MindFusion!

Posts: 17
Joined: Nov 9th, 2012
Re: swimlane layout
Reply #13 - Dec 3rd, 2012 at 1:01pm
Print Post  
Stoyan has solved the problem! I used the Funktion
diagramView1.Diagram.ResizeToFitItems(3.0f);
wish let the Header disappear.
I changed this with the following code Stoyan has given to me.
var content = diagramView1.Diagram.GetContentBounds(false, false);
content.Location = new PointF(0, 0);
diagramView1.Diagram.Bounds = content;

Many thanks to Stoyan for the Support.

Customer == Happy Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint