Example #1
0
        public GraphDocument(GraphDocument from)
        {
            this._changedEventSuppressor = new EventSuppressor(this.EhChangedEventResumes);
            this._pageBounds             = from._pageBounds;
            this._printableBounds        = from._printableBounds;
            _creationTime = _lastChangeTime = DateTime.UtcNow;
            this._notes   = from._notes;


            // Clone also the table properties (deep copy)
            if (from._graphProperties != null)
            {
                foreach (string key in from._graphProperties.Keys)
                {
                    ICloneable val = from._graphProperties[key] as ICloneable;
                    if (null != val)
                    {
                        this.SetGraphProperty(key, val.Clone());
                    }
                }
            }

            // the order is important here: clone the layers only before setting the printable graph bounds and other
            // properties, otherwise some errors will happen
            this._layers = (XYPlotLayerCollection)from._layers.Clone();
            this._layers.ParentObject = this;
        }
Example #2
0
 /// <summary>
 /// Creates a empty GraphDocument with no layers and a standard size of A4 landscape.
 /// </summary>
 public GraphDocument()
 {
     this._changedEventSuppressor = new EventSuppressor(this.EhChangedEventResumes);
     this._layers = new XYPlotLayerCollection();
     this._layers.ParentObject = this;
     SetGraphPageBoundsToPrinterSettings();
     this._layers.SetPrintableGraphBounds(_printableBounds, false);
     _creationTime = _lastChangeTime = DateTime.UtcNow;
 }
Example #3
0
        /// <summary>
        /// Copy constructor. Clones all objects in this collection.
        /// </summary>
        /// <param name="from">The collection to clone from.</param>
        public XYPlotLayerCollection(XYPlotLayerCollection from)
        {
            _changeEventSuppressor = new Altaxo.Main.EventSuppressor(this.EhChangeEventResumed);
            this.m_PrintableBounds = from.m_PrintableBounds;

            for (int i = 0; i < from.Count; i++)
            {
                this.Add((XYPlotLayer)from[i].Clone());
            }

            // now we have to fix the linked layer list, since the LinkedLayer property of the Layers point to the original layers
            // and not to the cloned layers!
            for (int i = 0; i < Count; i++)
            {
                if (null != from[i].LinkedLayer)
                {
                    this[i].LinkedLayer = this[from[i].LinkedLayer.Number];
                }
            }
        }
Example #4
0
    /// <summary>
    /// Creates a layer with position <paramref name="position"/> and size <paramref name="size"/>.
    /// </summary>
    /// <param name="position">The position of the layer on the printable area in points (1/72 inch).</param>
    /// <param name="size">The size of the layer in points (1/72 inch).</param>
    /// <param name="coordinateSystem">The coordinate system to use for the layer.</param>
    public XYPlotLayer(PointF position, SizeF size, G2DCoordinateSystem coordinateSystem)
    {
      this._changeEventSuppressor = new Altaxo.Main.EventSuppressor(EhChangeEventResumed);
      this.Location = new XYPlotLayerPositionAndSize();

      this.CoordinateSystem = coordinateSystem;
      this.Size = size;
      this.Position = position;



      this.AxisStyles = new AxisStyleCollection();
      this.LinkedScales = new LinkedScaleCollection();
      this.GridPlanes = new GridPlaneCollection();
      this.GridPlanes.Add( new GridPlane(CSPlaneID.Front));
      this.GraphObjects = new GraphicCollection();
      this.Legends = new GraphicCollection();


      CalculateMatrix();

      LinkedLayerLink = new Main.RelDocNodeProxy(null, this);
      PlotItems = new PlotItemCollection(this);
      
    }
Example #5
0
 /// <summary>
 /// Constructor for deserialization purposes only.
 /// </summary>
 protected XYPlotLayer()
 {
   this._changeEventSuppressor = new Altaxo.Main.EventSuppressor(EhChangeEventResumed);
   this.CoordinateSystem = new CS.G2DCartesicCoordinateSystem();
   this.AxisStyles = new AxisStyleCollection();
   this.LinkedScales = new LinkedScaleCollection();
   this.GraphObjects = new GraphicCollection();
   this.Legends = new GraphicCollection();
   this.Location = new XYPlotLayerPositionAndSize();
   this.GridPlanes = new GridPlaneCollection();
   this.GridPlanes.Add(new GridPlane(CSPlaneID.Front));
 }
Example #6
0
 /// <summary>
 /// The copy constructor.
 /// </summary>
 /// <param name="from"></param>
 public XYPlotLayer(XYPlotLayer from)
 {
   _changeEventSuppressor = new Altaxo.Main.EventSuppressor(EhChangeEventResumed);
   CopyFrom(from);
 }
Example #7
0
    public GraphDocument(GraphDocument from)
    {
      this._changedEventSuppressor = new EventSuppressor(this.EhChangedEventResumes);
      this._pageBounds = from._pageBounds;
      this._printableBounds = from._printableBounds;
      _creationTime = _lastChangeTime = DateTime.UtcNow;
      this._notes = from._notes;


      // Clone also the table properties (deep copy)
      if(from._graphProperties!=null)
      {
        foreach(string key in from._graphProperties.Keys)
        {
          ICloneable val = from._graphProperties[key] as ICloneable;
          if(null!=val)
            this.SetGraphProperty(key,val.Clone());
        }
      }

      // the order is important here: clone the layers only before setting the printable graph bounds and other
      // properties, otherwise some errors will happen
      this._layers = (XYPlotLayerCollection)from._layers.Clone();
      this._layers.ParentObject = this;

    }
Example #8
0
 /// <summary>
 /// Creates a empty GraphDocument with no layers and a standard size of A4 landscape.
 /// </summary>
 public GraphDocument()
 {
   this._changedEventSuppressor = new EventSuppressor(this.EhChangedEventResumes);
   this._layers = new XYPlotLayerCollection();
   this._layers.ParentObject = this;
   SetGraphPageBoundsToPrinterSettings();
   this._layers.SetPrintableGraphBounds(_printableBounds, false);
   _creationTime = _lastChangeTime = DateTime.UtcNow;
 }
    /// <summary>
    /// Copy constructor. Clones all objects in this collection.
    /// </summary>
    /// <param name="from">The collection to clone from.</param>
    public XYPlotLayerCollection(XYPlotLayerCollection from)
    {
      _changeEventSuppressor = new Altaxo.Main.EventSuppressor(this.EhChangeEventResumed);
      this.m_PrintableBounds = from.m_PrintableBounds;

      for(int i=0;i<from.Count;i++)
        this.Add((XYPlotLayer)from[i].Clone());
  
      // now we have to fix the linked layer list, since the LinkedLayer property of the Layers point to the original layers
      // and not to the cloned layers!
      for(int i=0;i<Count;i++)
      {
        if(null!=from[i].LinkedLayer)
        {
          this[i].LinkedLayer = this[from[i].LinkedLayer.Number];
        }
      }
    }
 /// <summary>
 /// Creates an empty XYPlotLayerCollection without parent.
 /// </summary>
 public XYPlotLayerCollection()
 {
   _changeEventSuppressor = new Altaxo.Main.EventSuppressor(this.EhChangeEventResumed);
 }
Example #11
0
 /// <summary>
 /// Creates an empty XYPlotLayerCollection without parent.
 /// </summary>
 public XYPlotLayerCollection()
 {
     _changeEventSuppressor = new Altaxo.Main.EventSuppressor(this.EhChangeEventResumed);
 }