Ejemplo n.º 1
0
        public PathText(IGraphicFactory graphicFactory, DisplayModel displayModel, string elementName, XmlReader reader) : base(graphicFactory, displayModel)
        {
            this.fill           = graphicFactory.CreatePaint();
            this.fill.Color     = Color.Black.ToARGB();
            this.fill.Style     = Style.Fill;
            this.fill.TextAlign = Align.Center;
            this.fills          = new Dictionary <sbyte?, IPaint>();

            this.stroke           = graphicFactory.CreatePaint();
            this.stroke.Color     = Color.Black.ToARGB();
            this.stroke.Style     = Style.Stroke;
            this.stroke.TextAlign = Align.Center;
            this.strokes          = new Dictionary <sbyte?, IPaint>();
            this.dyScaled         = new Dictionary <sbyte?, float?>();
            this.display          = Display.Ifspace;

            ExtractValues(graphicFactory, displayModel, elementName, reader);
        }
Ejemplo n.º 2
0
        public Area(IGraphicFactory graphicFactory, DisplayModel displayModel, string elementName, XmlReader reader, int level, string relativePathPrefix) : base(graphicFactory, displayModel)
        {
            this.level = level;
            this.relativePathPrefix = relativePathPrefix;

            this.fill           = graphicFactory.CreatePaint();
            this.fill.Color     = Color.Transparent.ToARGB();
            this.fill.Style     = Style.Fill;
            this.fill.StrokeCap = Cap.Round;

            this.stroke           = graphicFactory.CreatePaint();
            this.stroke.Color     = Color.Transparent.ToARGB();
            this.stroke.Style     = Style.Stroke;
            this.stroke.StrokeCap = Cap.Round;

            this.strokes = new Dictionary <sbyte?, IPaint>();

            ExtractValues(elementName, reader);
        }
Ejemplo n.º 3
0
        public Circle(IGraphicFactory graphicFactory, DisplayModel displayModel, string elementName, XmlReader reader, int level) : base(graphicFactory, displayModel)
        {
            this.level = level;

            this.fill       = graphicFactory.CreatePaint();
            this.fill.Color = Color.Transparent.ToARGB();
            this.fill.Style = Style.Fill;
            this.fills      = new Dictionary <sbyte?, IPaint>();

            this.stroke             = graphicFactory.CreatePaint();
            this.stroke.Color       = Color.Transparent.ToARGB();
            this.stroke.Style       = Style.Stroke;
            this.strokes            = new Dictionary <sbyte?, IPaint>();
            this.renderRadiusScaled = new Dictionary <sbyte?, float?>();

            ExtractValues(graphicFactory, displayModel, elementName, reader);


            if (!this.scaleRadius)
            {
                this.renderRadius       = this.radius;
                this.stroke.StrokeWidth = this.strokeWidth;
            }
        }
Ejemplo n.º 4
0
        public Line(IGraphicFactory graphicFactory, DisplayModel displayModel, string elementName, XmlReader reader, int level, string relativePathPrefix) : base(graphicFactory, displayModel)
        {
            this.level = level;
            this.relativePathPrefix = relativePathPrefix;

            this.stroke            = graphicFactory.CreatePaint();
            this.stroke.Color      = Color.Green.ToARGB();
            this.stroke.Style      = Style.Stroke;
            this.stroke.StrokeCap  = Cap.Round;
            this.stroke.StrokeJoin = Join.Round;
            this.strokes           = new Dictionary <sbyte?, IPaint>();
            this.dyScaled          = new Dictionary <sbyte?, float?>();

            ExtractValues(graphicFactory, displayModel, elementName, reader, relativePathPrefix);
        }
Ejemplo n.º 5
0
        public Caption(IGraphicFactory graphicFactory, DisplayModel displayModel, string elementName, XmlReader reader, IDictionary <string, Symbol> symbols) : base(graphicFactory, displayModel)
        {
            this.fill       = graphicFactory.CreatePaint();
            this.fill.Color = Color.Black.ToARGB();
            this.fill.Style = Style.Fill;
            this.fills      = new Dictionary <sbyte?, IPaint>();

            this.stroke       = graphicFactory.CreatePaint();
            this.stroke.Color = Color.Black.ToARGB();
            this.stroke.Style = Style.Stroke;
            this.strokes      = new Dictionary <sbyte?, IPaint>();
            this.dyScaled     = new Dictionary <sbyte?, float?>();


            this.display = Display.Ifspace;

            this.gap = DEFAULT_GAP * displayModel.ScaleFactor;

            ExtractValues(graphicFactory, displayModel, elementName, reader);

            if (!string.ReferenceEquals(this.symbolId, null))
            {
                Symbol symbol = symbols[this.symbolId];
                if (symbol != null)
                {
                    this.bitmap = symbol.Bitmap;
                }
            }

            if (this.position == Position.Auto)
            {
                // sensible defaults: below if symbolContainer is present, center if not
                if (this.bitmap == null)
                {
                    this.position = Position.Center;
                }
                else
                {
                    this.position = Position.Below;
                }
            }
            else if (this.position == Position.Center || this.position == Position.Below || this.position == Position.Above)
            {
                this.stroke.TextAlign = Align.Center;
                this.fill.TextAlign   = Align.Center;
            }
            else if (this.position == Position.BelowLeft || this.position == Position.AboveLeft || this.position == Position.Left)
            {
                this.stroke.TextAlign = Align.Right;
                this.fill.TextAlign   = Align.Right;
            }
            else if (this.position == Position.BelowRight || this.position == Position.AboveRight || this.position == Position.Right)
            {
                this.stroke.TextAlign = Align.Left;
                this.fill.TextAlign   = Align.Left;
            }
            else
            {
                throw new System.ArgumentException("Position invalid");
            }

            this.maxTextWidth = displayModel.MaxTextWidth;
        }