Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SwimlaneLayout - empty lanes disappear (Read 2142 times)
tom_w
Junior Member
**
Offline


Swimlanes made our dreams
come true :-)

Posts: 79
Joined: Oct 20th, 2008
SwimlaneLayout - empty lanes disappear
May 23rd, 2013 at 3:57pm
Print Post  
Hi there

In our swimlane diagrams, all empty lanes after the last lane with a node in are being hidden.

So, for example, if we have a diagram with 7 lanes, and only lanes 1 and 4 have nodes in then four lanes (1 to 4) will be shown and the last three lanes (5 - 7) will not.

If I then add a node to lane 7 via code and arrange the diagram again all seven lanes will be shown.

I have set SwimLaneLayout.CollapseEmptyLanes = False, but this hasn't solved it. Is there anything else I should be doing?

We are on version 5.7.0.25314 and ideally wouldn't change at the moment.
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: SwimlaneLayout - empty lanes disappear
Reply #1 - May 24th, 2013 at 7:20am
Print Post  
Hi,

It appears that the layout removes the empty lanes beyond the last occupied lane in the grid. You can create a temporary node located in the last lane in your grid during the layout process. Alternatively, you can create a custom ISwimlaneGrid object, which ignores the calls to SetRowCount and SetColumnCount methods. Below is a sample implementation of this interface:

Code
Select All
public class LaneGrid : ISwimlaneGrid
{
	public LaneGrid(Grid grid)
	{
		this.grid = grid;
	}

	public void SetRowCount(int value)
	{
		if (value >= grid.RowCount)
			grid.RowCount = value;
	}

	public void SetColumnCount(int value)
	{
		if (value >= grid.ColumnCount)
			grid.ColumnCount = value;
	}

	public int GetRowCount()
	{
		return grid.RowCount;
	}

	public int GetColumnCount()
	{
		return grid.ColumnCount;
	}

	public void SetRowHeight(int index, float value)
	{
		grid.RowHeaders[index].Height = value;
	}

	public void SetColumnWidth(int index, float value)
	{
		grid.ColumnHeaders[index].Width = value;
	}

	public float GetRowHeight(int index)
	{
		return grid.RowHeaders[index].Height;
	}

	public float GetColumnWidth(int index)
	{
		return grid.ColumnHeaders[index].Width;
	}

	public void SetLeftMargin(float value)
	{
		grid.LeftMargin = value - grid.GetRowHeaderBounds().Width;
	}

	public void SetTopMargin(float value)
	{
		grid.TopMargin = value - grid.GetColumnHeaderBounds().Height;
	}


	private Grid grid;
} 


You can instruct the layout to use this swimlane grid like this:

Code
Select All
layout.SwimlaneGrid = new LaneGrid(diagram.LaneGrid); 


Regards,
Meppy
  
Back to top
 
IP Logged
 
tom_w
Junior Member
**
Offline


Swimlanes made our dreams
come true :-)

Posts: 79
Joined: Oct 20th, 2008
Re: SwimlaneLayout - empty lanes disappear
Reply #2 - May 24th, 2013 at 1:57pm
Print Post  
Hi Meppy

Thanks for responding so quickly.

The first solution didn't work for me, the activities were no longer in their lanes, or possibly the grid was zoomed but the activities weren't? (see attached screen grab).

I tried adding a node to the last name, but I would need the node to be invisible and non-selectable so the users don't wonder what it is. When I set the node.visible = false then it no longer worked in making the lanes show. Any suggestions on what I can do to fix this?
  

activities_not_in_lanes.JPG (Attachment deleted)
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: SwimlaneLayout - empty lanes disappear
Reply #3 - May 24th, 2013 at 8:56pm
Print Post  
Hi,

Try creating the node just before running the layout and remove it right after the layout has completed. The node should not appear on screen even if you don't make it invisible.

Regards,
Meppy
  
Back to top
 
IP Logged
 
tom_w
Junior Member
**
Offline


Swimlanes made our dreams
come true :-)

Posts: 79
Joined: Oct 20th, 2008
Re: SwimlaneLayout - empty lanes disappear
Reply #4 - May 31st, 2013 at 12:56pm
Print Post  
Hi Meppy,

That fixed it, many thanks
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint