Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic SwimLane Layout CollapseEmptyLanes = false not working (Read 3806 times)
binuvc
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 46
Joined: Nov 7th, 2011
SwimLane Layout CollapseEmptyLanes = false not working
Apr 27th, 2012 at 10:30am
Print Post  
Hi,

While applying a swimlane layout, we have explictly specified

layout.CollapseEmptyLanes = false

But still the empty lanes are getting collapsed.

Following is the layout apply code

    SwimlaneLayout layout = new SwimlaneLayout();
            layout.Anchoring = Anchoring.Ignore;
            layout.CollapseEmptyLanes = false;
            layout.CompactNodes = false;
            layout.Direction = MindFusionLayout.Direction.Straight;
            layout.KeepGroupLayout = false;
            layout.KeepLaneSizes = true;
            layout.LaneDistance = 150;            
            layout.NodeDistance = 50;
            layout.Orientation = MindFusionLayout.Orientation.Horizontal;            

            layout.Margins = new Size(
                     diagramLite.LaneGrid.GetRowHeaderBounds().Width,
                     diagramLite.LaneGrid.GetColumnHeaderBounds().Height);
          
            layout.Arrange(diagramLite);
 
            var rect = diagramLite.LaneGrid.GetColumnHeaderBounds();
            rect.Union(diagramLite.LaneGrid.GetRowHeaderBounds());
            diagramLite.Bounds = rect;

Please advice

Thanks
BinyVC
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: SwimLane Layout CollapseEmptyLanes = false not working
Reply #1 - Apr 27th, 2012 at 1:21pm
Print Post  
Hi,

Can you attach a small sample illustrating the collapsing lanes? I am trying to reproduce this bug, but it appears to work as expected.

Regards,
Meppy
  
Back to top
 
IP Logged
 
binuvc
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 46
Joined: Nov 7th, 2011
Re: SwimLane Layout CollapseEmptyLanes = false not working
Reply #2 - Apr 27th, 2012 at 1:32pm
Print Post  
Hi,


I just debug the code and found that in the above listed code, the number of LaneGrid.RowCount is 7( 5 has nodes associated with it) and after the arrange method is executed, the LaneGrid.RowCount is 5. looks like the 2 lanes with no associated nodes are not incuded. But if I add a node to each lane, it works as expected

I am using 2.3.0.16641 trial version of diagramlite.


Thanks
BinuVC
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: SwimLane Layout CollapseEmptyLanes = false not working
Reply #3 - Apr 27th, 2012 at 2:01pm
Print Post  
This is actually by design. The empty rows at the end are removed by the swimlane layout. One way to avoid this is to add invisible nodes to these rows. Another solution would be to use a custom swimlane grid that ignores the call that sets the row count. Here is a sample implementation of such grid:

Code
Select All
class SwimlaneGrid : ISwimlaneGrid
{
	public SwimlaneGrid(MindFusion.Diagramming.Silverlight.Lanes.Grid laneGrid)
	{
		this.laneGrid = laneGrid;
	}

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

	public double GetColumnWidth(int index)
	{
		return laneGrid.ColumnHeaders[index].Width;
	}

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

	public double GetRowHeight(int index)
	{
		return laneGrid.RowHeaders[index].Height;
	}

	public void SetColumnCount(int value)
	{
		// Do nothing to prevent columns from being dropped
	}

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

	public void SetLeftMargin(double value)
	{
		laneGrid.LeftMargin = value - laneGrid.GetRowHeaderBounds().Width;
	}

	public void SetRowCount(int value)
	{
		// Do nothing to prevent rows from being dropped
	}

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

	public void SetTopMargin(double value)
	{
		laneGrid.TopMargin = value - laneGrid.GetColumnHeaderBounds().Height;
	}

	private MindFusion.Diagramming.Silverlight.Lanes.Grid laneGrid;
} 


To associate this grid with the layout, use the following line:

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


Keep in mind that the last solution will not work with all layout settings.

I hope this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
binuvc
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 46
Joined: Nov 7th, 2011
Re: SwimLane Layout CollapseEmptyLanes = false not working
Reply #4 - Apr 27th, 2012 at 4:29pm
Print Post  
Many Thanks !!



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