Example #1
0
        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, "");
        }
Example #2
0
        public SVGCircle(SVGWord doc, string sCX, string sCY, string sRadius) : base(doc)
        {
            Init();

            CX = sCX;
            CY = sCY;
            R  = sRadius;
        }
Example #3
0
        public SVGEllipse(SVGWord doc, string sCX, string sCY, string sRX, string sRY) : base(doc)
        {
            Init();

            CX = sCX;
            CY = sCY;
            RX = sRX;
            RY = sRY;
        }
Example #4
0
        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;
        }
Example #5
0
        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;
        }
Example #6
0
        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;
        }
Example #7
0
        // ---------- 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;
        }
Example #8
0
 public SVGCircle(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #9
0
 public SVGImage(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #10
0
        public SVGMetaData(SVGWord doc) : base(doc)
        {

            Init();

        }
Example #11
0
 public SVGSymbol(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #12
0
 /// <summary>
 /// It constructs a path element with no attribute.
 /// </summary>
 public SVGPath(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #13
0
 public SVGAnimate(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #14
0
 public SVGPolyline(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #15
0
        public SVGPolyline(SVGWord doc, string sPoints) : base(doc)
        {
            Init();

            Points = sPoints;
        }
Example #16
0
 public SVGRect(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #17
0
 public SVGDef(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #18
0
 public SVGEllipse(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #19
0
 public SVGUse(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #20
0
 public SVGDevicePort(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #21
0
 /// <summary>
 /// It constructs a polygon element with no attribute.
 /// </summary>
 /// <param name="doc">SVG document.</param>
 public SVGPolygon(SVGWord doc) : base(doc)
 {
     Init();
 }
Example #22
0
        /// <summary>
        /// It constructs a path element.
        /// </summary>
        public SVGPath(SVGWord doc, string sPathData) : base(doc)
        {
            Init();

            PathData = sPathData;
        }
Example #23
0
        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);
        }
Example #24
0
 public SVGCN_Ref(SVGWord doc) : base(doc)
 {
     Init();
 }