mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-05-01 05:33:23 +08:00
mind
This commit is contained in:
@@ -13,65 +13,71 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
public class DirectoryLayout : IMindLayout
|
||||
{
|
||||
public void Appearance(MindNode mindNode)
|
||||
public void Appearance(MindNode mindNode, bool initAppearance)
|
||||
{
|
||||
switch (mindNode.NodeLevel)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
mindNode.ItemWidth = 110;
|
||||
mindNode.ItemHeight = 40;
|
||||
mindNode.ClearConnectors();
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 110;
|
||||
mindNode.ItemHeight = 40;
|
||||
mindNode.ClearConnectors();
|
||||
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
|
||||
mindNode.AddConnector(port);
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
|
||||
mindNode.AddConnector(port);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
|
||||
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.FontViewModel.FontColor = Colors.White;
|
||||
mindNode.FontViewModel.FontSize = 15;
|
||||
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.FontViewModel.FontColor = Colors.White;
|
||||
mindNode.FontViewModel.FontSize = 15;
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.None;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.5, YRatio = 0 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.5, YRatio = 0 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
|
||||
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
public class FishBoneLayout : IMindLayout
|
||||
{
|
||||
public void Appearance(MindNode mindNode)
|
||||
public void Appearance(MindNode mindNode, bool initAppearance)
|
||||
{
|
||||
if (mindNode == null) return;
|
||||
|
||||
@@ -23,65 +23,72 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
mindNode.ItemWidth = 110;
|
||||
mindNode.ItemHeight = 40;
|
||||
mindNode.ClearConnectors();
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 110;
|
||||
mindNode.ItemHeight = 40;
|
||||
mindNode.ClearConnectors();
|
||||
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port);
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
|
||||
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.FontViewModel.FontColor = Colors.White;
|
||||
mindNode.FontViewModel.FontSize = 15;
|
||||
mindNode.Spacing = new SizeBase(50, 15);
|
||||
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.FontViewModel.FontColor = Colors.White;
|
||||
mindNode.FontViewModel.FontSize = 15;
|
||||
mindNode.Spacing = new SizeBase(50, 15);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.None;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.BottomLeft, true) { XRatio = 0, YRatio = 1 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.BottomLeft, true) { XRatio = 0, YRatio = 1 };
|
||||
mindNode.AddConnector(port1);
|
||||
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.TopLeft, true) { XRatio = 0, YRatio = 0 };
|
||||
mindNode.AddConnector(port2);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.TopLeft, true) { XRatio = 0, YRatio = 0 };
|
||||
mindNode.AddConnector(port2);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
}
|
||||
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
var port3 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.25, YRatio = 0 };
|
||||
mindNode.AddConnector(port3);
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.25, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
var port3 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.25, YRatio = 0 };
|
||||
mindNode.AddConnector(port3);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
mindNode.ColorViewModel.FillColor.Color = Colors.Transparent;
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
|
||||
|
||||
mindNode.ColorViewModel.FillColor.Color = Colors.Transparent;
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
public interface IMindLayout
|
||||
{
|
||||
void Appearance(MindNode mindNode);
|
||||
void Appearance(MindNode mindNode, bool initAppearance);
|
||||
ConnectionViewModel GetOrSetConnectionViewModel(MindNode source, MindNode sink, ConnectionViewModel connector = null);
|
||||
void LayoutUpdated(MindNode mindNode);
|
||||
|
||||
|
||||
@@ -13,66 +13,72 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
public class LogicalLayout : IMindLayout
|
||||
{
|
||||
public void Appearance(MindNode mindNode)
|
||||
public void Appearance(MindNode mindNode, bool initAppearance)
|
||||
{
|
||||
switch (mindNode.NodeLevel)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
mindNode.ItemWidth = 110;
|
||||
mindNode.ItemHeight = 40;
|
||||
mindNode.ClearConnectors();
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 110;
|
||||
mindNode.ItemHeight = 40;
|
||||
mindNode.ClearConnectors();
|
||||
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.None, true) { XRatio = 0.5, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port);
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.None, true) { XRatio = 0.5, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
|
||||
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.FontViewModel.FontColor = Colors.White;
|
||||
mindNode.FontViewModel.FontSize = 15;
|
||||
mindNode.Spacing = new SizeBase(50, 15);
|
||||
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.FontViewModel.FontColor = Colors.White;
|
||||
mindNode.FontViewModel.FontSize = 15;
|
||||
mindNode.Spacing = new SizeBase(50, 15);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.Circle;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.None;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port2);
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port2);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 1 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 1 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 1);
|
||||
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 1);
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,66 +13,72 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
public class MindLayout : IMindLayout
|
||||
{
|
||||
public void Appearance(MindNode mindNode)
|
||||
public void Appearance(MindNode mindNode, bool initAppearance)
|
||||
{
|
||||
switch (mindNode.NodeLevel)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
mindNode.ItemWidth = 110;
|
||||
mindNode.ItemHeight = 40;
|
||||
mindNode.ClearConnectors();
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 110;
|
||||
mindNode.ItemHeight = 40;
|
||||
mindNode.ClearConnectors();
|
||||
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.None, true) { XRatio = 0.5, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port);
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.None, true) { XRatio = 0.5, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
|
||||
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.FontViewModel.FontColor = Colors.White;
|
||||
mindNode.FontViewModel.FontSize = 15;
|
||||
mindNode.Spacing = new SizeBase(50, 15);
|
||||
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.FontViewModel.FontColor = Colors.White;
|
||||
mindNode.FontViewModel.FontSize = 15;
|
||||
mindNode.Spacing = new SizeBase(50, 15);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.Circle;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.None;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port2);
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 0.5 };
|
||||
mindNode.AddConnector(port2);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 1 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Left, true) { XRatio = 0, YRatio = 1 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Right, true) { XRatio = 1, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 1);
|
||||
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 1);
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Left;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,44 +13,46 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
{
|
||||
public class OrganizationalLayout : IMindLayout
|
||||
{
|
||||
public void Appearance(MindNode mindNode)
|
||||
public void Appearance(MindNode mindNode, bool initAppearance)
|
||||
{
|
||||
switch (mindNode.NodeLevel)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
mindNode.ItemWidth = 110;
|
||||
mindNode.ItemHeight = 40;
|
||||
mindNode.ClearConnectors();
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 110;
|
||||
mindNode.ItemHeight = 40;
|
||||
mindNode.ClearConnectors();
|
||||
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
|
||||
mindNode.AddConnector(port);
|
||||
var port = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
|
||||
mindNode.AddConnector(port);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
|
||||
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.FontViewModel.FontColor = Colors.White;
|
||||
mindNode.FontViewModel.FontSize = 15;
|
||||
mindNode.ColorViewModel.FillColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.FontViewModel.FontColor = Colors.White;
|
||||
mindNode.FontViewModel.FontSize = 15;
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.None;
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.5, YRatio = 0 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.5, YRatio = 0 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
}
|
||||
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Top;
|
||||
@@ -58,21 +60,24 @@ namespace AIStudio.Wpf.Mind.Helpers
|
||||
}
|
||||
default:
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
if (initAppearance)
|
||||
{
|
||||
mindNode.ItemWidth = 80;
|
||||
mindNode.ItemHeight = 25;
|
||||
mindNode.ClearConnectors();
|
||||
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.5, YRatio = 0 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
var port1 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Top, true) { XRatio = 0.5, YRatio = 0 };
|
||||
mindNode.AddConnector(port1);
|
||||
var port2 = new FullyCreatedConnectorInfo(mindNode.Root, mindNode, ConnectorOrientation.Bottom, true) { XRatio = 0.5, YRatio = 1 };
|
||||
mindNode.AddConnector(port2);
|
||||
|
||||
mindNode.IsInnerConnector = true;
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
|
||||
|
||||
mindNode.ColorViewModel.LineColor.Color = Color.FromRgb(0x73, 0xa1, 0xbf);
|
||||
}
|
||||
mindNode.ShapeViewModel.SinkMarker.PathStyle = ArrowPathStyle.None;
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.CornerRadius = new System.Windows.CornerRadius(0);
|
||||
mindNode.BorderThickness = new System.Windows.Thickness(0, 0, 0, 0);
|
||||
mindNode.ShapeViewModel.SinkMarker.SizeStyle = ArrowSizeStyle.VerySmall;
|
||||
mindNode.ConnectorOrientation = ConnectorOrientation.Top;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user