public SVGText(SVGWord doc) : base(doc) { m_sElementName = "text"; m_bHasValue = true; m_ElementType = SVGUnitType.typeText; AddAttr(SVGAttribute._SvgAttribute.attrCore_XmlBase, ""); AddAttr(SVGAttribute._SvgAttribute.attrCore_XmlLang, ""); AddAttr(SVGAttribute._SvgAttribute.attrCore_XmlSpace, ""); AddAttr(SVGAttribute._SvgAttribute.attrPaint_Fill, ""); AddAttr(SVGAttribute._SvgAttribute.attrSpecific_X, ""); AddAttr(SVGAttribute._SvgAttribute.attrSpecific_Y, ""); AddAttr(SVGAttribute._SvgAttribute.attrSpecific_DX, ""); AddAttr(SVGAttribute._SvgAttribute.attrSpecific_DY, ""); AddAttr(SVGAttribute._SvgAttribute.attrSpecific_Rotate, ""); AddAttr(SVGAttribute._SvgAttribute.attrSpecific_TextLength, ""); AddAttr(SVGAttribute._SvgAttribute.attrSpecific_LengthAdjust, 0); AddAttr(SVGAttribute._SvgAttribute.attrText_Anchor, ""); AddAttr(SVGAttribute._SvgAttribute.attrStyle_Class, ""); AddAttr(SVGAttribute._SvgAttribute.attrStyle_Style, ""); AddAttr(SVGAttribute._SvgAttribute.attrFont_Family, ""); AddAttr(SVGAttribute._SvgAttribute.attrFont_Size, ""); AddAttr(SVGAttribute._SvgAttribute.attrFont_SizeAdjust, ""); AddAttr(SVGAttribute._SvgAttribute.attrFont_Stretch, 0); AddAttr(SVGAttribute._SvgAttribute.attrFont_Style, ""); AddAttr(SVGAttribute._SvgAttribute.attrFont_Variant, ""); AddAttr(SVGAttribute._SvgAttribute.attrFont_Weight, ""); }
public SVGCircle(SVGWord doc, string sCX, string sCY, string sRadius) : base(doc) { Init(); CX = sCX; CY = sCY; R = sRadius; }
public SVGEllipse(SVGWord doc, string sCX, string sCY, string sRX, string sRY) : base(doc) { Init(); CX = sCX; CY = sCY; RX = sRX; RY = sRY; }
public SVGLine(SVGWord doc, string sX1, string sY1, string sX2, string sY2, Color col) : base(doc) { Init(); X1 = sX1; Y1 = sY1; X2 = sX2; Y2 = sY2; Fill = col; }
public SVGImage(SVGWord doc, string sX, string sY, string sWidth, string sHeight, string sHRef) : base(doc) { Init(); X = sX; Y = sY; Width = sWidth; Height = sHeight; HRef = sHRef; }
public SVGRect(SVGWord doc, string sX, string sY, string sWidth, string sHeight, string sStrokeWidth, Color colFill, Color colStroke) : base(doc) { Init(); X = sX; Y = sY; Width = sWidth; StrokeWidth = sStrokeWidth; Height = sHeight; Fill = colFill; Stroke = colStroke; }
// ---------- PUBLIC METHODS END // ---------- PRIVATE METHODS protected SVGUnit(SVGWord doc) { SVGErr.Log("SvgElement", "SvgElement", "Element created", SVGErr._LogPriority.Info); m_doc = doc; m_attributes = new ArrayList(); AddAttr(SVGAttribute._SvgAttribute.attrCore_Id, null); m_Parent = null; m_Child = null; m_Next = null; m_Previous = null; m_sElementName = "unsupported"; m_sElementValue = ""; m_bHasValue = false; m_ElementType = SVGUnitType.typeUnsupported; }
public SVGCircle(SVGWord doc) : base(doc) { Init(); }
public SVGImage(SVGWord doc) : base(doc) { Init(); }
public SVGMetaData(SVGWord doc) : base(doc) { Init(); }
public SVGSymbol(SVGWord doc) : base(doc) { Init(); }
/// <summary> /// It constructs a path element with no attribute. /// </summary> public SVGPath(SVGWord doc) : base(doc) { Init(); }
public SVGAnimate(SVGWord doc) : base(doc) { Init(); }
public SVGPolyline(SVGWord doc) : base(doc) { Init(); }
public SVGPolyline(SVGWord doc, string sPoints) : base(doc) { Init(); Points = sPoints; }
public SVGRect(SVGWord doc) : base(doc) { Init(); }
public SVGDef(SVGWord doc) : base(doc) { Init(); }
public SVGEllipse(SVGWord doc) : base(doc) { Init(); }
public SVGUse(SVGWord doc) : base(doc) { Init(); }
public SVGDevicePort(SVGWord doc) : base(doc) { Init(); }
/// <summary> /// It constructs a polygon element with no attribute. /// </summary> /// <param name="doc">SVG document.</param> public SVGPolygon(SVGWord doc) : base(doc) { Init(); }
/// <summary> /// It constructs a path element. /// </summary> public SVGPath(SVGWord doc, string sPathData) : base(doc) { Init(); PathData = sPathData; }
public bool LoadModelFromXml(string fileName) { var svgForm = new WorkspaceHolder { Dock = DockStyle.Fill, Name = fileName }; svgForm.svgDrawForm.ToolDone += OnToolDoneComplete; svgForm.svgDrawForm.ItemsSelected += SvgDrawFormItemsSelected; svgForm.svgDrawForm.drawArea.Width = 1600; svgForm.svgDrawForm.drawArea.Height = 900; XmlTextReader reader = null; //XmlReader reader = null; //var txt = File.ReadAllText(fileName); try { // FileStream fs = new FileStream(fileName,FileMode.Open); //reader = XmlReader.Create(fileName); reader = new XmlTextReader(fileName);//从本地读取xml文件 SVGErr.Log("DrawArea", "LoadFromXML", "", SVGErr._LogPriority.Info); var svg = new SVGWord(); if (!svg.LoadFromFile(reader)) { return(false); } SVGRoot root = svg.GetSvgRoot(); if (root == null) { return(false); } SVGUnit ele = root.getChild(); if (ele != null) { //1 收集symbol获取svg上的设备 //2 从svg元数据中收集symbol之间的关系 //3 将所有use的设备实体生成 //4 绘制list集合将图素绘制出来 SVGFactory.CreateProjectFromXML(ele, svgForm.svgDrawForm.drawArea.GraphicsList); } } catch (Exception ex) { } finally { if (reader != null) { reader.Close(); } } tabbedView.Add(svgForm); svgForm.Refresh(); return(true); }
public SVGCN_Ref(SVGWord doc) : base(doc) { Init(); }