private void CreateOutgoingDTLines(StateClassShape fromShape, DTAnalyzer analyzer) { //If there is no destination state class then it is a transition-to-self if (!fromShape.StateClassIdDest.HasValue) { return; } StateClassShape ToShape = null; int? StratumIdActual = null; analyzer.ResolveStateClassStratum(fromShape.StratumIdSource, fromShape.StratumIdDest, fromShape.StateClassIdDest.Value, ref StratumIdActual); if (NullableUtilities.NullableIdsEqual(StratumIdActual, this.m_StratumId)) { //If the class was found in the current stratum then it will be in the //explicit lookups if the current stratum is explicit and the wildcard //lookups if it is not. if (this.m_StratumId.HasValue) { ToShape = this.m_ExplicitClasses[fromShape.StateClassIdDest.Value]; } else { ToShape = this.m_WildcardClasses[fromShape.StateClassIdDest.Value]; } } else { //If the class was not found in the current stratum it will be in the //wild card lookups if its stratum is wild. if (this.m_StratumId.HasValue && (!StratumIdActual.HasValue)) { ToShape = this.m_WildcardClasses[fromShape.StateClassIdDest.Value]; } } //If the class was not found or it is a transition-to-self then it is an //off stratum transition. Otherwise, add an outgoing line. if ((ToShape != null) && (ToShape != fromShape)) { DeterministicTransitionLine Line = new DeterministicTransitionLine(Constants.DETERMINISTIC_TRANSITION_LINE_COLOR); this.FillLineSegments(fromShape, ToShape, Line, BoxArrowDiagramConnectorMode.Horizontal); this.AddLine(Line); fromShape.OutgoingDTLines.Add(Line); ToShape.IncomingDTLines.Add(Line); } }
private static DeterministicTransitionLine CreateIncomingDTOffStratumCue(StateClassShape shape) { int X1 = shape.Bounds.X - Constants.TRANSITION_DIAGRAM_OFF_STRATUM_CUE_SIZE; int Y1 = shape.Bounds.Y + shape.Bounds.Height + Constants.TRANSITION_DIAGRAM_OFF_STRATUM_CUE_SIZE; int X2 = shape.Bounds.X; int Y2 = shape.Bounds.Y + shape.Bounds.Height; DeterministicTransitionLine Line = new DeterministicTransitionLine(Constants.DETERMINISTIC_TRANSITION_LINE_COLOR); Line.AddLineSegment(X1, Y1, X2, Y2); Line.AddArrowSegments(X2, Y2, BoxArrowDiagramArrowDirection.Northeast); return(Line); }
private void CreateIncomingDTOffStratumCues(StateClassShape shape) { foreach (DeterministicTransition t in shape.IncomingDT) { if (!NullableUtilities.NullableIdsEqual(t.StratumIdSource, shape.StratumIdSource)) { if (t.StratumIdSource.HasValue) { DeterministicTransitionLine l = CreateIncomingDTOffStratumCue(shape); this.AddLine(l); } } } }