public IArrow Arrow([NotNull] VariableVector tail, [NotNull] VariableVector head, double width, [CanBeNull] Color?color = null /*Black*/, [CanBeNull] string text = null, LineTextPlacement placement = LineTextPlacement.Center, [CanBeNull] Font textFont = null /*___*/, [CanBeNull] Color?textColor = null /*Black*/, double textPadding = 0.2, double textLocation = 0.5, [CanBeNull] string edgeInfo = null, int drawingOrder = 0, int fixingOrder = 200, string name = null) { if (tail == null) { throw new ArgumentNullException(nameof(tail)); } if (head == null) { throw new ArgumentNullException(nameof(head)); } var arrowBuilder = new ArrowBuilder(_solver, name ?? $"${tail.Name}->{head.Name}['{text}']", tail, head, width, color ?? Color.Black, text ?? "", placement, textFont ?? _defaultTextFont, textColor ?? Color.Black, textPadding, textLocation, edgeInfo, _builders.Count, drawingOrder, fixingOrder); _builders.Add(arrowBuilder); return(arrowBuilder); }
internal ArrowBuilder(SimpleConstraintSolver solver, string name, VariableVector tail, VariableVector head, double width, Color color, string text, LineTextPlacement lineTextPlacement, Font textFont, Color textColor, double textPadding, double textLocation, string edgeInfo, int creationOrder, int drawingOrder, int fixingOrder) : base(creationOrder, drawingOrder, fixingOrder) { // Simple stuff _name = name; _width = width; _color = color; _text = text; _lineTextPlacement = lineTextPlacement; _textFont = textFont; _textColor = textColor; _textPadding = (float)textPadding; _textLocation = textLocation; _edgeInfo = edgeInfo; // Vectors _tail = tail.AlsoNamed(_name + ".T"); _head = head.AlsoNamed(_name + ".H"); _textBox = new VariableVector(_name + ".TXT", solver); }