Example #1
0
File: Chart.cs Project: CareyGit/jx
		/// <summary>
		/// Copy constructor
		/// </summary>
		/// <param name="rhs">The source <see c_ref="Chart" /> to be copied.</param>
		public Chart( Chart rhs )
		{
			_border = rhs._border.Clone();
			_fill = rhs._fill.Clone();
			_rect = rhs._rect;
			_isRectAuto = rhs._isRectAuto;
		}
Example #2
0
		/// <summary>
		/// Constructor for deserializing objects
		/// </summary>
		/// <param name="info">A <see c_ref="SerializationInfo"/> instance that defines the serialized data
		/// </param>
		/// <param name="context">A <see c_ref="StreamingContext"/> instance that contains the serialized data
		/// </param>
		protected GasGaugeNeedle( 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" );

			_labelDetail = (TextObj)info.GetValue( "labelDetail", typeof( TextObj ) );
			_fill = (Fill)info.GetValue( "fill", typeof( Fill ) );
			_border = (Border)info.GetValue( "border", typeof( Border ) );
			_needleValue = info.GetDouble( "needleValue" );
			_boundingRectangle = (RectangleF)info.GetValue( "boundingRectangle", typeof( RectangleF ) );
			_slicePath = (GraphicsPath)info.GetValue( "slicePath", typeof( GraphicsPath ) );
			_sweepAngle = (float)info.GetDouble( "sweepAngle" );
			_color = (Color)info.GetValue( "color", typeof( Color ) );
		}
Example #3
0
		/// <summary>
		/// Create a new <see c_ref="GasGaugeNeedle"/>
		/// </summary>
		/// <param name="label">The value associated with this <see c_ref="GasGaugeNeedle"/>
		/// instance.</param>
		/// <param name="color">The display color for this <see c_ref="GasGaugeNeedle"/>
		/// instance.</param>
		/// <param name="val">The value of this <see c_ref="GasGaugeNeedle"/>.</param>
		public GasGaugeNeedle( string label, double val, Color color )
			: base( label )
		{
			NeedleValue = val;
			NeedleColor = color;
			NeedleWidth = Default.NeedleWidth;
			SweepAngle = 0f;
			_border = new Border( Default.BorderColor, Default.BorderWidth );
			_labelDetail = new TextObj();
			_labelDetail.FontSpec.Size = Default.FontSize;
			_slicePath = null;
		}
Example #4
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The FontSpec object from which to copy</param>
		public FontSpec( FontSpec rhs )
		{
			_fontColor = rhs.FontColor;
			_family = rhs.Family;
			_isBold = rhs.IsBold;
			_isItalic = rhs.IsItalic;
			_isUnderline = rhs.IsUnderline;
			_fill = rhs.Fill.Clone();
			_border = rhs.Border.Clone();
			_isAntiAlias = rhs._isAntiAlias;

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

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

			_scaledSize = rhs._scaledSize;
			Remake( 1.0F, _size, ref _scaledSize, ref _font );
		}
Example #5
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="ggr">The <see c_ref="GasGaugeRegion"/> object from which to copy</param>
		public GasGaugeRegion( GasGaugeRegion ggr )
			: base( ggr )
		{
			_minValue = ggr._minValue;
			_maxValue = ggr._maxValue;
			_color = ggr._color;
			_startAngle = ggr._startAngle;
			_sweepAngle = ggr._sweepAngle;
			_border = ggr._border.Clone();
			_labelDetail = ggr._labelDetail.Clone();
		}
Example #6
0
		/// <summary>
		/// Constructor for deserializing objects
		/// </summary>
		/// <param name="info">A <see c_ref="SerializationInfo"/> instance that defines the serialized data
		/// </param>
		/// <param name="context">A <see c_ref="StreamingContext"/> instance that contains the serialized data
		/// </param>
		protected PaneBase( 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" );

			_rect = (RectangleF) info.GetValue( "rect", typeof(RectangleF) );
			_legend = (Legend) info.GetValue( "legend", typeof(Legend) );
			_title = (GapLabel) info.GetValue( "title", typeof(GapLabel) );
			//this.isShowTitle = info.GetBoolean( "isShowTitle" );
			_isFontsScaled = info.GetBoolean( "isFontsScaled" );
			_isPenWidthScaled = info.GetBoolean( "isPenWidthScaled" );
			//this.fontSpec = (FontSpec) info.GetValue( "fontSpec" , typeof(FontSpec) );
			_titleGap = info.GetSingle( "titleGap" );
			_fill = (Fill) info.GetValue( "fill", typeof(Fill) );
			_border = (Border) info.GetValue( "border", typeof(Border) );
			_baseDimension = info.GetSingle( "baseDimension" );
			_margin = (Margin)info.GetValue( "margin", typeof( Margin ) );
			_graphObjList = (GraphObjList) info.GetValue( "graphObjList", typeof(GraphObjList) );

			_tag = info.GetValue( "tag", typeof(object) );

		}
Example #7
0
		/// <summary>
		/// Default constructor for the <see c_ref="PaneBase"/> class.  Specifies the <see c_ref="Title"/> of
		/// the <see c_ref="PaneBase"/>, and the size of the <see c_ref="Rect"/>.
		/// </summary>
		public PaneBase( string title, RectangleF paneRect )
		{
			_rect = paneRect;

			_legend = new Legend();
				
			_baseDimension = Default.BaseDimension;
			_margin = new Margin();
			_titleGap = Default.TitleGap;

			_isFontsScaled = Default.IsFontsScaled;
			_isPenWidthScaled = Default.IsPenWidthScaled;
			_fill = new Fill( Default.FillColor );
			_border = new Border( Default.IsBorderVisible, Default.BorderColor,
				Default.BorderPenWidth );

			_title = new GapLabel( title, Default.FontFamily,
				Default.FontSize, Default.FontColor, Default.FontBold,
				Default.FontItalic, Default.FontUnderline );
			_title._fontSpec.Fill.IsVisible = false;
			_title._fontSpec.Border.IsVisible = false;

			_graphObjList = new GraphObjList();
			
			_tag = null;
		}
Example #8
0
		/// <summary>
		/// Constructor for deserializing objects
		/// </summary>
		/// <param name="info">A <see c_ref="SerializationInfo"/> instance that defines the serialized data
		/// </param>
		/// <param name="context">A <see c_ref="StreamingContext"/> instance that contains the serialized data
		/// </param>
		protected JapaneseCandleStick( 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" );

			_risingFill = (Fill)info.GetValue( "risingFill", typeof( Fill ) );
			_fallingFill = (Fill)info.GetValue( "fallingFill", typeof( Fill ) );
			_risingBorder = (Border)info.GetValue( "risingBorder", typeof( Border ) );
			_fallingBorder = (Border)info.GetValue( "fallingBorder", typeof( Border ) );

			if ( schema2 >= 11 )
				_fallingColor = (Color) info.GetValue( "fallingColor", typeof( Color ) );
		}
Example #9
0
		/// <summary>
		/// A constructor that allows the position, border color, and two-color
		/// gradient fill colors
		/// of the <see c_ref="BoxObj"/> to be pre-specified.
		/// </summary>
		/// <param name="borderColor">An arbitrary <see c_ref="System.Drawing.Color"/> specification
		/// for the box border</param>
		/// <param name="fillColor1">An arbitrary <see c_ref="System.Drawing.Color"/> specification
		/// for the start of the box gradient fill</param>
		/// <param name="fillColor2">An arbitrary <see c_ref="System.Drawing.Color"/> specification
		/// for the end of the box gradient fill</param>
		/// <param name="x">The x location for this <see c_ref="BoxObj" />.  This will be in units determined by
		/// <see c_ref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="y">The y location for this <see c_ref="BoxObj" />.  This will be in units determined by
		/// <see c_ref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="width">The width of this <see c_ref="BoxObj" />.  This will be in units determined by
		/// <see c_ref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="height">The height of this <see c_ref="BoxObj" />.  This will be in units determined by
		/// <see c_ref="ZedGraph.Location.CoordinateFrame" />.</param>
		public BoxObj( double x, double y, double width, double height, Color borderColor,
							Color fillColor1, Color fillColor2 ) :
				base( x, y, width, height )
		{
			Border = new Border( borderColor, Default.PenWidth );
			Fill = new Fill( fillColor1, fillColor2 );
		}
Example #10
0
		/// <summary>
		/// A constructor that allows the position
		/// of the <see c_ref="BoxObj"/> to be pre-specified.  Other properties are defaulted.
		/// </summary>
		/// <param name="x">The x location for this <see c_ref="BoxObj" />.  This will be in units determined by
		/// <see c_ref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="y">The y location for this <see c_ref="BoxObj" />.  This will be in units determined by
		/// <see c_ref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="width">The width of this <see c_ref="BoxObj" />.  This will be in units determined by
		/// <see c_ref="ZedGraph.Location.CoordinateFrame" />.</param>
		/// <param name="height">The height of this <see c_ref="BoxObj" />.  This will be in units determined by
		/// <see c_ref="ZedGraph.Location.CoordinateFrame" />.</param>
		public BoxObj( double x, double y, double width, double height )
			:
			base( x, y, width, height )
		{
			Border = new Border( Default.BorderColor, Default.PenWidth );
			Fill = new Fill( Default.FillColor );
		}
Example #11
0
        /// <summary>
        /// Draw all the <see c_ref="JapaneseCandleStick"/>'s to the specified <see c_ref="Graphics"/>
        /// device as a candlestick at each defined point.
        /// </summary>
        /// <param name="g">
        /// A graphic device object to be drawn into.  This is normally e.Graphics from the
        /// PaintEventArgs argument to the Paint() method.
        /// </param>
        /// <param name="pane">
        /// A reference to the <see c_ref="GraphPane"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <param name="curve">A <see c_ref="JapaneseCandleStickItem"/> object representing the
        /// <see c_ref="JapaneseCandleStick"/>'s to be drawn.</param>
        /// <param name="baseAxis">The <see c_ref="Axis"/> class instance that defines the base (independent)
        /// axis for the <see c_ref="JapaneseCandleStick"/></param>
        /// <param name="valueAxis">The <see c_ref="Axis"/> class instance that defines the value (dependent)
        /// axis for the <see c_ref="JapaneseCandleStick"/></param>
        /// <param name="scaleFactor">
        /// The scaling factor to be used for rendering objects.  This is calculated and
        /// passed down by the parent <see c_ref="GraphPane"/> object using the
        /// <see c_ref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust
        /// font sizes, etc. according to the actual size of the graph.
        /// </param>
        public void Draw(Graphics g, GraphPane pane, JapaneseCandleStickItem curve,
                         Axis baseAxis, Axis valueAxis, float scaleFactor)
        {
            //ValueHandler valueHandler = new ValueHandler( pane, false );

            float pixBase, pixHigh, pixLow, pixOpen, pixClose;

            if (curve.Points != null)
            {
                //float halfSize = _size * scaleFactor;
                float halfSize = GetBarWidth(pane, baseAxis, scaleFactor);

                Color  tColor         = _color;
                Color  tFallingColor  = _fallingColor;
                float  tPenWidth      = _width;
                Fill   tRisingFill    = _risingFill;
                Fill   tFallingFill   = _fallingFill;
                Border tRisingBorder  = _risingBorder;
                Border tFallingBorder = _fallingBorder;
                if (curve.IsSelected)
                {
                    tColor         = Selection.Border.Color;
                    tFallingColor  = Selection.Border.Color;
                    tPenWidth      = Selection.Border.Width;
                    tRisingFill    = Selection.Fill;
                    tFallingFill   = Selection.Fill;
                    tRisingBorder  = Selection.Border;
                    tFallingBorder = Selection.Border;
                }

                using (Pen risingPen = new Pen(tColor, tPenWidth))
                    using (Pen fallingPen = new Pen(tFallingColor, tPenWidth))
                    {
                        // Loop over each defined point
                        for (int i = 0; i < curve.Points.Count; i++)
                        {
                            PointPair pt    = curve.Points[i];
                            double    date  = pt.X;
                            double    high  = pt.Y;
                            double    low   = pt.Z;
                            double    open  = PointPair.Missing;
                            double    close = PointPair.Missing;
                            if (pt is StockPt)
                            {
                                open  = (pt as StockPt).Open;
                                close = (pt as StockPt).Close;
                            }

                            // Any value set to double max is invalid and should be skipped
                            // This is used for calculated values that are out of range, divide
                            //   by zero, etc.
                            // Also, any value <= zero on a log scale is invalid

                            if (!curve.Points[i].IsInvalid3D &&
                                (date > 0 || !baseAxis._scale.IsLog) &&
                                ((high > 0 && low > 0) || !valueAxis._scale.IsLog))
                            {
                                pixBase = (int)(baseAxis.Scale.Transform(curve.IsOverrideOrdinal, i, date) + 0.5);
                                //pixBase = baseAxis.Scale.Transform( curve.IsOverrideOrdinal, i, date );
                                pixHigh = valueAxis.Scale.Transform(curve.IsOverrideOrdinal, i, high);
                                pixLow  = valueAxis.Scale.Transform(curve.IsOverrideOrdinal, i, low);
                                if (PointPair.IsValueInvalid(open))
                                {
                                    pixOpen = Single.MaxValue;
                                }
                                else
                                {
                                    pixOpen = valueAxis.Scale.Transform(curve.IsOverrideOrdinal, i, open);
                                }

                                if (PointPair.IsValueInvalid(close))
                                {
                                    pixClose = Single.MaxValue;
                                }
                                else
                                {
                                    pixClose = valueAxis.Scale.Transform(curve.IsOverrideOrdinal, i, close);
                                }

                                if (!curve.IsSelected && _gradientFill.IsGradientValueType)
                                {
                                    using (Pen tPen = GetPen(pane, scaleFactor, pt))
                                        Draw(g, pane, baseAxis is XAxis || baseAxis is X2Axis,
                                             pixBase, pixHigh, pixLow, pixOpen,
                                             pixClose, halfSize, scaleFactor,
                                             (tPen),
                                             (close > open ? tRisingFill : tFallingFill),
                                             (close > open ? tRisingBorder : tFallingBorder), pt);
                                }
                                else
                                {
                                    Draw(g, pane, baseAxis is XAxis || baseAxis is X2Axis,
                                         pixBase, pixHigh, pixLow, pixOpen,
                                         pixClose, halfSize, scaleFactor,
                                         (close > open ? risingPen : fallingPen),
                                         (close > open ? tRisingFill : tFallingFill),
                                         (close > open ? tRisingBorder : tFallingBorder), pt);
                                }
                            }
                        }
                    }
            }
        }
Example #12
0
File: Chart.cs Project: CareyGit/jx
		/// <summary>
		/// Default constructor.
		/// </summary>
		public Chart()
		{
			_isRectAuto = true;
			_border = new Border( Default.IsBorderVisible, Default.BorderColor, Default.BorderPenWidth );
			_fill = new Fill( Default.FillColor, Default.FillBrush, Default.FillType );
		}
Example #13
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The Border object from which to copy</param>
 public Border(Border rhs) : base(rhs)
 {
     _inflateFactor = rhs._inflateFactor;
 }
Example #14
0
File: Bar.cs Project: CareyGit/jx
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The Bar object from which to copy</param>
		public Bar( Bar rhs )
		{
			_border = rhs.Border.Clone();
			_fill = rhs.Fill.Clone();
		}
Example #15
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The <see c_ref="BoxObj"/> object from which to copy</param>
		public BoxObj( BoxObj rhs ) : base( rhs )
		{
			Border = rhs.Border.Clone();
			Fill = rhs.Fill.Clone();
		}
Example #16
0
 /// <summary>
 /// Default constructor.
 /// </summary>
 public Chart()
 {
     _isRectAuto = true;
     _border     = new Border(Default.IsBorderVisible, Default.BorderColor, Default.BorderPenWidth);
     _fill       = new Fill(Default.FillColor, Default.FillBrush, Default.FillType);
 }
Example #17
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The Border object from which to copy</param>
		public Border( Border rhs ) : base( rhs )
		{
			_inflateFactor = rhs._inflateFactor;
		}
Example #18
0
		/// <summary>
		/// Draw the <see c_ref="JapaneseCandleStick"/> to the specified <see c_ref="Graphics"/>
		/// device at the specified location.
		/// </summary>
		/// <param name="g">
		/// A graphic device object to be drawn into.  This is normally e.Graphics from the
		/// PaintEventArgs argument to the Paint() method.
		/// </param>
		/// <param name="pane">
		/// A reference to the <see c_ref="GraphPane"/> object that is the parent or
		/// owner of this object.
		/// </param>
		/// <param name="isXBase">boolean value that indicates if the "base" axis for this
		/// <see c_ref="JapaneseCandleStick"/> is the X axis.  True for an <see c_ref="XAxis"/> base,
		/// false for a <see c_ref="YAxis"/> or <see c_ref="Y2Axis"/> base.</param>
		/// <param name="pixBase">The independent axis position of the center of the candlestick in
		/// pixel units</param>
		/// <param name="pixHigh">The high value position of the candlestick in
		/// pixel units</param>
		/// <param name="pixLow">The low value position of the candlestick in
		/// pixel units</param>
		/// <param name="pixOpen">The opening value position of the candlestick in
		/// pixel units</param>
		/// <param name="pixClose">The closing value position of the candlestick in
		/// pixel units</param>
		/// <param name="halfSize">The scaled width of one-half of a bar, in pixels</param>
		/// <param name="scaleFactor">
		/// The scaling factor for the features of the graph based on the <see c_ref="PaneBase.BaseDimension"/>.  This
		/// scaling factor is calculated by the <see c_ref="PaneBase.CalcScaleFactor"/> method.  The scale factor
		/// represents a linear multiple to be applied to font sizes, symbol sizes, etc.</param>
		/// <param name="pen">A pen with the <see c_ref="Color"/> attribute for this
		/// <see c_ref="JapaneseCandleStick"/></param>
		/// <param name="fill">
		/// The <see c_ref="Fill" /> instance to be used for filling this
		/// <see c_ref="JapaneseCandleStick" />
		/// </param>
		/// <param name="border">The <see c_ref="Border" /> instance to be used for drawing the
		/// border around the <see c_ref="JapaneseCandleStick" /> filled box</param>
		/// <param name="pt">The <see c_ref="PointPair" /> to be used for determining the
		/// <see c_ref="Fill" />, just in case it's a <see c_ref="FillType.GradientByX" />,
		/// <see c_ref="FillType.GradientByY" />, or
		/// <see c_ref="FillType.GradientByZ" /> <see c_ref="FillType" /></param>
		public void Draw( Graphics g, GraphPane pane, bool isXBase,
								float pixBase, float pixHigh, float pixLow,
								float pixOpen, float pixClose, float halfSize,
								float scaleFactor, Pen pen, Fill fill, Border border, PointPair pt )
		{
			//float halfSize = (int) ( _size * scaleFactor / 2.0f + 0.5f );

			if ( pixBase != PointPair.Missing && Math.Abs( pixLow ) < 1000000 &&
						Math.Abs( pixHigh ) < 1000000)
			{
				RectangleF rect;
				if ( isXBase )
				{
					rect = new RectangleF( pixBase - halfSize, Math.Min( pixOpen, pixClose ),
								halfSize * 2.0f, Math.Abs( pixOpen - pixClose ) );

					g.DrawLine( pen, pixBase, pixHigh, pixBase, pixLow );
				}
				else
				{
					rect = new RectangleF( Math.Min( pixOpen, pixClose ), pixBase - halfSize,
								Math.Abs( pixOpen - pixClose ), halfSize * 2.0f );

					g.DrawLine( pen, pixHigh, pixBase, pixLow, pixBase );
				}

				if ( _isOpenCloseVisible && Math.Abs( pixOpen ) < 1000000 &&
							Math.Abs( pixClose ) < 1000000 )
				{
					if ( rect.Width == 0 )
						rect.Width = 1;
					if ( rect.Height == 0 )
						rect.Height = 1;

					fill.Draw( g, rect, pt );
					border.Draw( g, pane, scaleFactor, rect );
				}
			}
		}
Example #19
0
		/// <summary>
		/// Default constructor that sets all <see c_ref="Legend"/> properties to default
		/// values as defined in the <see c_ref="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;

			_isReverse = Default.IsReverse;

			_isShowLegendSymbols = Default.IsShowLegendSymbols;
		}
Example #20
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The <see c_ref="PaneBase"/> object from which to copy</param>
		public PaneBase( PaneBase rhs )
		{
			// copy over all the value types
			_isFontsScaled = rhs._isFontsScaled;
			_isPenWidthScaled = rhs._isPenWidthScaled;

			_titleGap = rhs._titleGap;
			_baseDimension = rhs._baseDimension;
			_margin = rhs._margin.Clone();
			_rect = rhs._rect;

			// Copy the reference types by cloning
			_fill = rhs._fill.Clone();
			_border = rhs._border.Clone();
			_title = rhs._title.Clone();

			_legend = rhs.Legend.Clone();
			_title = rhs._title.Clone();
			_graphObjList = rhs._graphObjList.Clone();
			
			if ( rhs._tag is ICloneable )
				_tag = ((ICloneable) rhs._tag).Clone();
			else
				_tag = rhs._tag;
		}
Example #21
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;
		}
Example #22
0
		/// <summary>
		/// Create a new <see c_ref="GasGaugeRegion"/>
		/// </summary>
		/// <param name="label">The value associated with this <see c_ref="GasGaugeRegion"/> instance.</param>
		/// <param name="color">The display color for this <see c_ref="GasGaugeRegion"/> instance.</param>
		/// <param name="minVal">The minimum value of this <see c_ref="GasGaugeNeedle"/>.</param>
		/// <param name="maxVal">The maximum value of this <see c_ref="GasGaugeNeedle"/>.</param>
		public GasGaugeRegion( string label, double minVal, double maxVal, Color color )
			: base( label )
		{
			MinValue = minVal;
			MaxValue = maxVal;
			RegionColor = color;
			StartAngle = 0f;
			SweepAngle = 0f;
			_border = new Border( Default.BorderColor, Default.BorderWidth );
			_labelDetail = new TextObj();
			_labelDetail.FontSpec.Size = Default.FontSize;
			_slicePath = null;
		}
Example #23
0
		/// <summary>
		/// Constructor for deserializing objects
		/// </summary>
		/// <param name="info">A <see c_ref="SerializationInfo"/> instance that defines the serialized data
		/// </param>
		/// <param name="context">A <see c_ref="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" );
		}
Example #24
0
		private void Init( string family, float size, Color color, bool isBold,
			bool isItalic, bool isUnderline, Color fillColor, Brush fillBrush,
			FillType fillType )
		{
			_fontColor = color;
			_family = family;
			_isBold = isBold;
			_isItalic = isItalic;
			_isUnderline = isUnderline;
			_size = size;
			_angle = 0F;

			_isAntiAlias = Default.IsAntiAlias;
			_stringAlignment = Default.StringAlignment;
			_isDropShadow = Default.IsDropShadow;
			_dropShadowColor = Default.DropShadowColor;
			_dropShadowAngle = Default.DropShadowAngle;
			_dropShadowOffset = Default.DropShadowOffset;

			_fill = new Fill( fillColor, fillBrush, fillType );
			_border = new Border( true, Color.Black, 1.0F );

			_scaledSize = -1;
			Remake( 1.0F, _size, ref _scaledSize, ref _font );
		}
Example #25
0
		/// <summary>
		/// Create a new <see c_ref="PieItem"/>.
		/// </summary>
		/// <param name="pieValue">The value associated with this <see c_ref="PieItem"/> instance.</param>
		/// <param name="color">The display color for this <see c_ref="PieItem"/> instance.</param>
		/// <param name="displacement">The amount this <see c_ref="PieItem"/>  instance will be 
		/// displaced from the center point.</param>
		/// <param name="label">Text label for this <see c_ref="PieItem"/> instance.</param>
		public PieItem( double pieValue, Color color, double displacement, string label )
			: base( label )
		{
			_pieValue = pieValue;
			_fill = new Fill( color.IsEmpty ? _rotator.NextColor : color );
			_displacement = displacement;
			_border = new Border( Default.BorderColor, Default.BorderWidth );
			_labelDetail = new TextObj();
			_labelDetail.FontSpec.Size = Default.FontSize;
			_labelType = Default.LabelType;
			_valueDecimalDigits = Default.ValueDecimalDigits;
			_percentDecimalDigits = Default.PercentDecimalDigits;
			_slicePath = null;
		}
Example #26
0
		/// <summary>
		/// Constructor for deserializing objects
		/// </summary>
		/// <param name="info">A <see c_ref="SerializationInfo"/> instance that defines the serialized data
		/// </param>
		/// <param name="context">A <see c_ref="StreamingContext"/> instance that contains the serialized data
		/// </param>
		protected FontSpec( 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" );

			_fontColor = (Color)info.GetValue( "fontColor", typeof( Color ) );
			_family = info.GetString( "family" );
			_isBold = info.GetBoolean( "isBold" );
			_isItalic = info.GetBoolean( "isItalic" );
			_isUnderline = info.GetBoolean( "isUnderline" );
			_isAntiAlias = info.GetBoolean( "isAntiAlias" );

			_fill = (Fill)info.GetValue( "fill", typeof( Fill ) );
			_border = (Border)info.GetValue( "border", typeof( Border ) );
			_angle = info.GetSingle( "angle" );
			_stringAlignment = (StringAlignment)info.GetValue( "stringAlignment", typeof( StringAlignment ) );
			_size = info.GetSingle( "size" );

			_isDropShadow = info.GetBoolean( "isDropShadow" );
			_dropShadowColor = (Color)info.GetValue( "dropShadowColor", typeof( Color ) );
			_dropShadowAngle = info.GetSingle( "dropShadowAngle" );
			_dropShadowOffset = info.GetSingle( "dropShadowOffset" );

			_scaledSize = -1;
			Remake( 1.0F, _size, ref _scaledSize, ref _font );
		}
Example #27
0
		/// <summary>
		/// Constructor for deserializing objects
		/// </summary>
		/// <param name="info">A <see c_ref="SerializationInfo"/> instance that defines the serialized data
		/// </param>
		/// <param name="context">A <see c_ref="StreamingContext"/> instance that contains the serialized data
		/// </param>
		protected PieItem( 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" );

			_displacement = info.GetDouble( "displacement" );
			_labelDetail = (TextObj)info.GetValue( "labelDetail", typeof( TextObj ) );
			_fill = (Fill)info.GetValue( "fill", typeof( Fill ) );
			_border = (Border)info.GetValue( "border", typeof( Border ) );
			_pieValue = info.GetDouble( "pieValue" );
			_labelType = (PieLabelType)info.GetValue( "labelType", typeof( PieLabelType ) );
			_intersectionPoint = (PointF)info.GetValue( "intersectionPoint", typeof( PointF ) );
			_boundingRectangle = (RectangleF)info.GetValue( "boundingRectangle", typeof( RectangleF ) );
			_pivotPoint = (PointF)info.GetValue( "pivotPoint", typeof( PointF ) );
			_endPoint = (PointF)info.GetValue( "endPoint", typeof( PointF ) );
			// _slicePath = (GraphicsPath)info.GetValue( "slicePath", typeof( GraphicsPath ) );
			_startAngle = (float)info.GetDouble( "startAngle" );
			_sweepAngle = (float)info.GetDouble( "sweepAngle" );
			_midAngle = (float)info.GetDouble( "midAngle" );
			_labelStr = info.GetString( "labelStr" );
			_valueDecimalDigits = info.GetInt32( "valueDecimalDigits" );
			_percentDecimalDigits = info.GetInt32( "percentDecimalDigits" );
		}
Example #28
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="ggn">The <see c_ref="GasGaugeNeedle"/> object from which to copy</param>
		public GasGaugeNeedle( GasGaugeNeedle ggn )
			: base( ggn )
		{
			NeedleValue = ggn.NeedleValue;
			NeedleColor = ggn.NeedleColor;
			NeedleWidth = ggn.NeedleWidth;
			SweepAngle = ggn.SweepAngle;
			_border = ggn.Border.Clone();
			_labelDetail = ggn.LabelDetail.Clone();
			_labelDetail.FontSpec.Size = ggn.LabelDetail.FontSpec.Size;
		}
Example #29
0
		/// <summary>
		/// Default constructor that sets all <see c_ref="JapaneseCandleStick"/> properties to
		/// default values as defined in the <see c_ref="Default"/> class.
		/// </summary>
		public JapaneseCandleStick()
		{
			_risingFill = new Fill( Default.RisingColor );
			_fallingFill = new Fill( Default.FallingColor );

			_risingBorder = new Border( Default.RisingBorder, LineBase.Default.Width );
			_fallingBorder = new Border( Default.FallingBorder, LineBase.Default.Width );

			_fallingColor = Default.FallingColor;
		}
Example #30
0
File: Bar.cs Project: CareyGit/jx
		/// <summary>
		/// Default constructor that sets the 
		/// <see c_ref="Color"/> as specified, and the remaining
		/// <see c_ref="Bar"/> properties to default
		/// values as defined in the <see c_ref="Default"/> class.
		/// The specified color is only applied to the
		/// <see c_ref="ZedGraph.Fill.Color"/>, and the <see c_ref="ZedGraph.LineBase.Color"/>
		/// will be defaulted.
		/// </summary>
		/// <param name="color">A <see c_ref="Color"/> value indicating
		/// the <see c_ref="ZedGraph.Fill.Color"/>
		/// of the Bar.
		/// </param>
		public Bar( Color color )
		{
			_border = new Border( Default.IsBorderVisible, Default.BorderColor, Default.BorderWidth );
			_fill = new Fill( color.IsEmpty ? Default.FillColor : color,
									Default.FillBrush, Default.FillType );
		}
Example #31
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The <see c_ref="JapaneseCandleStick"/> object from which to copy</param>
		public JapaneseCandleStick( JapaneseCandleStick rhs ) : base( rhs )
		{
			_risingFill = rhs._risingFill.Clone();
			_fallingFill = rhs._fallingFill.Clone();

			_risingBorder = rhs._risingBorder.Clone();
			_fallingBorder = rhs._fallingBorder.Clone();

			_fallingColor = rhs._fallingColor;
		}
Example #32
0
File: Bar.cs Project: CareyGit/jx
		/// <summary>
		/// Constructor for deserializing objects
		/// </summary>
		/// <param name="info">A <see c_ref="SerializationInfo"/> instance that defines the serialized data
		/// </param>
		/// <param name="context">A <see c_ref="StreamingContext"/> instance that contains the serialized data
		/// </param>
		protected Bar( 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" );

			_fill = (Fill) info.GetValue( "fill", typeof(Fill) );
			_border = (Border) info.GetValue( "border", typeof(Border) );
		}
Example #33
0
		/// <summary>
		/// Constructor for deserializing objects
		/// </summary>
		/// <param name="info">A <see c_ref="SerializationInfo"/> instance that defines the serialized data
		/// </param>
		/// <param name="context">A <see c_ref="StreamingContext"/> instance that contains the serialized data
		/// </param>
		protected Symbol( 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" );

			_size = info.GetSingle( "size" );
			_type = (SymbolType) info.GetValue( "type", typeof(SymbolType) );
			_isAntiAlias = info.GetBoolean( "isAntiAlias" );
			_isVisible = info.GetBoolean( "isVisible" );
			_fill = (Fill) info.GetValue( "fill", typeof(Fill) );
			_border = (Border) info.GetValue( "border", typeof(Border) );

			if ( sch >= 11 )
				_userSymbol = (GraphicsPath)info.GetValue( "userSymbol", typeof( GraphicsPath ) );
			else
				_userSymbol = null;
		}