Exemplo n.º 1
0
Arquivo: Label.cs Projeto: CareyGit/jx
		/// <summary>
		/// Constructor that builds a <see c_ref="Label" /> from a text <see c_ref="string" />
		/// and a <see c_ref="FontSpec" /> instance.
		/// </summary>
		/// <param name="text"></param>
		/// <param name="fontSpec"></param>
		public Label( string text, FontSpec fontSpec )
		{
			_text = (text == null) ? string.Empty : text;

			_fontSpec = fontSpec;
			_isVisible = true;
		}
Exemplo n.º 2
0
Arquivo: Label.cs Projeto: CareyGit/jx
		/// <summary>
		/// Constructor to build an <see c_ref="AxisLabel" /> from the text and the
		/// associated font properties.
		/// </summary>
		/// <param name="text">The <see c_ref="string" /> representing the text to be
		/// displayed</param>
		/// <param name="fontFamily">The <see c_ref="String" /> font family name</param>
		/// <param name="fontSize">The size of the font in points and scaled according
		/// to the <see c_ref="PaneBase.CalcScaleFactor" /> logic.</param>
		/// <param name="color">The <see c_ref="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 )
		{
			_text = ( text == null ) ? string.Empty : text;

			_fontSpec = new FontSpec( fontFamily, fontSize, color, isBold, isItalic, isUnderline );
			_isVisible = true;
		}
Exemplo n.º 3
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 );
		}
Exemplo n.º 4
0
Arquivo: Scale.cs Projeto: 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 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" );

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


			_minAuto = info.GetBoolean( "minAuto" );
			_maxAuto = info.GetBoolean( "maxAuto" );
			_majorStepAuto = info.GetBoolean( "majorStepAuto" );
			_minorStepAuto = info.GetBoolean( "minorStepAuto" );
			_magAuto = info.GetBoolean( "magAuto" );
			_formatAuto = info.GetBoolean( "formatAuto" );
			
			_minGrace = info.GetDouble( "minGrace" );
			_maxGrace = info.GetDouble( "maxGrace" );

			_mag = info.GetInt32( "mag" );

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

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

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

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

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

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

			_fontSpec = (FontSpec)info.GetValue( "fontSpec", typeof( FontSpec ) );
			_labelGap = info.GetSingle( "labelGap" );

		}
Exemplo n.º 5
0
Arquivo: Scale.cs Projeto: CareyGit/jx
		/// <summary>
		/// Copy Constructor.  Create a new <see c_ref="Scale" /> object based on the specified
		/// existing one.
		/// </summary>
		/// <param name="rhs">The <see c_ref="Scale" /> object to be copied.</param>
		/// <param name="owner">The <see c_ref="Axis" /> object that will own the
		/// new instance of <see c_ref="Scale" /></param>
		public Scale( Scale rhs, Axis owner )
		{
			_ownerAxis = owner;

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

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

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

			_mag = rhs._mag;

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

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

			_format = rhs._format;

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

			_fontSpec = rhs._fontSpec.Clone();

			_labelGap = rhs._labelGap;

			if ( rhs._textLabels != null )
				_textLabels = (string[])rhs._textLabels.Clone();
			else
				_textLabels = null;
		}
Exemplo n.º 6
0
Arquivo: Scale.cs Projeto: CareyGit/jx
		/// <summary>
		/// Basic constructor -- requires that the <see c_ref="Scale" /> object be intialized with
		/// a pre-existing owner <see c_ref="Axis" />.
		/// </summary>
		/// <param name="ownerAxis">The <see c_ref="Axis" /> object that is the owner of this
		/// <see c_ref="Scale" /> instance.</param>
		public Scale( Axis ownerAxis )
		{
			_ownerAxis = ownerAxis;

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

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

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

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

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

			_format = null;
			_textLabels = null;

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

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

			_fontSpec.Border.IsVisible = false;
			_labelGap = Default.LabelGap;
		}
Exemplo n.º 7
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" );
		}
Exemplo n.º 8
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;
		}
Exemplo n.º 9
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;
		}
Exemplo n.º 10
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 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" );

			_text = info.GetString( "text" );
			_fontSpec = (FontSpec) info.GetValue( "fontSpec", typeof(FontSpec) );
			//isWrapped = info.GetBoolean ("isWrapped") ;
			_layoutArea = (SizeF) info.GetValue( "layoutArea", typeof(SizeF) );
		}
Exemplo n.º 11
0
		/// <summary>
		/// The Copy Constructor
		/// </summary>
		/// <param name="rhs">The <see c_ref="TextObj"/> object from which to copy</param>
		public TextObj( TextObj rhs ) : base( rhs )
		{
			_text = rhs.Text;
			_fontSpec = new FontSpec( rhs.FontSpec );
		}
Exemplo n.º 12
0
		private void Init( string text )
		{
			if ( text != null )
				_text = text;
			else
				text = "Text";
			
			_fontSpec = new FontSpec(
				Default.FontFamily, Default.FontSize,
				Default.FontColor, Default.FontBold,
				Default.FontItalic, Default.FontUnderline );
			
			//this.isWrapped = Default.IsWrapped ;
			_layoutArea = new SizeF( 0, 0 );
		}
Exemplo n.º 13
0
Arquivo: Label.cs Projeto: CareyGit/jx
		/// <summary>
		/// Copy constructor
		/// </summary>
		/// <param name="rhs">the <see c_ref="Label" /> instance to be copied.</param>
		public Label( Label rhs )
		{
			if (rhs._text != null)
				_text = (string)rhs._text.Clone();
			else
				_text = string.Empty;

			_isVisible = rhs._isVisible;
			if ( rhs._fontSpec != null )
				_fontSpec = rhs._fontSpec.Clone();
			else
				_fontSpec = null;
		}
Exemplo n.º 14
0
Arquivo: Label.cs Projeto: 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 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" );

			_text = info.GetString( "text" );
			_isVisible = info.GetBoolean( "isVisible" );
			_fontSpec = (FontSpec) info.GetValue( "fontSpec", typeof( FontSpec ) );
		}