public void OnLogicalStateChanged(GraphEventArgs e) { if (!IsDirected) { switch (e.EdgeLogicalState) { case Edge.LogicalState.Idle: line.Stroke = Brushes.Black; break; case Edge.LogicalState.NotYetVisited: line.Stroke = Brushes.Black; break; case Edge.LogicalState.Visited: line.Stroke = Brushes.Green; break; case Edge.LogicalState.SelectedForEdgeDrawing: line.Stroke = Brushes.Red; break; } } else { switch (e.EdgeLogicalState) { case Edge.LogicalState.Idle: DirectedLine.Stroke = Brushes.Black; break; case Edge.LogicalState.NotYetVisited: DirectedLine.Stroke = Brushes.Black; break; case Edge.LogicalState.Visited: DirectedLine.Stroke = Brushes.Green; break; case Edge.LogicalState.SelectedForEdgeDrawing: DirectedLine.Stroke = Brushes.Red; break; } } }
private void OnDrawingStateChanged(GraphEventArgs e) { if (!e.Handled) { if (e.EdgeDrawingState == EdgeDrawingState.idle && Vertex.startPoint != null) { //this.EdgeAdded(); if (e.CurrentVertex.CurrentlySelectedVertexChanged != null) { e.CurrentVertex.CurrentlySelectedVertexChanged(new GraphEventArgs() { CurrentVertex = null }); } edgeDrawing = EdgeDrawingState.idle; //Vertex.startPoint.logicalState = LogicalState.Idle; //Vertex.startPoint = null; e.CurrentVertex.logicalState = LogicalState.Idle; e.CurrentVertex = null; logicalState = LogicalState.Idle; e.Handled = true; } } }
private void OnVertexCurrentlySelectedVertexChanged(GraphEventArgs e) { if (e.CurrentVertex != null) { SettingsPanel.CurrentlySelectedVertexTextBlock.Text = (e.CurrentVertex.Number.ToString() + ". számú csúcs"); } else { SettingsPanel.CurrentlySelectedVertexTextBlock.Text = "Nincs kiválasztott csúcs"; } myGraph.SelectedVertex = e.CurrentVertex; }
public void OnLogicalStateChanged(GraphEventArgs e) { switch (e.VertexLogicalState) { case LogicalState.Idle: this.Background = Brushes.LightGray; break; case LogicalState.NotYetVisited: this.Background = Brushes.LightGray; break; case LogicalState.SelectedForEdgeDrawing: this.Background = Brushes.Red; break; case LogicalState.TravelStartingPoint: this.Background = Brushes.Blue; break; case LogicalState.Visited: this.Background = Brushes.LightGreen; break; } }