public void RegisterYComp(YCompClient ycompClient) { if (this.ycompStream != null) { throw new Exception("there is already a ycomp stream registered"); } this.ycompStream = ycompClient.ycompStream; foreach (NodeRealizer nr in registeredNodeRealizers.Keys) { ycompStream.Write("addNodeRealizer \"" + nr.Name + "\" \"" + VCGDumper.GetColor(nr.BorderColor) + "\" \"" + VCGDumper.GetColor(nr.Color) + "\" \"" + VCGDumper.GetColor(nr.TextColor) + "\" \"" + VCGDumper.GetNodeShape(nr.Shape) + "\"\n"); } foreach (EdgeRealizer er in registeredEdgeRealizers.Keys) { ycompStream.Write("addEdgeRealizer \"" + er.Name + "\" \"" + VCGDumper.GetColor(er.Color) + "\" \"" + VCGDumper.GetColor(er.TextColor) + "\" \"" + er.LineWidth + "\" \"" + VCGDumper.GetLineStyle(er.LineStyle) + "\"\n"); } }
private NodeRealizer GetNodeRealizer(GrColor nodeColor, GrColor borderColor, GrColor textColor, GrNodeShape shape) { NodeRealizer newNr = new NodeRealizer("nr" + nextNodeRealizerID, nodeColor, borderColor, textColor, shape); NodeRealizer nr; if (!registeredNodeRealizers.TryGetValue(newNr, out nr)) { if (ycompStream != null) { ycompStream.Write("addNodeRealizer \"" + newNr.Name + "\" \"" + VCGDumper.GetColor(borderColor) + "\" \"" + VCGDumper.GetColor(nodeColor) + "\" \"" + VCGDumper.GetColor(textColor) + "\" \"" + VCGDumper.GetNodeShape(shape) + "\"\n"); } registeredNodeRealizers.Add(newNr, newNr); ++nextNodeRealizerID; nr = newNr; } return(nr); }
String GetNodeRealizer(GrColor nodeColor, GrColor borderColor, GrColor textColor, GrNodeShape shape) { NodeRealizer newNr = new NodeRealizer("nr" + nextNodeRealizerID, nodeColor, borderColor, textColor, shape); NodeRealizer nr; if (!nodeRealizers.TryGetValue(newNr, out nr)) { ycompStream.Write("addNodeRealizer \"" + newNr.Name + "\" \"" + VCGDumper.GetColor(borderColor) + "\" \"" + VCGDumper.GetColor(nodeColor) + "\" \"" + VCGDumper.GetColor(textColor) + "\" \"" + VCGDumper.GetNodeShape(shape) + "\"\n"); nodeRealizers.Add(newNr, newNr); nextNodeRealizerID++; nr = newNr; } return(nr.Name); }
/// <summary> /// Sets the current layouter of yComp /// </summary> /// <param name="moduleName">The name of the layouter. /// Can be one of: /// - Random /// - Hierarchic /// - Organic /// - Orthogonal /// - Circular /// - Tree /// - Diagonal /// - Incremental Hierarchic /// - Compilergraph /// </param> public void SetLayout(String moduleName) { ycompStream.Write("setLayout \"" + moduleName + "\"\n"); isDirty = true; isLayoutDirty = true; }