Class Lane
Represents a lane in a swimlane, which is a functional unit or responsible department within a business process.
Inherited Members
Namespace: Syncfusion.Blazor.Diagram
Assembly: Syncfusion.Blazor.dll
Syntax
public class Lane : SwimlaneChild, IDiagramObject, ICloneable
Remarks
A lane helps to map and define a specific part of the process within the functional unit or between multiple functional units. Lanes are typically used in swimlanes to visually organize and allocate tasks or activities to different individuals or groups.
Examples
The following example demonstrates how to add a lane to a swimlane:
<SfDiagramComponent Height="600px" Width="90%" Swimlanes="@swimlaneCollections">
</SfDiagramComponent>
@code {
DiagramObjectCollection<Swimlane> swimlaneCollections = new DiagramObjectCollection<Swimlane>();
protected override void OnInitialized()
{
Node node1 = new Node()
{
ID = "node1",
Height = 100,
Width = 100,
OffsetX = 100,
OffsetY = 100,
};
Node node2 = new Node()
{
ID = "node2",
Height = 100,
Width = 100,
OffsetX = 300,
OffsetY = 100,
};
swimlaneCollections = new DiagramObjectCollection<Swimlane>()
{
new Swimlane()
{
ID = "swimlane1",
Orientation = Orientation.Horizontal,
Height = 200,
Width = 450,
Lanes = new DiagramObjectCollection<Lane>()
{
new Lane()
{
Header = new SwimlaneHeader ()
{
Annotation = new Annotation()
{
Content = "Header of lane"
}
},
Height = 100,
Children = new DiagramObjectCollection<Node>()
{
node1, node2
}
}
}
}
};
}
}
Constructors
Lane()
Declaration
public Lane()
Lane(Lane)
Declaration
public Lane(Lane src)
Parameters
Type | Name | Description |
---|---|---|
Lane | src |
Properties
Children
Gets or sets the collection of child nodes in the lane.
Declaration
public DiagramObjectCollection<Node> Children { get; set; }
Property Value
Type |
---|
DiagramObjectCollection<Node> |
Header
Gets or sets the header of the lane.
Declaration
public SwimlaneHeader Header { get; set; }
Property Value
Type |
---|
SwimlaneHeader |
Remarks
The header defines the title of the lane.
Examples
The following example demonstrates how to set the header of a lane:
<SfDiagramComponent Height="600px" Width="90%" Swimlanes="@swimlaneCollections">
</SfDiagramComponent>
@code {
DiagramObjectCollection<Swimlane> swimlaneCollections = new DiagramObjectCollection<Swimlane>();
protected override void OnInitialized()
{
Node node1 = new Node()
{
ID = "node1",
Height = 100,
Width = 100,
OffsetX = 100,
OffsetY = 100,
};
Node node2 = new Node()
{
ID = "node2",
Height = 100,
Width = 100,
OffsetX = 300,
OffsetY = 100,
};
swimlaneCollections = new DiagramObjectCollection<Swimlane>()
{
new Swimlane()
{
ID = "swimlane1",
Orientation = Orientation.Horizontal,
Height = 200,
Width = 450,
Lanes = new DiagramObjectCollection<Lane>()
{
new Lane()
{
Header = new SwimlaneHeader ()
{
Annotation = new Annotation()
{
Content = "Header of lane"
}
},
Height = 100,
Children = new DiagramObjectCollection<Node>()
{
node1, node2
}
}
}
}
};
}
}
Orientation
Gets or sets the orientation of the Lane.
Declaration
public Orientation Orientation { get; set; }
Property Value
Type | Description |
---|---|
Orientation | The orientation of the Lane. |
Remarks
The orientation specifies whether the lane is displayed horizontally or vertically. This property is applicable only when the lane is added to a SymbolPalette.
Examples
The following example demonstrates how to set the orientation of a Lane:
<SfSymbolPaletteComponent Width="100%" Height="1000px" Palettes="@Palettes" SymbolHeight="50"
SymbolWidth="50"></SfSymbolPaletteComponent>
@code {
DiagramObjectCollection<Palette> Palettes = new DiagramObjectCollection<Palette>();
protected override void OnInitialized()
{
//horizontal lane
Lane horizontalLane = new Lane() { Orientation = Orientation.Horizontal };
//vertical lane
Lane verticalLane = new Lane() { Orientation = Orientation.Vertical };
DiagramObjectCollection<Nodebase> SymbolCollection = new DiagramObjectCollection<Nodebase>(){
horizontalLane , verticalLane };
Palettes = new DiagramObjectCollection<Palette>()
{
new Palette(){Symbols =SymbolCollection,Title="Swimlane Shapes" },
}
}
}
Style
Gets or sets the style of the lane.
Declaration
public ShapeStyle Style { get; set; }
Property Value
Type | Description |
---|---|
ShapeStyle | The style of the lane. |
Remarks
Use this property to apply custom styling to the lane, such as background color, stroke color, or stroke dash array.
Examples
The following example demonstrates how to set the style of a lane:
<SfDiagramComponent Height="600px" Width="90%" Swimlanes="@swimlaneCollections">
</SfDiagramComponent>
@code {
DiagramObjectCollection<Swimlane> swimlaneCollections = new DiagramObjectCollection<Swimlane>();
protected override void OnInitialized()
{
swimlaneCollections = new DiagramObjectCollection<Swimlane>()
{
new Swimlane()
{
ID = "swimlane1",
Orientation = Orientation.Horizontal,
Height = 200,
Width = 450,
Lanes = new DiagramObjectCollection<Lane>()
{
new Lane()
{
Header = new SwimlaneHeader ()
{
Annotation = new Annotation()
{
Content = "Header of lane"
}
},
Style = new ShapeStyle()
{
Fill = "lightblue",
Stroke = "black",
StrokeWidth = 2,
Shadow = new ShadowStyle()
{
Color = "gray",
Blur = 5,
OffsetX = 2,
OffsetY = 2
}
},
Width = 450
}
}
}
};
}
}
Methods
Clone()
Creates a new Lane that is a copy of the current Lane.
Declaration
public override object Clone()
Returns
Type | Description |
---|---|
System.Object | A new Lane object that is a copy of this Lane. |