Beispiel #1
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The XAxis object from which to copy</param>
		public Legend( Legend rhs )
		{
			_rect = rhs.Rect;
			_position = rhs.Position;
			_isHStack = rhs.IsHStack;
			_isVisible = rhs.IsVisible;

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

			_fontSpec = rhs.FontSpec.Clone();

			_gap = rhs._gap;

			_isReverse = rhs._isReverse;

			_isShowLegendSymbols = rhs._isShowLegendSymbols;
		}
Beispiel #2
0
		/// <summary>
		/// 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" );

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

			_gap = info.GetSingle( "gap" );

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

			if ( schema >= 12 )
				_isShowLegendSymbols = info.GetBoolean( "isShowLegendSymbols" );
		}
Beispiel #3
0
        /// <summary>
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">The <see cref="GraphObj"/> object from which to copy</param>
        public GraphObj( GraphObj rhs )
        {
            // Copy value types
            _isVisible = rhs.IsVisible;
            _isClippedToChartRect = rhs._isClippedToChartRect;
            _zOrder = rhs.ZOrder;

            // copy reference types by cloning
            if ( rhs.Tag is ICloneable )
                this.Tag = ((ICloneable) rhs.Tag).Clone();
            else
                this.Tag = rhs.Tag;

            _location = rhs.Location.Clone();
            _link = rhs._link.Clone();
        }
Beispiel #4
0
        /// <summary>
        /// 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 GraphObj( 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" );

            _location = (Location) info.GetValue( "location", typeof(Location) );
            _isVisible = info.GetBoolean( "isVisible" );
            Tag = info.GetValue( "Tag", typeof(object) );
            _zOrder = (ZOrder) info.GetValue( "zOrder", typeof(ZOrder) );

            _isClippedToChartRect = info.GetBoolean( "isClippedToChartRect" );
            _link = (Link) info.GetValue( "link", typeof( Link ) );
        }
Beispiel #5
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The <see cref="Location"/> object from which to copy</param>
		public Location(Location rhs)
		{
			_x = rhs._x;
			_y = rhs._y;
			_width = rhs._width;
			_height = rhs._height;
			_coordinateFrame = rhs.CoordinateFrame;
			_alignH = rhs.AlignH;
			_alignV = rhs.AlignV;
		}
Beispiel #6
0
        /// <summary>
        /// Constructor that creates a <see cref="GraphObj"/> with the specified
        /// position, <see cref="CoordType"/>, <see cref="AlignH"/>, and <see cref="AlignV"/>.
        /// Other properties are set to default values as defined in the <see cref="Default"/> class.
        /// </summary>
        /// <remarks>
        /// The four coordinates define the starting point and ending point for
        /// <see cref="ArrowObj"/>'s, or the topleft and bottomright points for
        /// <see cref="ImageObj"/>'s.  For <see cref="GraphObj"/>'s that only require
        /// one point, the <see paramref="x2"/> and <see paramref="y2"/> values
        /// will be ignored.  The units of the coordinates are specified by the
        /// <see cref="ZedGraph.Location.CoordinateFrame"/> property.
        /// </remarks>
        /// <param name="x">The x position of the item.</param>
        /// <param name="y">The y position of the item.</param>
        /// <param name="x2">The x2 position of the item.</param>
        /// <param name="y2">The x2 position of the item.</param>
        /// <param name="coordType">The <see cref="CoordType"/> enum value that
        /// indicates what type of coordinate system the x and y parameters are
        /// referenced to.</param>
        /// <param name="alignH">The <see cref="ZedGraph.AlignH"/> enum that specifies
        /// the horizontal alignment of the object with respect to the (x,y) location</param>
        /// <param name="alignV">The <see cref="ZedGraph.AlignV"/> enum that specifies
        /// the vertical alignment of the object with respect to the (x,y) location</param>
        public GraphObj( double x, double y, double x2, double y2, CoordType coordType,
					AlignH alignH, AlignV alignV )
        {
            _isVisible = true;
            _isClippedToChartRect = Default.IsClippedToChartRect;
            this.Tag = null;
            _zOrder = ZOrder.A_InFront;
            _location = new Location( x, y, x2, y2, coordType, alignH, alignV );
            _link = new Link();
        }
Beispiel #7
0
        /// <summary>
        /// Default constructor that sets all <see cref="Legend"/> properties to default
        /// values as defined in the <see cref="Default"/> class.
        /// </summary>
        public Legend()
        {
            _position = Default.Position;
            _isHStack = Default.IsHStack;
            _isVisible = Default.IsVisible;
            Location = new Location(0, 0, CoordType.PaneFraction);

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

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

            _gap = Default.Gap;
        }
Beispiel #8
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The <see cref="Location"/> object from which to copy</param>
 public Location( Location rhs )
 {
     this.x = rhs.x;
     this.y = rhs.y;
     this.width = rhs.width;
     this.height = rhs.height;
     this.coordinateFrame = rhs.CoordinateFrame;
     this.alignH = rhs.AlignH;
     this.alignV = rhs.AlignV;
 }
Beispiel #9
0
        /// <summary>
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">The XAxis object from which to copy</param>
        public Legend( Legend rhs )
        {
            rect = rhs.Rect;
            position = rhs.Position;
            isHStack = rhs.IsHStack;
            isVisible = rhs.IsVisible;

            this.location = (Location) rhs.Location;
            this.border = (Border) rhs.Border.Clone();
            this.fill = (Fill) rhs.Fill.Clone();

            fontSpec = (FontSpec) rhs.FontSpec.Clone();
        }
Beispiel #10
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The <see cref="GraphItem"/> object from which to copy</param>
 public GraphItem( GraphItem rhs )
 {
     this.Tag = rhs.Tag;
     this.zOrder = rhs.ZOrder;
     this.location = rhs.Location;
 }
Beispiel #11
0
        /// <summary>
        /// Constructor that creates a <see cref="GraphItem"/> with the specified
        /// position, <see cref="CoordType"/>, <see cref="AlignH"/>, and <see cref="AlignV"/>.
        /// Other properties are set to default values as defined in the <see cref="Default"/> class.
        /// </summary>
        /// <remarks>
        /// The four coordinates define the starting point and ending point for
        /// <see cref="ArrowItem"/>'s, or the topleft and bottomright points for
        /// <see cref="ImageItem"/>'s.  For <see cref="GraphItem"/>'s that only require
        /// one point, the <see paramref="x2"/> and <see paramref="y2"/> values
        /// will be ignored.  The units of the coordinates are specified by the
        /// <see cref="ZedGraph.Location.CoordinateFrame"/> property.
        /// </remarks>
        /// <param name="x">The x position of the item.</param>
        /// <param name="y">The y position of the item.</param>
        /// <param name="x2">The x2 position of the item.</param>
        /// <param name="y2">The x2 position of the item.</param>
        /// <param name="coordType">The <see cref="CoordType"/> enum value that
        /// indicates what type of coordinate system the x and y parameters are
        /// referenced to.</param>
        /// <param name="alignH">The <see cref="ZedGraph.AlignH"/> enum that specifies
        /// the horizontal alignment of the object with respect to the (x,y) location</param>
        /// <param name="alignV">The <see cref="ZedGraph.AlignV"/> enum that specifies
        /// the vertical alignment of the object with respect to the (x,y) location</param>
        public GraphItem( float x, float y, float x2, float y2, CoordType coordType,
					AlignH alignH, AlignV alignV )
        {
            this.Tag = null;
            this.zOrder = ZOrder.A_InFront;
            this.location = new Location( x, y, x2, y2, coordType, alignH, alignV );
        }