Пример #1
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                LinePlotStyle s = (LinePlotStyle)o ?? new LinePlotStyle(info);

                s._independentSkipFrequency = info.GetBoolean("IndependentSkipFreq");
                s._skipFrequency            = info.GetInt32("SkipFreq");

                s._ignoreMissingDataPoints          = info.GetBoolean("IgnoreMissingDataPoints");
                s._independentOnShiftingGroupStyles = info.GetBoolean("IndependentOnShiftingGroupStyles");

                s._connectCircular = info.GetBoolean("ConnectCircular");
                s._connectionStyle = (ILineConnectionStyle)info.GetValue("Connection", s);

                s._linePen = (PenX)info.GetValue("Pen", s);
                if (null != s._linePen)
                {
                    s._linePen.ParentObject = s;
                }

                s._independentDashStyle = info.GetBoolean("IndependentDashStyle");
                s._independentColor     = info.GetBoolean("IndependentColor");

                s._independentSymbolSize = info.GetBoolean("IndependentSymbolSize");
                s._symbolSize            = info.GetDouble("SymbolSize");

                s._useSymbolGap    = info.GetBoolean("UseSymbolGap");
                s._symbolGapOffset = info.GetDouble("SymbolGapOffset");
                s._symbolGapFactor = info.GetDouble("SymbolGapFactor");

                return(s);
            }
Пример #2
0
 public XYLineScatterPlotStyle(XYColumnPlotData pa)
 {
     this.m_LineStyle    = new LinePlotStyle();
     this.m_ScatterStyle = new ScatterPlotStyle();
     // this.m_PlotAssociation = pa;
     this.m_LineSymbolGap = true;
 }
Пример #3
0
        public void CopyFrom(LinePlotStyle from, Main.EventFiring eventFiring)
        {
            if (object.ReferenceEquals(this, from))
            {
                return;
            }

            using (var suspendToken = SuspendGetToken())
            {
                _independentSkipFrequency = from._independentSkipFrequency;
                _skipFrequency            = from._skipFrequency;

                _ignoreMissingDataPoints          = from._ignoreMissingDataPoints;
                _independentOnShiftingGroupStyles = from._independentOnShiftingGroupStyles;

                _connectCircular = from._connectCircular;
                _connectionStyle = from._connectionStyle;

                _linePen = null == from._linePen ? null : from._linePen.Clone();
                _independentDashStyle = from._independentDashStyle;
                _independentColor     = from._independentColor;

                _independentSymbolSize = from._independentSymbolSize;
                _symbolSize            = from._symbolSize;

                _useSymbolGap    = from._useSymbolGap;
                _symbolGapOffset = from._symbolGapOffset;
                _symbolGapFactor = from._symbolGapFactor;

                EhSelfChanged();

                suspendToken.Resume(eventFiring);
            }
        }
Пример #4
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                LinePlotStyle s = null != o ? (LinePlotStyle)o : new LinePlotStyle(info);

                s._linePen                 = (PenX)info.GetValue("Pen", s);
                s.Connection               = (ILineConnectionStyle)info.GetValue("Connection", s);
                s._useSymbolGap            = info.GetBoolean("LineSymbolGap");
                s._ignoreMissingDataPoints = info.GetBoolean("IgnoreMissingPoints");
                bool fillArea  = info.GetBoolean("FillArea");
                var  fillBrush = (BrushX)info.GetValue("FillBrush", s);
                var  fillDir   = (CSPlaneID)info.GetValue("FillDirection", s);

                s._independentColor = info.GetBoolean("IndependentColor");
                var fillColorLinkage = (ColorLinkage)info.GetEnum("FillColorLinkage", typeof(ColorLinkage));

                s._connectCircular = info.GetBoolean("ConnectCircular");

                if (!fillArea)
                {
                    return(s);
                }
                else
                {
                    var drop = new DropAreaPlotStyle(s.Connection, s.IgnoreMissingDataPoints, false, fillDir, fillBrush, fillColorLinkage);
                    return(new object[] { s, drop });
                }
            }
Пример #5
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                LinePlotStyle s = null != o ? (LinePlotStyle)o : new LinePlotStyle(info);

                s._linePen = (PenX)info.GetValue("Pen", s);
                if (null != s._linePen)
                {
                    s._linePen.ParentObject = s;
                }

                s.Connection               = (ILineConnectionStyle)info.GetValue("Connection", s);
                s._useSymbolGap            = info.GetBoolean("LineSymbolGap");
                s._ignoreMissingDataPoints = info.GetBoolean("IgnoreMissingPoints");
                bool fillArea  = info.GetBoolean("FillArea");
                var  fillBrush = (BrushX)info.GetValue("FillBrush", s);
                var  fillDir   = (XYPlotLineStyles.FillDirection)info.GetValue("FillDirection", s);

                s._independentColor = info.GetBoolean("IndependentColor");

                if (!fillArea)
                {
                    return(s);
                }
                else
                {
                    var drop = new DropAreaPlotStyle(s.Connection, s.IgnoreMissingDataPoints, false, XmlSerializationSurrogate0.GetFillDirection(fillDir), fillBrush, ColorLinkage.PreserveAlpha);
                    return(new object[] { s, drop });
                }
            }
Пример #6
0
        public XYLineScatterPlotStyle(LineScatterPlotStyleKind kind)
        {
            if (0 != (kind & LineScatterPlotStyleKind.Line))
            {
                this.m_LineStyle = new LinePlotStyle();
            }

            if (0 != (kind & LineScatterPlotStyleKind.Scatter))
            {
                this.m_ScatterStyle = new ScatterPlotStyle();
            }

            this.m_LineSymbolGap = kind == LineScatterPlotStyleKind.LineAndScatter;
        }
Пример #7
0
        public XYLineScatterPlotStyle(Altaxo.Serialization.Xml.IXmlDeserializationInfo info)

        {
            var kind = LineScatterPlotStyleKind.LineAndScatter;

            if (0 != (kind & LineScatterPlotStyleKind.Line))
            {
                m_LineStyle = new LinePlotStyle(info, oldDeserializationRequiresFullConstruction: true);
            }

            if (0 != (kind & LineScatterPlotStyleKind.Scatter))
            {
                m_ScatterStyle = new ScatterPlotStyle(info, oldDeserializationRequiresFullConstruction: true);
            }

            m_LineSymbolGap = kind == LineScatterPlotStyleKind.LineAndScatter;
        }
Пример #8
0
		public static G2DPlotStyleCollection PlotStyle_LineArea(Altaxo.Main.Properties.IReadOnlyPropertyBag context)
		{
			G2DPlotStyleCollection result = new G2DPlotStyleCollection();
			var ps1 = new LinePlotStyle(context);
			var ps2 = new DropAreaPlotStyle(context) { FillDirection = Graph.CSPlaneID.Bottom };
			result.Add(ps1);
			result.Add(ps2);
			return result;
		}
Пример #9
0
		public LinePlotStyle(LinePlotStyle from)
		{
			CopyFrom(from, Main.EventFiring.Suppressed);
			CreateEventChain();
		}
Пример #10
0
		public void CopyFrom(LinePlotStyle from, Main.EventFiring eventFiring)
		{
			if (object.ReferenceEquals(this, from))
				return;

			using (var suspendToken = SuspendGetToken())
			{
				this._independentSkipFrequency = from._independentSkipFrequency;
				this._skipFrequency = from._skipFrequency;

				this._ignoreMissingDataPoints = from._ignoreMissingDataPoints;
				this._independentOnShiftingGroupStyles = from._independentOnShiftingGroupStyles;

				this._connectCircular = from._connectCircular;
				this._connectionStyle = from._connectionStyle;

				this._linePen = null == from._linePen ? null : (PenX)from._linePen.Clone();
				this._independentDashStyle = from._independentDashStyle;
				this._independentColor = from._independentColor;

				this._independentSymbolSize = from._independentSymbolSize;
				this._symbolSize = from._symbolSize;

				this._useSymbolGap = from._useSymbolGap;
				this._symbolGapOffset = from._symbolGapOffset;
				this._symbolGapFactor = from._symbolGapFactor;

				EhSelfChanged();

				suspendToken.Resume(eventFiring);
			}
		}
    void InitializeStyles()
    {
      // Clear the previous controller cache
      _additionalPlotStyle = null;
      if (_combinedScatterLineGroupController != null)
      {
        _combinedScatterLineGroupController.ChildControlChanged -= EhView_ActiveChildControlChanged;
        _combinedScatterLineGroupController = null;
      }
      _styleControllerList.Clear();


      // start to create new controllers
      if (_tempdoc.Style.Count > 0)
      {
        bool addHelperStyle = NeedsHelperStyle();
        bool useCombinedTab = UseCombinedScatterLineGroupTab();


        if (useCombinedTab)
        {
          List<ControlViewElement> combList = new List<ControlViewElement>();

          // create the controllers
          IMVCANController ct1 = GetStyleController(_tempdoc.Style[0]);
          _styleControllerList.Add(ct1);


          if (addHelperStyle)
          {
            IPlotArea layer = Main.DocumentPath.GetRootNodeImplementing<IPlotArea>(_doc);
            // add either line or scatter
            if (_tempdoc.Style[0] is LinePlotStyle)
            {
              ScatterPlotStyle scatterStyle = new ScatterPlotStyle();
              scatterStyle.ParentObject = _tempdoc.Style;
              _tempdoc.Style.PrepareNewSubStyle(scatterStyle, layer, _doc.GetRangesAndPoints(layer));
              _additionalPlotStyle = scatterStyle;
              scatterStyle.Shape = Altaxo.Graph.Gdi.Plot.Styles.XYPlotScatterStyles.Shape.NoSymbol;

              _additionalPlotStyleController = GetStyleController( _additionalPlotStyle);
              combList.Add(new ControlViewElement("Symbol", _additionalPlotStyleController));
              combList.Add(new ControlViewElement("Line", ct1));
            }
            else
            {
              LinePlotStyle lineStyle = new LinePlotStyle();
              lineStyle.ParentObject = _tempdoc.Style;
              _tempdoc.Style.PrepareNewSubStyle(lineStyle, layer, _doc.GetRangesAndPoints(layer));
              _additionalPlotStyle = lineStyle;
              lineStyle.Connection = Altaxo.Graph.Gdi.Plot.Styles.XYPlotLineStyles.ConnectionStyle.NoLine;

              _additionalPlotStyleController = GetStyleController( _additionalPlotStyle );
              combList.Add(new ControlViewElement("Symbol", ct1));
              combList.Add(new ControlViewElement("Line", _additionalPlotStyleController));
            }
          }
          else // no helper style, i.e. second style is line style
          {
            // create the controllers
            IMVCANController ct2 = GetStyleController( _tempdoc.Style[1] );
            _styleControllerList.Add(ct2);
            combList.Add(new ControlViewElement("Symbol", ct1));
            combList.Add(new ControlViewElement("Line", ct2));
          }

          combList.Add(new ControlViewElement(string.Empty, this, this._plotGroupView));
          _combinedScatterLineGroupController = new Common.MultiChildController(combList.ToArray(), true);
          Current.Gui.FindAndAttachControlTo(_combinedScatterLineGroupController);
          string title;
          if(null!=_additionalPlotStyle)
            title = string.Format("#{0}:{1}", 1, Current.Gui.GetUserFriendlyClassName(_tempdoc.Style[0].GetType()));
          else
            title = "#1&&2:Symbol&&Line";
          AddTab(title, _combinedScatterLineGroupController, _combinedScatterLineGroupController.ViewObject);
          _combinedScatterLineGroupController.ChildControlChanged += this.EhView_ActiveChildControlChanged;
        } // if use CombinedTab

        // now the remaining styles
        int start = useCombinedTab ? (addHelperStyle ? 1 : 2) : 0;
        for (int i = start; i < _tempdoc.Style.Count; i++)
        {
          IMVCANController ctrl = GetStyleController( _tempdoc.Style[i] );
          _styleControllerList.Add(ctrl);
          string title = string.Format("#{0}:{1}", (i + 1),Current.Gui.GetUserFriendlyClassName(_tempdoc.Style[i].GetType()));
          AddTab(title, ctrl, ctrl != null ? ctrl.ViewObject : null);
        }
      }
      base.SetElements(false);
    }
Пример #12
0
		public XYLineScatterPlotStyle(Altaxo.Serialization.Xml.IXmlDeserializationInfo info)

		{
			var kind = LineScatterPlotStyleKind.LineAndScatter;

			if (0 != (kind & LineScatterPlotStyleKind.Line))
				this.m_LineStyle = new LinePlotStyle(info, oldDeserializationRequiresFullConstruction: true);

			if (0 != (kind & LineScatterPlotStyleKind.Scatter))
				this.m_ScatterStyle = new ScatterPlotStyle(info, oldDeserializationRequiresFullConstruction: true);

			this.m_LineSymbolGap = kind == LineScatterPlotStyleKind.LineAndScatter;
		}
Пример #13
0
 public LinePlotStyle(LinePlotStyle from)
 {
     CopyFrom(from, Main.EventFiring.Suppressed);
     CreateEventChain();
 }
 public XYLineScatterPlotStyle(XYColumnPlotData pa)
 {
   this.m_LineStyle = new LinePlotStyle();
   this.m_ScatterStyle = new ScatterPlotStyle();
   // this.m_PlotAssociation = pa;
   this.m_LineSymbolGap = true;
 }
    public XYLineScatterPlotStyle(LineScatterPlotStyleKind kind)
    {
      if(0!=(kind&LineScatterPlotStyleKind.Line))
        this.m_LineStyle = new LinePlotStyle();
      
      if(0!=(kind&LineScatterPlotStyleKind.Scatter))
        this.m_ScatterStyle = new ScatterPlotStyle();

      this.m_LineSymbolGap = kind==LineScatterPlotStyleKind.LineAndScatter;
    }
    public bool InitializeDocument(params object[] args)
    {
      if (args.Length == 0 || !(args[0] is LinePlotStyle))
        return false;

      bool isFirstTime = (null == _doc);
      _doc = (LinePlotStyle)args[0];
      _tempDoc = _useDocumentCopy == UseDocument.Directly ? _doc : (LinePlotStyle)_doc.Clone();
      Initialize(isFirstTime);
      return true;
    }
    public XYPlotLineStyleController(LinePlotStyle doc)
    {
      if(doc==null)
        throw new ArgumentNullException("doc is null");

      if (!InitializeDocument(doc))
        throw new ApplicationException("Programming error");
    }