Esempio n. 1
0
File: Chart.cs Progetto: 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;
		}
Esempio n. 2
0
File: Bar.cs Progetto: 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();
		}
Esempio n. 3
0
File: Line.cs Progetto: 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 Line( 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( "schema" );

			//if ( sch >= 14 )
			//	_color = (Color) info.GetValue( "color", typeof( Color ) );
			_stepType = (StepType)info.GetValue( "stepType", typeof( StepType ) );
			_isSmooth = info.GetBoolean( "isSmooth" );
			_smoothTension = info.GetSingle( "smoothTension" );
			_fill = (Fill)info.GetValue( "fill", typeof( Fill ) );

			if ( sch >= 13 )
				_isOptimizedDraw = info.GetBoolean( "isOptimizedDraw" );
		}
Esempio n. 4
0
File: Line.cs Progetto: CareyGit/jx
		/// <summary>
		/// Constructor that sets the color property to the specified value, and sets
		/// the remaining <see c_ref="Line"/> properties to default
		/// values as defined in the <see c_ref="Default"/> class.
		/// </summary>
		/// <param name="color">The color to assign to this new Line object</param>
		public Line( Color color )
		{
			_color = color.IsEmpty ? Default.Color : color;
			_stepType = Default.StepType;
			_isSmooth = Default.IsSmooth;
			_smoothTension = Default.SmoothTension;
			_fill = new Fill( Default.FillColor, Default.FillBrush, Default.FillType );
			_isOptimizedDraw = Default.IsOptimizedDraw;
		}
Esempio n. 5
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 ) );
		}
Esempio n. 6
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 );
		}
Esempio n. 7
0
		/// <summary>
		/// Calculate the values needed to properly display this <see c_ref="GasGaugeRegion"/>.
		/// </summary>
		/// <param name="pane">
		/// A graphic device object to be drawn into. This is normally e.Graphics from the
		/// PaintEventArgs argument to the Paint() method.
		/// </param>
		public static void CalculateGasGuageParameters( GraphPane pane )
		{
			//loop thru slices and get total value and maxDisplacement
			double minVal = double.MaxValue;
			double maxVal = double.MinValue;
			foreach ( CurveItem curve in pane.CurveList )
				if ( curve is GasGaugeRegion )
				{
					GasGaugeRegion ggr = (GasGaugeRegion)curve;
					if ( maxVal < ggr.MaxValue )
						maxVal = ggr.MaxValue;

					if ( minVal > ggr.MinValue )
						minVal = ggr.MinValue;
				}

			//Calculate start and sweep angles for each of the GasGaugeRegion based on teh min and max value
			foreach ( CurveItem curve in pane.CurveList )
			{
				if ( curve is GasGaugeRegion )
				{
					GasGaugeRegion ggr = (GasGaugeRegion)curve;
					float start = ( (float)ggr.MinValue - (float)minVal ) / ( (float)maxVal - (float)minVal ) * 180.0f;
					float sweep = ( (float)ggr.MaxValue - (float)minVal ) / ( (float)maxVal - (float)minVal ) * 180.0f;
					sweep = sweep - start;

					Fill f = new Fill( Color.White, ggr.RegionColor, -( sweep / 2f ) );
					ggr.Fill = f;

					ggr.StartAngle = start;
					ggr.SweepAngle = sweep;
				}
			}
		}
Esempio n. 8
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;
		}
Esempio n. 9
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" );
		}
Esempio n. 10
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;
		}
Esempio n. 11
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;
		}
Esempio n. 12
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 LineBase( 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( "schema0" );

			_width = info.GetSingle( "width" );
			_style = (DashStyle)info.GetValue( "style", typeof( DashStyle ) );
			_dashOn = info.GetSingle( "dashOn" );
			_dashOff = info.GetSingle( "dashOff" );
			_isVisible = info.GetBoolean( "isVisible" );
			_isAntiAlias = info.GetBoolean( "isAntiAlias" );
			_color = (Color)info.GetValue( "color", typeof( Color ) );
			_gradientFill = (Fill)info.GetValue( "gradientFill", typeof( Fill ) );
		}
Esempio n. 13
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The LineBase object from which to copy</param>
		public LineBase( LineBase rhs )
		{
			_width = rhs._width;
			_style = rhs._style;
			_dashOn = rhs._dashOn;
			_dashOff = rhs._dashOff;

			_isVisible = rhs._isVisible;
			_color = rhs._color;

			_isAntiAlias = rhs._isAntiAlias;
			_gradientFill = new Fill( rhs._gradientFill );
		}
Esempio n. 14
0
		/// <summary>
		/// Constructor that sets the color property to the specified value, and sets
		/// the remaining <see c_ref="LineBase"/> properties to default
		/// values as defined in the <see c_ref="Default"/> class.
		/// </summary>
		/// <param name="color">The color to assign to this new Line object</param>
		public LineBase( Color color )
		{
			_width = Default.Width;
			_style = Default.Style;
			_dashOn = Default.DashOn;
			_dashOff = Default.DashOff;
			_isVisible = Default.IsVisible;
			_color = color.IsEmpty ? Default.Color : color;
			_isAntiAlias = Default.IsAntiAlias;
			_gradientFill = new Fill( Color.Red, Color.White );
			_gradientFill.Type = FillType.None;
		}
Esempio n. 15
0
		/// <summary>
		/// Create a new <see c_ref="PieItem"/>, providing a gradient fill for the pie color.
		/// </summary>
		/// <param name="pieValue">The value associated with this <see c_ref="PieItem"/> instance.</param>
		/// <param name="color1">The starting display color for the gradient <see c_ref="Fill"/> for this
		/// <see c_ref="PieItem"/> instance.</param>
		/// <param name="color2">The ending display color for the gradient <see c_ref="Fill"/> for this
		/// <see c_ref="PieItem"/> instance.</param>
		/// <param name="fillAngle">The angle for the gradient <see c_ref="Fill"/>.</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 color1, Color color2, float fillAngle,
						double displacement, string label )
			:
						this( pieValue, color1, displacement, label )
		{
			if ( !color1.IsEmpty && !color2.IsEmpty )
				_fill = new Fill( color1, color2, fillAngle );
		}
Esempio n. 16
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;
		}
Esempio n. 17
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;
		}
Esempio n. 18
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) );

		}
Esempio n. 19
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The <see c_ref="PieItem"/> object from which to copy</param>
		public PieItem( PieItem rhs )
			: base( rhs )
		{
			_pieValue = rhs._pieValue;
			_fill = rhs._fill.Clone();
			Border = rhs._border.Clone();
			_displacement = rhs._displacement;
			_labelDetail = rhs._labelDetail.Clone();
			_labelType = rhs._labelType;
			_valueDecimalDigits = rhs._valueDecimalDigits;
			_percentDecimalDigits = rhs._percentDecimalDigits;
		}
Esempio n. 20
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 );
		}
Esempio n. 21
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" );
		}
Esempio n. 22
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 );
		}
Esempio n. 23
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;
		}
Esempio n. 24
0
		/// <summary>
		/// Do all rendering associated with this <see c_ref="GasGaugeNeedle"/> item to the specified
		/// <see c_ref="Graphics"/> device. This method is normally only
		/// called by the Draw method of the parent <see c_ref="ZedGraph.CurveList"/>
		/// collection object.
		/// </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="ZedGraph.GraphPane"/> object that is the parent or
		/// owner of this object.
		/// </param>
		/// <param name="pos">Not used for rendering GasGaugeNeedle</param>
		/// <param name="scaleFactor">Not used for rendering GasGaugeNeedle</param>
		public override void Draw( Graphics g, GraphPane pane, int pos, float scaleFactor )
		{
			if ( pane.Chart._rect.Width <= 0 && pane.Chart._rect.Height <= 0 )
			{
				_slicePath = null;
			}
			else
			{
				CalcRectangle( g, pane, scaleFactor, pane.Chart._rect );

				_slicePath = new GraphicsPath();

				if ( !_isVisible )
					return;

				RectangleF tRect = _boundingRectangle;

				if ( tRect.Width >= 1 && tRect.Height >= 1 )
				{
					SmoothingMode sMode = g.SmoothingMode;
					g.SmoothingMode = SmoothingMode.AntiAlias;

					Matrix matrix = new Matrix();

					matrix.Translate( tRect.X + ( tRect.Width / 2 ), tRect.Y + ( tRect.Height / 2 ), MatrixOrder.Prepend );

					PointF[] pts = new PointF[2];
					pts[0] = new PointF( ( ( tRect.Height * .10f ) / 2.0f ) * (float)Math.Cos( -SweepAngle * Math.PI / 180.0f ),
					( ( tRect.Height * .10f ) / 2.0f ) * (float)Math.Sin( -SweepAngle * Math.PI / 180.0f ) );
					pts[1] = new PointF( ( tRect.Width / 2.0f ) * (float)Math.Cos( -SweepAngle * Math.PI / 180.0f ),
					( tRect.Width / 2.0f ) * (float)Math.Sin( -SweepAngle * Math.PI / 180.0f ) );

					matrix.TransformPoints( pts );

					Pen p = new Pen( NeedleColor, ( ( tRect.Height * .10f ) / 2.0f ) );
					p.EndCap = LineCap.ArrowAnchor;
					g.DrawLine( p, pts[0].X, pts[0].Y, pts[1].X, pts[1].Y );

					//Fill center 10% with Black dot;
					Fill f = new Fill( Color.Black );
					RectangleF r = new RectangleF( ( tRect.X + ( tRect.Width / 2 ) ) - 1.0f, ( tRect.Y + ( tRect.Height / 2 ) ) - 1.0f, 1.0f, 1.0f );
					r.Inflate( ( tRect.Height * .10f ), ( tRect.Height * .10f ) );
					Brush b = f.MakeBrush( r );
					g.FillPie( b, r.X, r.Y, r.Width, r.Height, 0.0f, -180.0f );

					Pen borderPen = new Pen( Color.White, 2.0f );
					g.DrawPie( borderPen, r.X, r.Y, r.Width, r.Height, 0.0f, -180.0f );

					g.SmoothingMode = sMode;
				}
			}
		}
Esempio n. 25
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;
		}
Esempio n. 26
0
File: Line.cs Progetto: CareyGit/jx
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The Line object from which to copy</param>
		public Line( Line rhs ) : base( rhs )
		{
			_color = rhs._color;
			_stepType = rhs._stepType;
			_isSmooth = rhs._isSmooth;
			_smoothTension = rhs._smoothTension;
			_fill = rhs._fill.Clone();
			_isOptimizedDraw = rhs._isOptimizedDraw;
		}
Esempio n. 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 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 ) );
		}
Esempio n. 28
0
File: Bar.cs Progetto: 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 );
		}
Esempio n. 29
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 );
				}
			}
		}
Esempio n. 30
0
File: Bar.cs Progetto: 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) );
		}
Esempio n. 31
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);
 }