mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-06 09:16:37 +08:00
使用PointBase代替Point
This commit is contained in:
@@ -8,6 +8,7 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using AIStudio.Wpf.DiagramDesigner;
|
||||
using AIStudio.Wpf.DiagramDesigner.Geometry;
|
||||
using AIStudio.Wpf.Flowchart.Models;
|
||||
|
||||
namespace AIStudio.Wpf.Flowchart.Controls
|
||||
@@ -33,12 +34,12 @@ namespace AIStudio.Wpf.Flowchart.Controls
|
||||
_diagramViewModel = new DiagramViewModel();
|
||||
_diagramViewModel.SetScreenScale();
|
||||
_diagramViewModel.ShowGrid = true;
|
||||
_diagramViewModel.GridCellSize = new Size(125 / _diagramViewModel.ScreenScale, 125 / _diagramViewModel.ScreenScale);
|
||||
_diagramViewModel.GridCellSize = new SizeBase(125 / _diagramViewModel.ScreenScale, 125 / _diagramViewModel.ScreenScale);
|
||||
_diagramViewModel.GridMargin = 0d;
|
||||
_diagramViewModel.CellHorizontalAlignment = CellHorizontalAlignment.Center;
|
||||
_diagramViewModel.CellVerticalAlignment = CellVerticalAlignment.Center;
|
||||
_diagramViewModel.PageSizeType = PageSizeType.Custom;
|
||||
_diagramViewModel.PageSize = new Size(double.NaN, double.NaN);
|
||||
_diagramViewModel.PageSize = new SizeBase(double.NaN, double.NaN);
|
||||
_diagramViewModel.ColorViewModel = new ColorViewModel() { LineWidth = 2 };
|
||||
//_diagramViewModel.DrawModeViewModel = new DrawModeViewModel() { VectorLineDrawMode = DrawMode.BoundaryConnectingLine };
|
||||
|
||||
|
||||
@@ -33,7 +33,10 @@ namespace AIStudio.Wpf.Flowchart
|
||||
private static List<SelectOption> _users;
|
||||
public static List<SelectOption> Users
|
||||
{
|
||||
get { return _users; }
|
||||
get
|
||||
{
|
||||
return _users;
|
||||
}
|
||||
set
|
||||
{
|
||||
_users = value;
|
||||
@@ -43,7 +46,10 @@ namespace AIStudio.Wpf.Flowchart
|
||||
private static List<SelectOption> _roles;
|
||||
public static List<SelectOption> Roles
|
||||
{
|
||||
get { return _roles; }
|
||||
get
|
||||
{
|
||||
return _roles;
|
||||
}
|
||||
set
|
||||
{
|
||||
_roles = value;
|
||||
@@ -67,20 +73,22 @@ namespace AIStudio.Wpf.Flowchart
|
||||
{
|
||||
foreach (var edge in connectors)
|
||||
{
|
||||
if (edge.IsFullConnection == false) continue;
|
||||
|
||||
var source = oASteps.FirstOrDefault(p => p.BottomConnector == edge.SourceConnectorInfo || p.LeftConnector == edge.SourceConnectorInfo || p.RightConnector == edge.SourceConnectorInfo);
|
||||
if (source != null)
|
||||
{
|
||||
if (source.Kind == NodeKinds.Decide)
|
||||
{
|
||||
source.SelectNextStep.Add((edge.SinkConnectorInfo as FullyCreatedConnectorInfo).DataItem.Id.ToString(), "data.Flag" + edge.Text);
|
||||
source.SelectNextStep.Add(edge.SinkConnectorInfoFully.DataItem.Id.ToString(), "data.Flag" + edge.Text);
|
||||
}
|
||||
else if (source.Kind == NodeKinds.COBegin)
|
||||
{
|
||||
source.SelectNextStep.Add((edge.SinkConnectorInfo as FullyCreatedConnectorInfo).DataItem.Id.ToString(), "True");
|
||||
source.SelectNextStep.Add(edge.SinkConnectorInfoFully.DataItem.Id.ToString(), "True");
|
||||
}
|
||||
else
|
||||
{
|
||||
source.NextStepId = (edge.SinkConnectorInfo as FullyCreatedConnectorInfo).DataItem.Id.ToString();
|
||||
source.NextStepId = edge.SinkConnectorInfoFully.DataItem.Id.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,7 +134,7 @@ namespace AIStudio.Wpf.Flowchart
|
||||
var nodes = InitStep(oASteps, nextstepid);
|
||||
nodes.Insert(0, oAStartStep);
|
||||
|
||||
FlowNodes.Add(viewModel, nodes);
|
||||
FlowNodes.Add(viewModel, nodes);
|
||||
|
||||
Approve(oAStartStep, 100);
|
||||
}
|
||||
@@ -213,7 +221,7 @@ namespace AIStudio.Wpf.Flowchart
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
SetStatus(flowNode, status, remark);
|
||||
@@ -287,8 +295,8 @@ namespace AIStudio.Wpf.Flowchart
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
//如果表达式错了,就按第一个处理
|
||||
@@ -372,6 +380,6 @@ namespace AIStudio.Wpf.Flowchart
|
||||
public static void DisposeData(IDiagramViewModel viewModel)
|
||||
{
|
||||
FlowNodes.Remove(viewModel);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,10 +75,10 @@ namespace AIStudio.Wpf.Flowchart.Models
|
||||
diagramLink.Width = linkModel.ColorViewModel.LineWidth;
|
||||
diagramLink.Label = linkModel.Text;
|
||||
|
||||
if (linkModel.SinkConnectorInfo is FullyCreatedConnectorInfo sinkConnector)
|
||||
if (linkModel.IsFullConnection)
|
||||
{
|
||||
diagramLink.SourceId = linkModel.SourceConnectorInfo.DataItem.Id.ToString();
|
||||
diagramLink.TargetId = sinkConnector.DataItem.Id.ToString();
|
||||
diagramLink.TargetId = linkModel.SinkConnectorInfoFully.DataItem.Id.ToString();
|
||||
|
||||
//线条形状与箭头待处理
|
||||
//diagramLink.Router = baseLinkModel.Router?.Method.Name;
|
||||
@@ -91,7 +91,7 @@ namespace AIStudio.Wpf.Flowchart.Models
|
||||
diagramLink.Type = diagramLink.GetType().Name;
|
||||
|
||||
diagramLink.SourcePortAlignment = linkModel.SourceConnectorInfo.Orientation.ToString();
|
||||
diagramLink.TargetPortAlignment = sinkConnector.Orientation.ToString();
|
||||
diagramLink.TargetPortAlignment = linkModel.SinkConnectorInfoFully.Orientation.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user