/// <summary> /// Copies data from another edge status object. /// </summary> /// <param name="other">The object to copy.</param> internal void CopyFrom(EdgeStatus other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } switch (Constraint = other.Constraint) { case RelativeConstraintType.ToComponent: FromComponent = other.FromComponent; break; case RelativeConstraintType.ToAnchor: FromAnchor = other.FromAnchor; break; case RelativeConstraintType.Locked: FromAnchor = other.FromAnchor; Offset = other.Offset; break; case RelativeConstraintType.Unconstrained: default: break; } }
internal RelativeLayoutParamsBase() { Insets = null; BottomEdge = new EdgeStatus(); LeftEdge = new EdgeStatus(); RightEdge = new EdgeStatus(); TopEdge = new EdgeStatus(); OverrideSize = Vector2.zero; }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is EdgeStatus) { EdgeStatus vertexStatus = (EdgeStatus)value; switch (vertexStatus) { case EdgeStatus.Marked: return(Brushes.Red); case EdgeStatus.Simple: return(Brushes.Black); } } return(null); }
public DisplayGraphEdge() : base(null, null, 1) { this.EdgeStatus = EdgeStatus.Simple; }
public DisplayGraphEdge(DisplayGraphVertex source, DisplayGraphVertex target, string text = "") : base(source, target) { this.Text = text; this.EdgeStatus = EdgeStatus.Simple; }
private void DecoreateSubgraph(Diff <UnorderedNTuple <int>, UnorderedNTuple <Label> > subgraphDiff, Dot.Edge dotEdge, NodePair <Node, UnorderedNTuple <Label> > pair, Label label, EdgeStatus edgeStatus, Recorder <Graph, Node, Edge, Label> .RecordOptions options) { if (subgraphDiff.Commons.TryGetValue(pair, out var common)) { groupMap.TryGetValue(common.labelGroup.Group, out var labels); if (labels?.Count == 1) { dotEdge.Label = @$ "{common.labelGroup.Group} {{{string.Join(", ", common.labelGroup.Children)}}}"; } else { dotEdge.Label = $"{common.labelGroup.Group}:[{common.labelKey.Label}]"; dotEdge.FontColor = Visualizer.ErrorColor; } } else if (subgraphDiff.ExpectedOnlys.TryGetValue(pair, out var expectedOnly)) { dotEdge.Label = @$ "{expectedOnly.Group} / ? {{{string.Join(", ", common.labelGroup.Children)}}}"; dotEdge.FontColor = Visualizer.ErrorColor; } else if (subgraphDiff.Unmatches.TryGetValue(pair, out var unmatch)) { dotEdge.Label = @$ "{unmatch.labelGroup.Group} {{{string.Join(", ", unmatch.labelGroup.Children)}}} / {{{string.Join(", ", pair.Via.Select(sl => ResolveLabelGroup(sl)))}}}";
private void DecorateEdge(Dot.Edge dotEdge, NodePair <Node, Edge> pair, Label?label, EdgeStatus edgeStatus, Recorder <Graph, Node, Edge, Label> .RecordOptions options) { if (EdgeDiff.Commons.TryGetValue(pair, out var common)) { groupMap.TryGetValue(common.labelGroup.Group, out var labels); // reverseGroupMap.TryGetValue(common.labelKey.Label, out var groups); if (labels?.Count == 1) { dotEdge.Label = $"{common.labelGroup.Group}"; } else { dotEdge.Label = $"{common.labelGroup.Group}:[{common.labelKey.Label}]"; dotEdge.FontColor = Visualizer.ErrorColor; } } else if (EdgeDiff.ExpectedOnlys.TryGetValue(pair, out var expectedOnly)) { dotEdge.Label = $"{expectedOnly.Group} / ?"; dotEdge.FontColor = Visualizer.ErrorColor; } }