Example #1
0
        public override object Clone()
        {
            TextScale result = new TextScale();

            result.CopyFrom(this);
            return(result);
        }
Example #2
0
        void CopyFrom(TextScale from)
        {
            _dataBounds = (TextBoundaries)from._dataBounds.Clone();
            _dataBounds.BoundaryChanged += EhBoundariesChanged;

            _rescaling = from._rescaling == null ? null : (NumericAxisRescaleConditions)from._rescaling.Clone();

            _cachedAxisOrg       = from._cachedAxisOrg;
            _cachedAxisEnd       = from._cachedAxisEnd;
            _cachedAxisSpan      = from._cachedAxisSpan;
            _cachedOneByAxisSpan = from._cachedOneByAxisSpan;
        }
Example #3
0
    void CopyFrom(TextScale from)
    {
      _dataBounds = (TextBoundaries)from._dataBounds.Clone();
      _dataBounds.BoundaryChanged += EhBoundariesChanged;

      _rescaling = from._rescaling == null ? null : (NumericAxisRescaleConditions)from._rescaling.Clone();

      _cachedAxisOrg = from._cachedAxisOrg;
      _cachedAxisEnd = from._cachedAxisEnd;
      _cachedAxisSpan = from._cachedAxisSpan;
      _cachedOneByAxisSpan = from._cachedOneByAxisSpan;
    }
Example #4
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                TextScale s = null != o ? (TextScale)o : new TextScale(info);

                s._cachedAxisOrg       = info.GetDouble("Org");
                s._cachedAxisEnd       = info.GetDouble("End");
                s._cachedAxisSpan      = s._cachedAxisEnd - s._cachedAxisOrg;
                s._cachedOneByAxisSpan = 1 / s._cachedAxisSpan;

                s.ChildSetMember(ref s._rescaling, (NumericScaleRescaleConditions)info.GetValue("Rescaling", s));
                s.ChildSetMember(ref s._dataBounds, (TextBoundaries)info.GetValue("Bounds", s));
                s.ChildSetMember(ref s._tickSpacing, new Ticks.TextTickSpacing());

                s.EhChildChanged(s._dataBounds, EventArgs.Empty); // for this old version, rescaling is not fully serialized, thus we have to simulate a DataBoundChanged event to get _rescaling updated, and finally _tickSpacing updated

                return(s);
            }
Example #5
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                TextScale s = null != o ? (TextScale)o : new TextScale(info);

                s._cachedAxisOrg       = info.GetDouble("Org");
                s._cachedAxisEnd       = info.GetDouble("End");
                s._cachedAxisSpan      = s._cachedAxisEnd - s._cachedAxisOrg;
                s._cachedOneByAxisSpan = 1 / s._cachedAxisSpan;

                s.ChildSetMember(ref s._dataBounds, (TextBoundaries)info.GetValue("Bounds", s));
                s.ChildSetMember(ref s._rescaling, (NumericScaleRescaleConditions)info.GetValue("Rescaling", s));
                s.ChildSetMember(ref s._tickSpacing, (Ticks.TickSpacing)info.GetValue("TickSpacing", s));

                s.UpdateTicksAndOrgEndUsingRescalingObject();

                return(s);
            }
		private void SetupOldAxis(int idx, Altaxo.Graph.Scales.Deprecated.Scale axis, bool isLinked, double orgA, double orgB, double endA, double endB)
		{
			Scale transScale = null;
			if (axis is Altaxo.Graph.Scales.Deprecated.TextScale)
				transScale = new TextScale();
			else if (axis is Altaxo.Graph.Scales.Deprecated.DateTimeScale)
				transScale = new DateTimeScale();
			else if (axis is Altaxo.Graph.Scales.Deprecated.Log10Scale)
				transScale = new Log10Scale();
			else if (axis is Altaxo.Graph.Scales.Deprecated.AngularScale)
				transScale = (axis as Altaxo.Graph.Scales.Deprecated.AngularScale).UseDegrees ? (Scale)new AngularDegreeScale() : (Scale)new AngularRadianScale();
			else if (axis is Altaxo.Graph.Scales.Deprecated.LinearScale)
				transScale = new LinearScale();
			else
				throw new ArgumentException("Axis type unknown");

			if (transScale.RescalingObject is IUnboundNumericScaleRescaleConditions)
				(transScale.RescalingObject as IUnboundNumericScaleRescaleConditions).SetUserParameters(BoundaryRescaling.AutoTempFixed, BoundariesRelativeTo.Absolute, axis.OrgAsVariant, BoundaryRescaling.AutoTempFixed, BoundariesRelativeTo.Absolute, axis.EndAsVariant);

			if (transScale.RescalingObject is Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions &&
				axis.RescalingObject is Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions)
			{
				((Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions)transScale.RescalingObject).CopyFrom((Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions)axis.RescalingObject);
			}

			if (isLinked)
			{
#pragma warning disable CS0618 // Type or member is obsolete
				LinkedScale ls = new LinkedScale(transScale, idx);
#pragma warning restore CS0618 // Type or member is obsolete
				ls.SetLinkParameter(orgA, orgB, endA, endB);
				transScale = ls;
			}

			_scales[idx] = transScale;
		}
Example #7
0
 public TextScale(TextScale from)
 {
     CopyFrom(from);
 }
Example #8
0
		public TextScale(TextScale from)
		{
			CopyFrom(from);
		}
Example #9
0
 public override object Clone()
 {
   TextScale result = new TextScale();
   result.CopyFrom(this);
   return result;
 }