Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Label"/> class. 
        /// Constructor to build an <see cref="AxisLabel"/> from the text and the associated font properties.
        /// </summary>
        /// <param name="text">
        /// The <see cref="string"/> representing the text to be displayed
        /// </param>
        /// <param name="fontFamily">
        /// The <see cref="String"/> font family name
        /// </param>
        /// <param name="fontSize">
        /// The size of the font in points and scaled according to the <see cref="PaneBase.CalcScaleFactor"/> logic.
        /// </param>
        /// <param name="color">
        /// The <see cref="Color"/> instance representing the color of the font
        /// </param>
        /// <param name="isBold">
        /// true for a bold font face
        /// </param>
        /// <param name="isItalic">
        /// true for an italic font face
        /// </param>
        /// <param name="isUnderline">
        /// true for an underline font face
        /// </param>
        public Label(string text, string fontFamily, float fontSize, Color color, bool isBold, bool isItalic, bool isUnderline)
        {
            this._text = (text == null) ? string.Empty : text;

            this._fontSpec = new FontSpec(fontFamily, fontSize, color, isBold, isItalic, isUnderline);
            this._isVisible = true;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Legend"/> class. 
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">
        /// A <see cref="SerializationInfo"/> instance that defines the serialized data
        /// </param>
        /// <param name="context">
        /// A <see cref="StreamingContext"/> instance that contains the serialized data
        /// </param>
        protected Legend(SerializationInfo info, StreamingContext context)
        {
            // The schema value is just a file version parameter.  You can use it to make future versions
            // backwards compatible as new member variables are added to classes
            int sch = info.GetInt32("schema");

            this._position = (LegendPos)info.GetValue("position", typeof(LegendPos));
            this._isHStack = info.GetBoolean("isHStack");
            this._isVisible = info.GetBoolean("isVisible");
            this._fill = (Fill)info.GetValue("fill", typeof(Fill));
            this._border = (Border)info.GetValue("border", typeof(Border));
            this._fontSpec = (FontSpec)info.GetValue("fontSpec", typeof(FontSpec));
            this._location = (Location)info.GetValue("location", typeof(Location));

            this._gap = info.GetSingle("gap");

            if (schema >= 11)
            {
                this._isReverse = info.GetBoolean("isReverse");
            }

            if (schema >= 12)
            {
                this._isShowLegendSymbols = info.GetBoolean("isShowLegendSymbols");
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Legend"/> class. 
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">
        /// The XAxis object from which to copy
        /// </param>
        public Legend(Legend rhs)
        {
            this._rect = rhs.Rect;
            this._position = rhs.Position;
            this._isHStack = rhs.IsHStack;
            this._isVisible = rhs.IsVisible;

            this._location = rhs.Location;
            this._border = rhs.Border.Clone();
            this._fill = rhs.Fill.Clone();

            this._fontSpec = rhs.FontSpec.Clone();

            this._gap = rhs._gap;

            this._isReverse = rhs._isReverse;

            this._isShowLegendSymbols = rhs._isShowLegendSymbols;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Legend"/> class. Default constructor that sets all <see cref="Legend"/> properties to default values as defined in the <see cref="Default"/> class.
        /// </summary>
        public Legend()
        {
            this._position = Default.Position;
            this._isHStack = Default.IsHStack;
            this._isVisible = Default.IsVisible;
            this.Location = new Location(0, 0, CoordType.PaneFraction);

            this._fontSpec = new FontSpec(
                Default.FontFamily,
                Default.FontSize,
                Default.FontColor,
                Default.FontBold,
                Default.FontItalic,
                Default.FontUnderline,
                Default.FontFillColor,
                Default.FontFillBrush,
                Default.FontFillType);
            this._fontSpec.Border.IsVisible = false;

            this._border = new Border(Default.IsBorderVisible, Default.BorderColor, Default.BorderWidth);
            this._fill = new Fill(Default.FillColor, Default.FillBrush, Default.FillType);

            this._gap = Default.Gap;

            this._isReverse = Default.IsReverse;

            this._isShowLegendSymbols = Default.IsShowLegendSymbols;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// The init.
        /// </summary>
        /// <param name="text">
        /// The text.
        /// </param>
        private void Init(string text)
        {
            if (text != null)
            {
                this._text = text;
            }
            else
            {
                text = "Text";
            }

            this._fontSpec = new FontSpec(
                Default.FontFamily,
                Default.FontSize,
                Default.FontColor,
                Default.FontBold,
                Default.FontItalic,
                Default.FontUnderline);

            // this.isWrapped = Default.IsWrapped ;
            this._layoutArea = new SizeF(0, 0);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TextObj"/> class. 
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">
        /// A <see cref="SerializationInfo"/> instance that defines the serialized data
        /// </param>
        /// <param name="context">
        /// A <see cref="StreamingContext"/> instance that contains the serialized data
        /// </param>
        protected TextObj(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
            // The schema value is just a file version parameter.  You can use it to make future versions
            // backwards compatible as new member variables are added to classes
            int sch = info.GetInt32("schema2");

            this._text = info.GetString("text");
            this._fontSpec = (FontSpec)info.GetValue("fontSpec", typeof(FontSpec));

            // isWrapped = info.GetBoolean ("isWrapped") ;
            this._layoutArea = (SizeF)info.GetValue("layoutArea", typeof(SizeF));
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TextObj"/> class. 
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">
 /// The <see cref="TextObj"/> object from which to copy
 /// </param>
 public TextObj(TextObj rhs)
     : base(rhs)
 {
     this._text = rhs.Text;
     this._fontSpec = new FontSpec(rhs.FontSpec);
 }
Ejemplo n.º 8
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Scale"/> class. 
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">
        /// A <see cref="SerializationInfo"/> instance that defines the serialized data
        /// </param>
        /// <param name="context">
        /// A <see cref="StreamingContext"/> instance that contains the serialized data
        /// </param>
        protected Scale(SerializationInfo info, StreamingContext context)
        {
            // The schema value is just a file version parameter.  You can use it to make future versions
            // backwards compatible as new member variables are added to classes
            int sch = info.GetInt32("schema");

            this._min = info.GetDouble("min");
            this._max = info.GetDouble("max");
            this._majorStep = info.GetDouble("majorStep");
            this._minorStep = info.GetDouble("minorStep");
            this._exponent = info.GetDouble("exponent");
            this._baseTic = info.GetDouble("baseTic");

            this._minAuto = info.GetBoolean("minAuto");
            this._maxAuto = info.GetBoolean("maxAuto");
            this._majorStepAuto = info.GetBoolean("majorStepAuto");
            this._minorStepAuto = info.GetBoolean("minorStepAuto");
            this._magAuto = info.GetBoolean("magAuto");
            this._formatAuto = info.GetBoolean("formatAuto");

            this._minGrace = info.GetDouble("minGrace");
            this._maxGrace = info.GetDouble("maxGrace");

            this._mag = info.GetInt32("mag");

            this._isReverse = info.GetBoolean("isReverse");
            this._isPreventLabelOverlap = info.GetBoolean("isPreventLabelOverlap");
            this._isUseTenPower = info.GetBoolean("isUseTenPower");

            this._isVisible = true;
            this._isVisible = info.GetBoolean("isVisible");

            this._isSkipFirstLabel = info.GetBoolean("isSkipFirstLabel");
            this._isSkipLastLabel = info.GetBoolean("isSkipLastLabel");
            this._isSkipCrossLabel = info.GetBoolean("isSkipCrossLabel");

            this._textLabels = (string[])info.GetValue("textLabels", typeof(string[]));
            this._format = info.GetString("format");

            this._majorUnit = (DateUnit)info.GetValue("majorUnit", typeof(DateUnit));
            this._minorUnit = (DateUnit)info.GetValue("minorUnit", typeof(DateUnit));

            this._isLabelsInside = info.GetBoolean("isLabelsInside");
            this._align = (AlignP)info.GetValue("align", typeof(AlignP));
            if (schema >= 11)
            {
                this._alignH = (AlignH)info.GetValue("alignH", typeof(AlignH));
            }

            this._fontSpec = (FontSpec)info.GetValue("fontSpec", typeof(FontSpec));
            this._labelGap = info.GetSingle("labelGap");
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Scale"/> class. 
        /// Copy Constructor.  Create a new <see cref="Scale"/> object based on the specified existing one.
        /// </summary>
        /// <param name="rhs">
        /// The <see cref="Scale"/> object to be copied.
        /// </param>
        /// <param name="owner">
        /// The <see cref="Axis"/> object that will own the new instance of <see cref="Scale"/>
        /// </param>
        public Scale(Scale rhs, Axis owner)
        {
            this._ownerAxis = owner;

            this._min = rhs._min;
            this._max = rhs._max;
            this._majorStep = rhs._majorStep;
            this._minorStep = rhs._minorStep;
            this._exponent = rhs._exponent;
            this._baseTic = rhs._baseTic;

            this._minAuto = rhs._minAuto;
            this._maxAuto = rhs._maxAuto;
            this._majorStepAuto = rhs._majorStepAuto;
            this._minorStepAuto = rhs._minorStepAuto;
            this._magAuto = rhs._magAuto;
            this._formatAuto = rhs._formatAuto;

            this._minGrace = rhs._minGrace;
            this._maxGrace = rhs._maxGrace;

            this._mag = rhs._mag;

            this._isUseTenPower = rhs._isUseTenPower;
            this._isReverse = rhs._isReverse;
            this._isPreventLabelOverlap = rhs._isPreventLabelOverlap;
            this._isVisible = rhs._isVisible;
            this._isSkipFirstLabel = rhs._isSkipFirstLabel;
            this._isSkipLastLabel = rhs._isSkipLastLabel;
            this._isSkipCrossLabel = rhs._isSkipCrossLabel;

            this._majorUnit = rhs._majorUnit;
            this._minorUnit = rhs._minorUnit;

            this._format = rhs._format;

            this._isLabelsInside = rhs._isLabelsInside;
            this._align = rhs._align;
            this._alignH = rhs._alignH;

            this._fontSpec = rhs._fontSpec.Clone();

            this._labelGap = rhs._labelGap;

            if (rhs._textLabels != null)
            {
                this._textLabels = (string[])rhs._textLabels.Clone();
            }
            else
            {
                this._textLabels = null;
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Scale"/> class. 
        /// Basic constructor -- requires that the <see cref="Scale"/> object be intialized with a pre-existing owner <see cref="Axis"/>.
        /// </summary>
        /// <param name="ownerAxis">
        /// The <see cref="Axis"/> object that is the owner of this
        /// <see cref="Scale"/> instance.
        /// </param>
        public Scale(Axis ownerAxis)
        {
            this._ownerAxis = ownerAxis;

            this._min = 0.0;
            this._max = 1.0;
            this._majorStep = 0.1;
            this._minorStep = 0.1;
            this._exponent = 1.0;
            this._mag = 0;
            this._baseTic = PointPairBase.Missing;

            this._minGrace = Default.MinGrace;
            this._maxGrace = Default.MaxGrace;

            this._minAuto = true;
            this._maxAuto = true;
            this._majorStepAuto = true;
            this._minorStepAuto = true;
            this._magAuto = true;
            this._formatAuto = true;

            this._isReverse = Default.IsReverse;
            this._isUseTenPower = true;
            this._isPreventLabelOverlap = true;
            this._isVisible = true;
            this._isSkipFirstLabel = false;
            this._isSkipLastLabel = false;
            this._isSkipCrossLabel = false;

            this._majorUnit = DateUnit.Day;
            this._minorUnit = DateUnit.Day;

            this._format = null;
            this._textLabels = null;

            this._isLabelsInside = Default.IsLabelsInside;
            this._align = Default.Align;
            this._alignH = Default.AlignH;

            this._fontSpec = new FontSpec(
                Default.FontFamily,
                Default.FontSize,
                Default.FontColor,
                Default.FontBold,
                Default.FontUnderline,
                Default.FontItalic,
                Default.FillColor,
                Default.FillBrush,
                Default.FillType);

            this._fontSpec.Border.IsVisible = false;
            this._labelGap = Default.LabelGap;
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="FontSpec"/> class. 
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">
        /// The FontSpec object from which to copy
        /// </param>
        public FontSpec(FontSpec rhs)
        {
            this._fontColor = rhs.FontColor;
            this._family = rhs.Family;
            this._isBold = rhs.IsBold;
            this._isItalic = rhs.IsItalic;
            this._isUnderline = rhs.IsUnderline;
            this._fill = rhs.Fill.Clone();
            this._border = rhs.Border.Clone();
            this._isAntiAlias = rhs._isAntiAlias;

            this._stringAlignment = rhs.StringAlignment;
            this._angle = rhs.Angle;
            this._size = rhs.Size;

            this._isDropShadow = rhs._isDropShadow;
            this._dropShadowColor = rhs._dropShadowColor;
            this._dropShadowAngle = rhs._dropShadowAngle;
            this._dropShadowOffset = rhs._dropShadowOffset;

            this._scaledSize = rhs._scaledSize;
            this.Remake(1.0F, this._size, ref this._scaledSize, ref this._font);
        }
Ejemplo n.º 12
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Label"/> class. 
        /// Constructor that builds a <see cref="Label"/> from a text <see cref="string"/>
        /// and a <see cref="FontSpec"/> instance.
        /// </summary>
        /// <param name="text">
        /// </param>
        /// <param name="fontSpec">
        /// </param>
        public Label(string text, FontSpec fontSpec)
        {
            this._text = (text == null) ? string.Empty : text;

            this._fontSpec = fontSpec;
            this._isVisible = true;
        }
Ejemplo n.º 13
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Label"/> class. 
        /// Constructor for deserializing objects
        /// </summary>
        /// <param name="info">
        /// A <see cref="SerializationInfo"/> instance that defines the serialized data
        /// </param>
        /// <param name="context">
        /// A <see cref="StreamingContext"/> instance that contains the serialized data
        /// </param>
        protected Label(SerializationInfo info, StreamingContext context)
        {
            // The schema value is just a file version parameter.  You can use it to make future versions
            // backwards compatible as new member variables are added to classes
            int sch = info.GetInt32("schema");

            this._text = info.GetString("text");
            this._isVisible = info.GetBoolean("isVisible");
            this._fontSpec = (FontSpec)info.GetValue("fontSpec", typeof(FontSpec));
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Label"/> class. 
        /// Copy constructor
        /// </summary>
        /// <param name="rhs">
        /// the <see cref="Label"/> instance to be copied.
        /// </param>
        public Label(Label rhs)
        {
            if (rhs._text != null)
            {
                this._text = (string)rhs._text.Clone();
            }
            else
            {
                this._text = string.Empty;
            }

            this._isVisible = rhs._isVisible;
            if (rhs._fontSpec != null)
            {
                this._fontSpec = rhs._fontSpec.Clone();
            }
            else
            {
                this._fontSpec = null;
            }
        }