Ejemplo n.º 1
0
        internal void Render(MapLine mapLine, Path corePath, bool hasScope)
        {
            bool            flag            = UseCustomTemplate(mapLine, hasScope);
            MapLineTemplate mapLineTemplate = (!flag) ? MapLineLayer.MapLineTemplate : mapLine.MapLineTemplate;

            RenderLineTemplate(mapLineTemplate, corePath, !flag && m_lineLayerMapper.HasColorRule(corePath) && hasScope, !flag && m_lineLayerMapper.HasSizeRule(corePath) && hasScope, hasScope);
        }
Ejemplo n.º 2
0
        protected virtual void RenderLineTemplate(MapLineTemplate mapLineTemplate, Path corePath, bool ignoreBackgroundColor, bool ignoreSize, bool hasScope)
        {
            if (mapLineTemplate == null)
            {
                RenderStyle(null, null, corePath, ignoreBackgroundColor, hasScope);
                return;
            }
            RenderSpatialElementTemplate(mapLineTemplate, corePath, ignoreBackgroundColor, hasScope);
            Style         style  = mapLineTemplate.Style;
            StyleInstance style2 = mapLineTemplate.Instance.Style;

            corePath.LineStyle = GetBorderStyle(style, style2, hasScope);
            if (!ignoreSize)
            {
                int size = GetSize(mapLineTemplate, hasScope);
                corePath.Width = size;
            }
            ReportEnumProperty <MapLineLabelPlacement> labelPlacement = mapLineTemplate.LabelPlacement;
            PathLabelPosition labelPosition = PathLabelPosition.Above;

            if (labelPlacement != null)
            {
                if (!labelPlacement.IsExpression)
                {
                    labelPosition = GetLabelPosition(labelPlacement.Value);
                }
                else if (hasScope)
                {
                    labelPosition = GetLabelPosition(mapLineTemplate.Instance.LabelPlacement);
                }
            }
            corePath.LabelPosition = labelPosition;
        }
Ejemplo n.º 3
0
        internal int GetSize(MapLineTemplate mapLineTemplate, bool hasScope)
        {
            ReportSizeProperty width = mapLineTemplate.Width;

            if (width != null)
            {
                if (!width.IsExpression)
                {
                    return(MappingHelper.ToIntPixels(width.Value, m_mapMapper.DpiX));
                }
                if (hasScope)
                {
                    return(MappingHelper.ToIntPixels(mapLineTemplate.Instance.Width, m_mapMapper.DpiX));
                }
                return(GetDefaultSize(m_mapMapper.DpiX));
            }
            return(GetDefaultSize(m_mapMapper.DpiX));
        }
Ejemplo n.º 4
0
 internal MapLineTemplateInstance(MapLineTemplate defObject)
     : base(defObject)
 {
     m_defObject = defObject;
 }