public void CopyFrom(XYPlotLayerPositionAndSize from)
        {
            this._layerXPosition     = from._layerXPosition;
            this._layerXPositionType = from._layerXPositionType;
            this._layerYPosition     = from._layerYPosition;
            this._layerYPositionType = from._layerYPositionType;

            this._layerWidth      = from._layerWidth;
            this._layerWidthType  = from._layerWidthType;
            this._layerHeight     = from._layerHeight;
            this._layerHeightType = from._layerHeightType;

            this._layerAngle = from._layerAngle;
            this._layerScale = from._layerScale;
        }
Ejemplo n.º 2
0
        void ChangeTopType(XYPlotLayerPositionType newType)
        {
            XYPlotLayerPositionType oldType = m_TopType;

            if (newType == oldType)
            {
                return;
            }
            double oldPosition = m_Layer.YPositionToPointUnits(m_Top, oldType);

            m_Top     = m_Layer.YPositionToUserUnits(oldPosition, newType);
            m_TopType = newType;

            InitializeTopValue();
        }
Ejemplo n.º 3
0
            public XYPlotLayerPositionAndSize_V0(XYPlotLayerSizeType xzt, double xs, XYPlotLayerSizeType yzt, double ys, XYPlotLayerPositionType xpt, double xp, XYPlotLayerPositionType ypt, double yp, double rotation, double scale)
            {
                _layerWidthType  = xzt;
                _layerWidth      = xs;
                _layerHeightType = yzt;
                _layerHeight     = ys;

                _layerXPositionType = xpt;
                _layerXPosition     = xp;
                _layerYPositionType = ypt;
                _layerYPosition     = yp;

                _layerAngle = rotation;
                _layerScale = scale;
            }
Ejemplo n.º 4
0
        void ChangeLeftType(XYPlotLayerPositionType newType)
        {
            XYPlotLayerPositionType oldType = m_LeftType;

            if (newType == oldType)
            {
                return;
            }
            double oldPosition = m_Layer.XPositionToPointUnits(m_Left, oldType);

            m_Left     = m_Layer.XPositionToUserUnits(oldPosition, newType);
            m_LeftType = newType;

            InitializeLeftValue();
        }
Ejemplo n.º 5
0
        public void SetElements(bool bInit)
        {
            if (bInit)
            {
                m_Height          = m_Layer.UserHeight;
                m_Width           = m_Layer.UserWidth;
                m_Left            = m_Layer.UserXPosition;
                m_Top             = m_Layer.UserYPosition;
                m_Rotation        = m_Layer.Rotation;
                m_Scale           = m_Layer.Scale;
                m_ClipDataToFrame = m_Layer.ClipDataToFrame == LayerDataClipping.StrictToCS;

                m_LeftType    = m_Layer.UserXPositionType;
                m_TopType     = m_Layer.UserYPositionType;
                m_HeightType  = m_Layer.UserHeightType;
                m_WidthType   = m_Layer.UserWidthType;
                m_LinkedLayer = m_Layer.LinkedLayer;


                m_XAxisLink = new AxisLinkController(m_Layer, true);
                m_YAxisLink = new AxisLinkController(m_Layer, false);
            }

            if (View != null)
            {
                InitializeWidthValue();
                InitializeHeightValue();

                InitializeLeftValue();
                InitializeTopValue();

                View.InitializeRotation((float)m_Rotation);
                View.InitializeScale(Serialization.GUIConversion.GetPercentMeasureText(m_Scale));
                View.InitializeClipDataToFrame(m_ClipDataToFrame);

                InitializePositionTypes();
                InitializeSizeTypes();
                InitializeLinkedAxisChoices();

                // initialize the axis link properties
                m_XAxisLink.View = View.GetXAxisLink();
                m_YAxisLink.View = View.GetYAxisLink();
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Get the list of position types in dependence of whether or not we have a linked layer.
        /// </summary>
        /// <returns>List of possible position types.</returns>
        SelectableListNodeList GetPositionTypeList()
        {
            SelectableListNodeList  list  = new SelectableListNodeList();
            XYPlotLayerPositionType toadd = XYPlotLayerPositionType.AbsoluteValue;

            list.Add(new SelectableListNode(Current.Gui.GetUserFriendlyName(toadd), toadd, false));
            toadd = XYPlotLayerPositionType.RelativeToGraphDocument;
            list.Add(new SelectableListNode(Current.Gui.GetUserFriendlyName(toadd), toadd, false));
            if (null != m_LinkedLayer)
            {
                toadd = XYPlotLayerPositionType.RelativeThisNearToLinkedLayerNear;
                list.Add(new SelectableListNode(Current.Gui.GetUserFriendlyName(toadd), toadd, false));
                toadd = XYPlotLayerPositionType.RelativeThisNearToLinkedLayerFar;
                list.Add(new SelectableListNode(Current.Gui.GetUserFriendlyName(toadd), toadd, false));
                toadd = XYPlotLayerPositionType.RelativeThisFarToLinkedLayerNear;
                list.Add(new SelectableListNode(Current.Gui.GetUserFriendlyName(toadd), toadd, false));
                toadd = XYPlotLayerPositionType.RelativeThisFarToLinkedLayerFar;
                list.Add(new SelectableListNode(Current.Gui.GetUserFriendlyName(toadd), toadd, false));
            }
            return(list);
        }
Ejemplo n.º 7
0
    /// <summary>
    /// Calculates from the y position value in points (1/72 inch), the corresponding value in user units.
    /// </summary>
    /// <param name="y">The vertical position value in points.</param>
    /// <param name="ypostype_to_convert_to">The type of the vertical position value to convert to, see <see cref="XYPlotLayerPositionType"/>.</param>
    /// <returns>Calculated value of y in user units.</returns>
    /// <remarks>The function does not change the member variables of the layer and can therefore used
    /// for position calculations without changing the layer. The function is not static because it has to use either the parent
    /// graph or the linked layer for the calculations.</remarks>
    public double YPositionToUserUnits(double y, XYPlotLayerPositionType ypostype_to_convert_to)
    {
      switch (ypostype_to_convert_to)
      {
        case XYPlotLayerPositionType.AbsoluteValue:
          break;
        case XYPlotLayerPositionType.RelativeToGraphDocument:
          y = y / PrintableGraphSize.Height;
          break;
        case XYPlotLayerPositionType.RelativeThisNearToLinkedLayerNear:
          if (LinkedLayer != null)
            y = (y - LinkedLayer.Position.Y) / LinkedLayer.Size.Height;
          break;
        case XYPlotLayerPositionType.RelativeThisNearToLinkedLayerFar:
          if (LinkedLayer != null)
            y = (y - LinkedLayer.Position.Y) / LinkedLayer.Size.Height - 1;
          break;
        case XYPlotLayerPositionType.RelativeThisFarToLinkedLayerNear:
          if (LinkedLayer != null)
            y = (y - LinkedLayer.Position.Y + this.Size.Height) / LinkedLayer.Size.Height;
          break;
        case XYPlotLayerPositionType.RelativeThisFarToLinkedLayerFar:
          if (LinkedLayer != null)
            y = (y - LinkedLayer.Position.Y + this.Size.Height) / LinkedLayer.Size.Height - 1;
          break;
      }

      return y;
    }
Ejemplo n.º 8
0
    /// <summary>
    /// Calculates from the x position value in points (1/72 inch), the corresponding value in user units.
    /// </summary>
    /// <param name="x">The vertical position value in points.</param>
    /// <param name="xpostype_to_convert_to">The type of the vertical position value to convert to, see <see cref="XYPlotLayerPositionType"/>.</param>
    /// <returns>Calculated value of x in user units.</returns>
    /// <remarks>The function does not change the member variables of the layer and can therefore used
    /// for position calculations without changing the layer. The function is not static because it has to use either the parent
    /// graph or the linked layer for the calculations.</remarks>
    public double XPositionToUserUnits(double x, XYPlotLayerPositionType xpostype_to_convert_to)
    {


      switch (xpostype_to_convert_to)
      {
        case XYPlotLayerPositionType.AbsoluteValue:
          break;
        case XYPlotLayerPositionType.RelativeToGraphDocument:
          x = x / PrintableGraphSize.Width;
          break;
        case XYPlotLayerPositionType.RelativeThisNearToLinkedLayerNear:
          if (LinkedLayer != null)
            x = (x - LinkedLayer.Position.X) / LinkedLayer.Size.Width;
          break;
        case XYPlotLayerPositionType.RelativeThisNearToLinkedLayerFar:
          if (LinkedLayer != null)
            x = (x - LinkedLayer.Position.X) / LinkedLayer.Size.Width - 1;
          break;
        case XYPlotLayerPositionType.RelativeThisFarToLinkedLayerNear:
          if (LinkedLayer != null)
            x = (x - LinkedLayer.Position.X + this.Size.Width) / LinkedLayer.Size.Width;
          break;
        case XYPlotLayerPositionType.RelativeThisFarToLinkedLayerFar:
          if (LinkedLayer != null)
            x = (x - LinkedLayer.Position.X + this.Size.Width) / LinkedLayer.Size.Width - 1;
          break;
      }

      return x;
    }
Ejemplo n.º 9
0
    /// <summary>
    /// Calculates from the y position value, which can be absolute or relative, the
    ///  y position in points.
    /// </summary>
    /// <param name="y">The vertical position value of type xpostype.</param>
    /// <param name="ypostype">The type of the vertical position value, see <see cref="XYPlotLayerPositionType"/>.</param>
    /// <returns>Calculated absolute position of the layer in units of points (1/72 inch).</returns>
    /// <remarks>The function does not change the member variables of the layer and can therefore used
    /// for position calculations without changing the layer. The function is not static because it has to use either the parent
    /// graph or the linked layer for the calculations.</remarks>
    public double YPositionToPointUnits(double y, XYPlotLayerPositionType ypostype)
    {
      switch (ypostype)
      {
        case XYPlotLayerPositionType.AbsoluteValue:
          break;
        case XYPlotLayerPositionType.RelativeToGraphDocument:
          y = y * PrintableGraphSize.Height;
          break;
        case XYPlotLayerPositionType.RelativeThisNearToLinkedLayerNear:
          if (LinkedLayer != null)
            y = LinkedLayer.Position.Y + y * LinkedLayer.Size.Height;
          break;
        case XYPlotLayerPositionType.RelativeThisNearToLinkedLayerFar:
          if (LinkedLayer != null)
            y = LinkedLayer.Position.Y + (1 + y) * LinkedLayer.Size.Height;
          break;
        case XYPlotLayerPositionType.RelativeThisFarToLinkedLayerNear:
          if (LinkedLayer != null)
            y = LinkedLayer.Position.Y - this.Size.Height + y * LinkedLayer.Size.Height;
          break;
        case XYPlotLayerPositionType.RelativeThisFarToLinkedLayerFar:
          if (LinkedLayer != null)
            y = LinkedLayer.Position.Y - this.Size.Height + (1 + y) * LinkedLayer.Size.Height;
          break;
      }

      return y;
    }
Ejemplo n.º 10
0
 /// <summary>
 /// Calculates from the x position value, which can be absolute or relative, the
 /// x position in points.
 /// </summary>
 /// <param name="x">The horizontal position value of type xpostype.</param>
 /// <param name="xpostype">The type of the horizontal position value, see <see cref="XYPlotLayerPositionType"/>.</param>
 /// <returns>Calculated absolute position of the layer in units of points (1/72 inch).</returns>
 /// <remarks>The function does not change the member variables of the layer and can therefore used
 /// for position calculations without changing the layer. The function is not static because it has to use either the parent
 /// graph or the linked layer for the calculations.</remarks>
 public double XPositionToPointUnits(double x, XYPlotLayerPositionType xpostype)
 {
   switch (xpostype)
   {
     case XYPlotLayerPositionType.AbsoluteValue:
       break;
     case XYPlotLayerPositionType.RelativeToGraphDocument:
       x = x * PrintableGraphSize.Width;
       break;
     case XYPlotLayerPositionType.RelativeThisNearToLinkedLayerNear:
       if (LinkedLayer != null)
         x = LinkedLayer.Position.X + x * LinkedLayer.Size.Width;
       break;
     case XYPlotLayerPositionType.RelativeThisNearToLinkedLayerFar:
       if (LinkedLayer != null)
         x = LinkedLayer.Position.X + (1 + x) * LinkedLayer.Size.Width;
       break;
     case XYPlotLayerPositionType.RelativeThisFarToLinkedLayerNear:
       if (LinkedLayer != null)
         x = LinkedLayer.Position.X - this.Size.Width + x * LinkedLayer.Size.Width;
       break;
     case XYPlotLayerPositionType.RelativeThisFarToLinkedLayerFar:
       if (LinkedLayer != null)
         x = LinkedLayer.Position.X - this.Size.Width + (1 + x) * LinkedLayer.Size.Width;
       break;
   }
   return x;
 }
Ejemplo n.º 11
0
    public void SetPosition(double x, XYPlotLayerPositionType xpostype, double y, XYPlotLayerPositionType ypostype)
    {
      this._location.XPosition = x;
      this._location.XPositionType = xpostype;
      this._location.YPosition = y;
      this._location.YPositionType = ypostype;

      CalculateCachedPosition();
    }
    public void CopyFrom(XYPlotLayerPositionAndSize from)
    {
      this._layerXPosition = from._layerXPosition;
      this._layerXPositionType = from._layerXPositionType;
      this._layerYPosition = from._layerYPosition;
      this._layerYPositionType = from._layerYPositionType;

      this._layerWidth = from._layerWidth;
      this._layerWidthType = from._layerWidthType;
      this._layerHeight = from._layerHeight;
      this._layerHeightType = from._layerHeightType;

      this._layerAngle = from._layerAngle;
      this._layerScale = from._layerScale;
    }
    void ChangeTopType(XYPlotLayerPositionType newType)
    {
      XYPlotLayerPositionType oldType = m_TopType;
      if (newType == oldType)
        return;
      double oldPosition = m_Layer.YPositionToPointUnits(m_Top, oldType);
      m_Top = m_Layer.YPositionToUserUnits(oldPosition, newType);
      m_TopType = newType;

      InitializeTopValue();
    }
    void ChangeLeftType(XYPlotLayerPositionType newType)
    {
      XYPlotLayerPositionType oldType = m_LeftType;
      if (newType == oldType)
        return;
      double oldPosition = m_Layer.XPositionToPointUnits(m_Left,oldType);
      m_Left  = m_Layer.XPositionToUserUnits(oldPosition,newType);
      m_LeftType = newType;

      InitializeLeftValue();
    }
    public void SetElements(bool bInit)
    {


      if(bInit)
      {
        m_Height    = m_Layer.UserHeight;
        m_Width     = m_Layer.UserWidth;
        m_Left      = m_Layer.UserXPosition;
        m_Top       = m_Layer.UserYPosition;
        m_Rotation  = m_Layer.Rotation;
        m_Scale     = m_Layer.Scale;
        m_ClipDataToFrame = m_Layer.ClipDataToFrame == LayerDataClipping.StrictToCS;

        m_LeftType = m_Layer.UserXPositionType;
        m_TopType  = m_Layer.UserYPositionType;
        m_HeightType = m_Layer.UserHeightType;
        m_WidthType = m_Layer.UserWidthType;
        m_LinkedLayer = m_Layer.LinkedLayer;


        m_XAxisLink = new AxisLinkController(m_Layer,true);
        m_YAxisLink = new AxisLinkController(m_Layer,false);
      }

      if(View!=null)
      {

        InitializeWidthValue();
        InitializeHeightValue();

        InitializeLeftValue();
        InitializeTopValue();

        View.InitializeRotation((float)m_Rotation);
        View.InitializeScale(Serialization.GUIConversion.GetPercentMeasureText(m_Scale));
        View.InitializeClipDataToFrame(m_ClipDataToFrame);

        InitializePositionTypes();
        InitializeSizeTypes();
        InitializeLinkedAxisChoices();

        // initialize the axis link properties
        m_XAxisLink.View = View.GetXAxisLink();
        m_YAxisLink.View = View.GetYAxisLink();

      }

    }