private void processInsertEdgeCommand(Command command) { var parameters = command.GetParameters(); var commandClientID = command.__getClientID(); var verticesDictionary = graph_.__getVerticesDictionary(); var fromVertex = verticesDictionary.Find(FullID.FromString(parameters[0])); var endVertex = verticesDictionary.Find(FullID.FromString(parameters[1])); if (fromVertex == null || endVertex == null) { return; } if (fromVertex.IsConnectedTo(endVertex)) { return; } var edgeFullID = new FullID(commandClientID, int.Parse(parameters[2])); Edge edge = fromVertex.__connectTo(endVertex, edgeFullID); if (graph_.IsLoading() && commandClientID == graph_.__getClientID()) { graph_.__setLastCreatedEdgeID(edgeFullID.GetIDinCreator()); } graph_.__raiseEdgeAddedEvent(edge); }
private void processRemoveEdgeCommand(Command command) { var parameters = command.GetParameters(); var edgesDictionary = graph_.__getEdgesDictionary(); var edge = edgesDictionary.Find(FullID.FromString(parameters[0])); graph_.__removeEdge(edge); graph_.__raiseEdgeRemovedEvent(edge); }
private void processRemoveVertexCommand(Command command) { var parameters = command.GetParameters(); var verticesDictionary = graph_.__getVerticesDictionary(); var vertex = verticesDictionary.Find(FullID.FromString(parameters[0])); graph_.__removeVertex(vertex); graph_.__raiseVertexRemovedEvent(vertex); }
private void processSetEdgePropertyCommand(Command command) { var parameters = command.GetParameters(); var edgesDictionary = graph_.__getEdgesDictionary(); var edge = edgesDictionary.Find(FullID.FromString(parameters[0])); if (edge == null) { return; } edge.__setProperty(parameters[1], parameters[2], parameters[3]); graph_.__raiseEdgePropertyChangedEvent(edge, parameters[1], parameters[2]); }
private void processSetVertexPropertyCommand(Command command) { var parameters = command.GetParameters(); var verticesDictionary = graph_.__getVerticesDictionary(); var vertex = verticesDictionary.Find(FullID.FromString(parameters[0])); if (vertex == null) { return; } vertex.__setProperty(parameters[1], parameters[2], parameters[3]); graph_.__raiseVertexPropertyChangedEvent(vertex, parameters[1], parameters[2]); }
private void processRemoveBendCommand(Command command) { var parameters = command.GetParameters(); var edgesDictionary = graph_.__getEdgesDictionary(); var edge = edgesDictionary.Find(FullID.FromString(parameters[0])); if (edge == null) { return; } var bend = edge.__removeBend(int.Parse(parameters[1])); graph_.__raiseBendRemovedEvent(bend); }
private void processChangeVertexScaleCommand(Command command) { var parameters = command.GetParameters(); var verticesDictionary = graph_.__getVerticesDictionary(); var vertex = verticesDictionary.Find(FullID.FromString(parameters[0])); if (vertex == null) { return; } var scale = double.Parse(parameters[1]); vertex.__setScale(scale); graph_.__raiseVertexScaleChangedEvent(vertex); }
private void processMoveVertexCommand(Command command) { var parameters = command.GetParameters(); var verticesDictionary = graph_.__getVerticesDictionary(); var vertex = verticesDictionary.Find(FullID.FromString(parameters[0])); if (vertex == null) { return; } var position = new Point3D(double.Parse(parameters[1]), double.Parse(parameters[2]), double.Parse(parameters[3])); vertex.__move(position); graph_.__raiseVertexMovedEvent(vertex); }
private void processBreakEdgeLineCommand(Command command) { var parameters = command.GetParameters(); var edgesDictionary = graph_.__getEdgesDictionary(); var edge = edgesDictionary.Find(FullID.FromString(parameters[0])); if (edge == null) { return; } var position = new Point3D(double.Parse(parameters[2]), double.Parse(parameters[3]), double.Parse(parameters[4])); var bend = edge.__breakEdgeLine(position, int.Parse(parameters[1])); graph_.__raiseBendAddedEvent(bend); }
private void processChangeVertexRotationCommand(Command command) { var parameters = command.GetParameters(); var verticesDictionary = graph_.__getVerticesDictionary(); var vertex = verticesDictionary.Find(FullID.FromString(parameters[0])); if (vertex == null) { return; } var rotation = new Point4D( double.Parse(parameters[1]), double.Parse(parameters[2]), double.Parse(parameters[3]), double.Parse(parameters[4])); vertex.__setRotation(rotation); graph_.__raiseVertexRotationChangedEvent(vertex); }
private void processMoveBendCommand(Command command) { var parameters = command.GetParameters(); var edgesDictionary = graph_.__getEdgesDictionary(); var edge = edgesDictionary.Find(FullID.FromString(parameters[0])); if (edge == null) { return; } var position = new Point3D(double.Parse(parameters[2]), double.Parse(parameters[3]), double.Parse(parameters[4])); int index = int.Parse(parameters[1]); var bend = edge.GetEdgeLines()[index].GetEndBend(); bend.__move(position); graph_.__raiseBendMovedEvent(bend); }