mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-04-13 11:26:34 +08:00
1. 重新设计了Generate项目及相关特性的命名,避免与其他类型混淆。
2. 补充了部分注释。 3. 修改了删除容器节点时,容器内子节点未正确删除的问题。
This commit is contained in:
@@ -35,7 +35,7 @@ namespace Serein.Workbench.Node.View
|
||||
/// </summary>
|
||||
public class ConnectionLineShape : Shape
|
||||
{
|
||||
private readonly double strokeThickness;
|
||||
//private readonly double strokeThickness;
|
||||
|
||||
private readonly LineType lineType;
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace Serein.Workbench.Node.View
|
||||
/// <param name="end">结束坐标</param>
|
||||
/// <param name="brush">颜色</param>
|
||||
/// <param name="isDotted">是否为虚线</param>
|
||||
/// <param name="isTop">元素是否在画布上置顶</param>
|
||||
public ConnectionLineShape(LineType lineType,
|
||||
Point start,
|
||||
Point end,
|
||||
@@ -58,7 +59,7 @@ namespace Serein.Workbench.Node.View
|
||||
this.brush = brush;
|
||||
startPoint = start;
|
||||
endPoint = end;
|
||||
this.strokeThickness = 4;
|
||||
//this.strokeThickness = 4;
|
||||
InitElementPoint(isDotted, isTop);
|
||||
|
||||
_ = Task.Run(async () =>
|
||||
@@ -72,6 +73,11 @@ namespace Serein.Workbench.Node.View
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 初始化连接线元素点
|
||||
/// </summary>
|
||||
/// <param name="isDotted"></param>
|
||||
/// <param name="isTop"></param>
|
||||
public void InitElementPoint(bool isDotted , bool isTop = false)
|
||||
{
|
||||
hitVisiblePen = new Pen(Brushes.Transparent, 1.0); // 初始化碰撞检测线
|
||||
@@ -148,8 +154,8 @@ namespace Serein.Workbench.Node.View
|
||||
#region 重绘
|
||||
|
||||
private readonly StreamGeometry streamGeometry = new StreamGeometry();
|
||||
private Point rightCenterOfStartLocation; // 目标节点选择左侧边缘中心
|
||||
private Point leftCenterOfEndLocation; // 起始节点选择右侧边缘中心
|
||||
//private Point rightCenterOfStartLocation; // 目标节点选择左侧边缘中心
|
||||
//private Point leftCenterOfEndLocation; // 起始节点选择右侧边缘中心
|
||||
private Pen hitVisiblePen; // 初始化碰撞检测线
|
||||
private Pen visualPen; // 默认可视化Pen
|
||||
private Point startPoint; // 连接线的起始节点
|
||||
@@ -158,8 +164,16 @@ namespace Serein.Workbench.Node.View
|
||||
private double opacity; // 透明度
|
||||
|
||||
double linkSize; // 根据缩放比例调整线条粗细
|
||||
|
||||
/// <summary>
|
||||
/// 定义几何形状
|
||||
/// </summary>
|
||||
protected override Geometry DefiningGeometry => streamGeometry;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 更新线条颜色
|
||||
/// </summary>
|
||||
/// <param name="brush"></param>
|
||||
public void UpdateLineColor(Brush brush)
|
||||
{
|
||||
visualPen = new Pen(brush, 3.0); // 默认可视化Pen
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Serein.Workbench.Node.View
|
||||
/// <summary>
|
||||
/// 入参控件
|
||||
/// </summary>
|
||||
public class ParamsArgControl: Shape
|
||||
internal class ParamsArgControl: Shape
|
||||
{
|
||||
public ParamsArgControl()
|
||||
{
|
||||
@@ -172,7 +172,7 @@ namespace Serein.Workbench.Node.View
|
||||
|
||||
|
||||
|
||||
public abstract class JunctionControlBase : Shape
|
||||
internal abstract class JunctionControlBase : Shape
|
||||
{
|
||||
private readonly FlowNodeService flowNodeService;
|
||||
protected JunctionControlBase()
|
||||
@@ -262,16 +262,12 @@ namespace Serein.Workbench.Node.View
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 禁止连接
|
||||
/// </summary>
|
||||
private bool IsConnectionDisable;
|
||||
|
||||
/// <summary>
|
||||
/// 处理鼠标悬停状态
|
||||
/// </summary>
|
||||
private bool _isMouseOver;
|
||||
public bool IsMouseOver
|
||||
public new bool IsMouseOver
|
||||
{
|
||||
get => _isMouseOver;
|
||||
set
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Serein.Workbench.Node.View
|
||||
{
|
||||
|
||||
#region Model,不科学的全局变量
|
||||
public class MyLine
|
||||
internal class MyLine
|
||||
{
|
||||
public MyLine(Canvas canvas, ConnectionLineShape line)
|
||||
{
|
||||
@@ -32,7 +32,7 @@ namespace Serein.Workbench.Node.View
|
||||
}
|
||||
}
|
||||
|
||||
public class ConnectingData
|
||||
internal class ConnectingData
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
@@ -42,11 +42,11 @@ namespace Serein.Workbench.Node.View
|
||||
/// <summary>
|
||||
/// 起始控制点
|
||||
/// </summary>
|
||||
public JunctionControlBase StartJunction { get; set; }
|
||||
public JunctionControlBase? StartJunction { get; set; }
|
||||
/// <summary>
|
||||
/// 当前的控制点
|
||||
/// </summary>
|
||||
public JunctionControlBase CurrentJunction { get; set; }
|
||||
public JunctionControlBase? CurrentJunction { get; set; }
|
||||
/// <summary>
|
||||
/// 开始坐标
|
||||
/// </summary>
|
||||
@@ -54,7 +54,7 @@ namespace Serein.Workbench.Node.View
|
||||
/// <summary>
|
||||
/// 线条样式
|
||||
/// </summary>
|
||||
public MyLine MyLine { get; set; }
|
||||
public MyLine? MyLine { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 线条类别(方法调用)
|
||||
@@ -68,7 +68,7 @@ namespace Serein.Workbench.Node.View
|
||||
/// <summary>
|
||||
/// 判断当前连接类型
|
||||
/// </summary>
|
||||
public JunctionOfConnectionType Type => StartJunction.JunctionType.ToConnectyionType();
|
||||
public JunctionOfConnectionType Type => StartJunction?.JunctionType.ToConnectyionType() ?? JunctionOfConnectionType.None;
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -113,11 +113,11 @@ namespace Serein.Workbench.Node.View
|
||||
if (StartJunction.JunctionType == Library.JunctionType.Execute
|
||||
|| StartJunction.JunctionType == Library.JunctionType.ArgData)
|
||||
{
|
||||
MyLine.Line.UpdateStartPoints(point);
|
||||
MyLine?.Line.UpdateStartPoints(point);
|
||||
}
|
||||
else
|
||||
{
|
||||
MyLine.Line.UpdateEndPoints(point);
|
||||
MyLine?.Line.UpdateEndPoints(point);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ using Serein.Library;
|
||||
|
||||
namespace Serein.Workbench.Node.View
|
||||
{
|
||||
public class ArgJunctionControl : JunctionControlBase
|
||||
internal class ArgJunctionControl : JunctionControlBase
|
||||
{
|
||||
public ArgJunctionControl()
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using Serein.Library;
|
||||
|
||||
namespace Serein.Workbench.Node.View
|
||||
{
|
||||
public class ExecuteJunctionControl : JunctionControlBase
|
||||
internal class ExecuteJunctionControl : JunctionControlBase
|
||||
{
|
||||
public ExecuteJunctionControl()
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ using Serein.Library;
|
||||
namespace Serein.Workbench.Node.View
|
||||
{
|
||||
|
||||
public class NextStepJunctionControl : JunctionControlBase
|
||||
internal class NextStepJunctionControl : JunctionControlBase
|
||||
{
|
||||
//public override JunctionType JunctionType { get; } = JunctionType.NextStep;
|
||||
public NextStepJunctionControl()
|
||||
|
||||
@@ -6,7 +6,7 @@ using Serein.Library;
|
||||
namespace Serein.Workbench.Node.View
|
||||
{
|
||||
|
||||
public class ResultJunctionControl : JunctionControlBase
|
||||
internal class ResultJunctionControl : JunctionControlBase
|
||||
{
|
||||
public ResultJunctionControl()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user