public static CoupleLabelNodeAttr AddNodeAttrs()

in GraphLayout/tools/Dot2Graph/AttributeValuePair.cs [824:916]


        public static CoupleLabelNodeAttr AddNodeAttrs(CoupleLabelNodeAttr couple, ArrayList arrayList, out Node geomNode) {
            if (couple == null) couple = new CoupleLabelNodeAttr(new Label(), new NodeAttr());
            double width = 0;
            double height = 0;
            P2 pos = new P2();

            var label = couple.Item1;
            var nodeAttr = couple.Item2;

            foreach (AttributeValuePair attrVal in arrayList) {
                if (AddAttributeKeyVal(new CoupleLabelBaseAttr(couple.Item1, nodeAttr), attrVal))
                    continue;

                switch (attrVal.attributeTypeEnum) {
                    case AttributeTypeEnum.Regular: 
                        // nodeAttr.regular=(Boolean)attrVal.val;
                        break;
                    case AttributeTypeEnum.Shape: 
                        nodeAttr.Shape = (Shape) attrVal.val;
                        break;
                    case AttributeTypeEnum.Fontname: 
                        label.FontName = attrVal.val as String;
                        break;
                    case AttributeTypeEnum.Style: 
                        AddStyles(nodeAttr, attrVal.val);
                        break;
                    case AttributeTypeEnum.Fontcolor: 
                        label.FontColor = StringToMsaglColor((string) attrVal.val);
                        break;
                    case AttributeTypeEnum.FillColor: 
                        nodeAttr.FillColor = StringToMsaglColor((string) attrVal.val);
                        break;
                    case AttributeTypeEnum.Width: 
                        width = (double)attrVal.val;
                        break;
                    case AttributeTypeEnum.Height: 
                        height = (double)attrVal.val;
                        break;
                    case AttributeTypeEnum.Pos: 
                           PosData posData = attrVal.val as PosData;
                           pos = (posData.ControlPoints as List<P2>)[0];
                        break;
                    case AttributeTypeEnum.Rects: 
                        //nodeAttr.Rects=attrVal.val as ArrayList;
                        break;
                    case AttributeTypeEnum.Label: 
                        label.Text = attrVal.val as String;
                        break;
                    case AttributeTypeEnum.Sides: 
                        // nodeAttr.sides=(int)attrVal.val;
                        break;
                    case AttributeTypeEnum.Orientation: 
                        //nodeAttr.orientation=Double.Parse(attrVal.val as String,BaseAttr.USCultureInfo);
                        break;
                    case AttributeTypeEnum.Skew: 
                        //nodeAttr.skew=(Double)attrVal.val;
                        break;
                    case AttributeTypeEnum.Distortion: 
                        //nodeAttr.distortion=(Double)attrVal.val;
                        break;
                    case AttributeTypeEnum.Id:
                        // couple.Second.Id = attrVal.val as String; //used for svg, postscript, map only as the docs say
                        break;
                    case AttributeTypeEnum.Ignore: {}
                        break;
                    case AttributeTypeEnum.Weight:
//                        if (attrVal.val is String)
//                            weight = Int32.Parse(attrVal.val as String, AttributeBase.USCultureInfo);
//                        else
//                            weight = (int) attrVal.val;
                        break;
                    case AttributeTypeEnum.XRad: 
                        nodeAttr.XRadius = (float) attrVal.val;
                        break;
                    case AttributeTypeEnum.YRad: 
                        nodeAttr.YRadius = (float) attrVal.val;
                        break;
                    case AttributeTypeEnum.Padding: 
                        nodeAttr.Padding = (float) attrVal.val;
                        break;
                    case AttributeTypeEnum.Margin: 
                        nodeAttr.LabelMargin = (int) ((double) attrVal.val);
                        break;
                    case AttributeTypeEnum.BGColor:
                        break;
                    default:
                        throw new Exception("The attribute \"" + attrVal.attributeTypeEnum + "\" is not supported on nodes");
                }
            }
            geomNode = TryToCreateGeomNode(width, height, pos, nodeAttr);
            
            return couple;
        }