Beispiel #1
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                ColorGroupStyle s = null != o ? (ColorGroupStyle)o : ColorGroupStyle.NewExternalGroupStyle();

                s._isStepEnabled = info.GetBoolean("StepEnabled");
                return(s);
            }
Beispiel #2
0
        public static void PrepareStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Getter getter)
        {
            if (!externalGroups.ContainsType(typeof(ColorGroupStyle)) &&
                null != localGroups &&
                !localGroups.ContainsType(typeof(ColorGroupStyle)))
            {
                localGroups.Add(ColorGroupStyle.NewLocalGroupStyle());
            }

            ColorGroupStyle grpStyle = null;

            if (externalGroups.ContainsType(typeof(ColorGroupStyle)))
            {
                grpStyle = (ColorGroupStyle)externalGroups.GetPlotGroupStyle(typeof(ColorGroupStyle));
            }
            else if (localGroups != null)
            {
                grpStyle = (ColorGroupStyle)localGroups.GetPlotGroupStyle(typeof(ColorGroupStyle));
            }

            if (grpStyle != null && getter != null && !grpStyle.IsInitialized)
            {
                grpStyle.Initialize(getter());
            }
        }
Beispiel #3
0
 public static void AddExternalGroupStyle(IPlotGroupStyleCollection externalGroups)
 {
     if (PlotGroupStyle.ShouldAddExternalGroupStyle(externalGroups, typeof(ColorGroupStyle)))
     {
         var gstyle = ColorGroupStyle.NewExternalGroupStyle();
         externalGroups.Add(gstyle);
     }
 }
Beispiel #4
0
        public void TransferFrom(IPlotGroupStyle fromb)
        {
            ColorGroupStyle from = (ColorGroupStyle)fromb;

            System.Diagnostics.Debug.WriteLine(string.Format("ColorTransfer: myIni={0}, myCol={1}, fromI={2}, fromC={3}", _isInitialized, (_color == null?null:_color.Color.ToString()), from._isInitialized, (from._color == null?null:from._color.Color.ToString())));
            this._isInitialized = from._isInitialized;
            this._color         = from._color;
        }
Beispiel #5
0
 public static void AddLocalGroupStyle(
     IPlotGroupStyleCollection externalGroups,
     IPlotGroupStyleCollection localGroups)
 {
     if (PlotGroupStyle.ShouldAddLocalGroupStyle(externalGroups, localGroups, typeof(ColorGroupStyle)))
     {
         localGroups.Add(ColorGroupStyle.NewLocalGroupStyle());
     }
 }
Beispiel #6
0
 public ColorGroupStyle(ColorGroupStyle from)
 {
     _isStepEnabled     = from._isStepEnabled;
     _isInitialized     = from._isInitialized;
     _listOfValues      = from._listOfValues;
     _colorIndex        = from._colorIndex;
     _cachedColor       = from._cachedColor;
     _isLocalGroupStyle = from._isLocalGroupStyle;
 }
Beispiel #7
0
 public static void AddExternalGroupStyle(IPlotGroupStyleCollection externalGroups)
 {
     if (PlotGroupStyle.ShouldAddExternalGroupStyle(externalGroups, typeof(ColorGroupStyle)))
     {
         ColorGroupStyle gstyle = new ColorGroupStyle();
         gstyle.IsStepEnabled = true;
         externalGroups.Add(gstyle);
     }
 }
Beispiel #8
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                ColorGroupStyle s = null != o ? (ColorGroupStyle)o : ColorGroupStyle.NewExternalGroupStyle();

                s._isStepEnabled = info.GetBoolean("StepEnabled");
                s._listOfValues  = (Drawing.ColorManagement.IColorSet)info.GetValue("ColorSet", s);
                ColorSetManager.Instance.TryRegisterList(info, s._listOfValues, Main.ItemDefinitionLevel.Project, out s._listOfValues);

                return(s);
            }
Beispiel #9
0
        public static void ApplyStyle(
            IPlotGroupStyleCollection externalGroups,
            IPlotGroupStyleCollection localGroups,
            Setter setter)
        {
            ColorGroupStyle           grpStyle = null;
            IPlotGroupStyleCollection grpColl  = null;

            if (externalGroups.ContainsType(typeof(ColorGroupStyle)))
            {
                grpColl = externalGroups;
            }
            else if (localGroups != null && localGroups.ContainsType(typeof(ColorGroupStyle)))
            {
                grpColl = localGroups;
            }

            if (null != grpColl)
            {
                grpStyle = (ColorGroupStyle)grpColl.GetPlotGroupStyle(typeof(ColorGroupStyle));
                grpColl.OnBeforeApplication(typeof(ColorGroupStyle));
                setter(grpStyle.Color);
            }
        }
 public ColorGroupStyle(ColorGroupStyle from)
 {
   this._isStepEnabled = from._isStepEnabled;
   this._isInitialized = from._isInitialized;
   this._color = from._color;
 }
 public static void AddExternalGroupStyle(IPlotGroupStyleCollection externalGroups)
 {
   if (PlotGroupStyle.ShouldAddExternalGroupStyle(externalGroups, typeof(ColorGroupStyle)))
   {
     ColorGroupStyle gstyle = new ColorGroupStyle();
     gstyle.IsStepEnabled = true;
     externalGroups.Add(gstyle);
   }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ColorGroupStylePresenceTracker"/> class.
 /// </summary>
 /// <param name="plotStyle">The plot style.</param>
 /// <param name="actionIfGroupStyleRemovedOrAdded">The action to do if the group style is removed or added to the group style collection.</param>
 public ColorGroupStylePresenceTracker(Altaxo.Main.IDocumentLeafNode plotStyle, Action actionIfGroupStyleRemovedOrAdded)
 {
     _colorGroupStyle = GetColorGroupStyle(plotStyle);
     _actionIfGroupStyleRemovedOrAdded = actionIfGroupStyleRemovedOrAdded;
 }
Beispiel #13
0
 public ColorGroupStyle(ColorGroupStyle from)
 {
     this._isStepEnabled = from._isStepEnabled;
     this._isInitialized = from._isInitialized;
     this._color         = from._color;
 }
Beispiel #14
0
            public void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info)
            {
                ColorGroupStyle s = (ColorGroupStyle)obj;

                info.AddValue("StepEnabled", s._isStepEnabled);
            }
Beispiel #15
0
		public ColorGroupStyle(ColorGroupStyle from)
		{
			this._isStepEnabled = from._isStepEnabled;
			this._isInitialized = from._isInitialized;
			this._listOfValues = from._listOfValues;
			this._colorIndex = from._colorIndex;
			this._cachedColor = from._cachedColor;
			this._isLocalGroupStyle = from._isLocalGroupStyle;
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="ColorGroupStylePresenceTracker"/> class.
		/// </summary>
		/// <param name="plotStyle">The plot style.</param>
		/// <param name="actionIfGroupStyleRemovedOrAdded">The action to do if the group style is removed or added to the group style collection.</param>
		public ColorGroupStylePresenceTracker(Altaxo.Main.IDocumentLeafNode plotStyle, Action actionIfGroupStyleRemovedOrAdded)
		{
			_colorGroupStyle = GetColorGroupStyle(plotStyle);
			_actionIfGroupStyleRemovedOrAdded = actionIfGroupStyleRemovedOrAdded;
		}