Пример #1
0
 /// <summary>
 /// The Copy Constructor
 /// </summary>
 /// <param name="rhs">The TextList object from which to copy</param>
 public TextList(TextList rhs)
 {
     foreach (TextItem item in rhs)
     {
         this.Add(new TextItem(item));
     }
 }
Пример #2
0
        public AldysPane(RectangleF paneRect, string paneTitle,
                         string xTitle, string yTitle, AldysGraph objAld)
        {
            statusflag = true;
            bPeakEdit  = false;
            cursor     = Cursors.NoMove2D;
            this.peakX = new ArrayList();
            this.peakY = new ArrayList();

            //Added By Mangesh S. on 25-Nov-2006
            peakInfoX = new ArrayList();
            peakInfoY = new ArrayList();
            //Added By Mangesh S. on 25-Nov-2006

            this.paneRect    = paneRect;
            this.axisRect    = axisRect;
            xAxis            = new XAxis();
            yAxis            = new YAxis();
            legend           = new Legend();
            curveList        = new CurveList();
            textList         = new TextList();
            arrowList        = new ArrowList();
            xAxis.Title      = xTitle;
            yAxis.Title      = xTitle;
            this.title       = paneTitle;
            this.isShowTitle = Defaults.Pane.ShowTitle;
            this.fontSpec    = new FontSpecs(Defaults.Pane.FontFamily,
                                             Defaults.Pane.FontSize, Defaults.Pane.FontColor, Defaults.Pane.FontBold,
                                             Defaults.Pane.FontItalic, Defaults.Pane.FontUnderline);
            this.fontSpec.IsFilled = false;
            this.fontSpec.IsFramed = false;

            this.isIgnoreInitial = Defaults.Axis.IgnoreInitial;

            this.isPaneFramed      = Defaults.Pane.IsFramed;
            this.paneFrameColor    = Defaults.Pane.FrameColor;
            this.paneFramePenWidth = Defaults.Pane.FramePenWidth;
            this.paneBackColor     = Defaults.Pane.BackColor;

            this.isAxisFramed      = Defaults.Axis.IsFramed;
            this.axisFrameColor    = Defaults.Axis.FrameColor;
            this.axisFramePenWidth = Defaults.Axis.FramePenWidth;
            this.axisBackColor     = Defaults.Axis.BackColor;

            this.baseDimension    = Defaults.Pane.BaseDimension;
            this.paneGap          = Defaults.Pane.Gap;
            this.objAldysGraphTmp = objAld;
        }
Пример #3
0
//		public AldysPane()
//		{
//			//
//			// TODO: Add constructor logic here
//			//
//		}
        /// <summary>
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">The GraphPane object from which to copy</param>
        public AldysPane(AldysPane rhs)
        {
            statusflag = rhs.statusflag;
            bPeakEdit  = rhs.bPeakEdit;
            cursor     = Cursors.NoMove2D;
            this.peakX = rhs.peakX;
            this.peakY = rhs.peakY;

            //Added By Mangesh S. on 25-Nov-2006
            this.peakInfoX = rhs.peakInfoX;
            this.peakInfoY = rhs.peakInfoY;
            //Added By Mangesh S. on 25-Nov-2006

            paneRect  = rhs.PaneRect;
            axisRect  = rhs.AxisRect;
            xAxis     = new XAxis(rhs.XAxis);
            yAxis     = new YAxis(rhs.YAxis);
            legend    = new Legend(rhs.Legend);
            curveList = new CurveList(rhs.CurveList);
            textList  = new TextList(rhs.TextList);
            arrowList = new ArrowList(rhs.ArrowList);

            this.title       = rhs.Title;
            this.isShowTitle = rhs.IsShowTitle;
            this.fontSpec    = new FontSpecs(rhs.fontSpec);

            this.isIgnoreInitial = rhs.IsIgnoreInitial;

            this.isPaneFramed      = rhs.IsPaneFramed;
            this.paneFrameColor    = rhs.PaneFrameColor;
            this.paneFramePenWidth = rhs.PaneFramePenWidth;
            this.paneBackColor     = rhs.PaneBackColor;

            this.isAxisFramed      = rhs.IsAxisFramed;
            this.axisFrameColor    = rhs.AxisFrameColor;
            this.axisFramePenWidth = rhs.AxisFramePenWidth;
            this.axisBackColor     = rhs.AxisBackColor;

            this.baseDimension    = rhs.BaseDimension;
            this.paneGap          = rhs.PaneGap;
            this.objAldysGraphTmp = rhs.objAldysGraphTmp;
            this.ShowCurveLabels  = rhs.ShowCurveLabels;
        }
Пример #4
0
        public void DrawCurveLabels()
        {
            int    intCurveCount = 0;
            string name;
            double x, y;

            if (ShowCurveLabels == false)
            {
                return;
            }

            try
            {
                //double dblInterval=((this.XAxis.Max - this.XAxis.Min)/this.CurveList.Count -1);
                //after commenting the above line , following block of code is
                //written by deepak b. on 01.04.06

                ////////////----------
                int    LastPointOnCurve;
                double XValueOfLastPointOnCurve, MinXValueOfLastPointOnCurve;
                MinXValueOfLastPointOnCurve = 0.0;
                foreach (CurveItem curve in CurveList)
                {
                    LastPointOnCurve            = curve.X.Count - 1;
                    XValueOfLastPointOnCurve    = (double)curve.X[LastPointOnCurve];
                    MinXValueOfLastPointOnCurve = XValueOfLastPointOnCurve;
                    if (MinXValueOfLastPointOnCurve <= XValueOfLastPointOnCurve)
                    {
                        MinXValueOfLastPointOnCurve = XValueOfLastPointOnCurve;
                    }
                }

                double dblInterval = ((MinXValueOfLastPointOnCurve - this.XAxis.Min) / this.CurveList.Count);
                ////////////----------

                double dblFrom, dblTo;
                dblFrom = this.XAxis.Min;
                dblTo   = dblFrom + dblInterval;

                foreach (CurveItem curve in CurveList)
                {
                    bool blnDrawn = false;
                    curve.LabelX = curve.Label;
                    curve.Label += "(" + intCurveCount.ToString() + ")";

                    name = intCurveCount.ToString();

                    for (int intCount = 0; intCount <= curve.X.Count - 1; intCount++)
                    {
                        if ((double)curve.X[intCount] >= dblFrom && (double)curve.X[intCount] <= dblTo)
                        {
                            x = (double)curve.X[intCount];
                            y = (double)curve.Y[intCount];

                            TextItem text = new TextItem(name, (float)x, (float)y);
                            text.CoordinateFrame = CoordType.AxisXYScale;
                            text.AlignH          = FontAlignH.Center;
                            text.AlignV          = FontAlignV.Bottom;
                            if (CurveLabelSize != 0)
                            {
                                text.FontSpec.Size = CurveLabelSize;
                            }
                            text.ForCurveLabel      = true;
                            text.FontSpec.IsFramed  = true;
                            text.FontSpec.FontColor = curve.Line.Color;
                            TextList.Add(text);

                            intCurveCount += 1;
                            dblFrom        = dblTo;
                            dblTo          = dblFrom + dblInterval;

                            blnDrawn = true;
                            break;
                        }
                        blnDrawn = false;
                    }
                    if (blnDrawn == false)
                    {
                        //this if block is written by deepak b. on 01.04.06
                        int LastPointBeforeEdge = 0;
                        for (int intCount = curve.X.Count - 1; intCount >= 0; intCount--)
                        {
                            if ((double)curve.X[intCount] < this.XAxis.Min || (double)curve.X[intCount] > this.XAxis.Max || (double)curve.Y[intCount] < this.YAxis.Min || (double)curve.Y[intCount] > this.YAxis.Max)
                            {
                                //Do nothing
                            }
                            else
                            {
                                LastPointBeforeEdge = intCount;
                                break;
                            }
                        }

                        x = (double)curve.X[LastPointBeforeEdge];
                        y = (double)curve.Y[LastPointBeforeEdge];

                        TextItem text = new TextItem(name, (float)x, (float)y);
                        text.CoordinateFrame = CoordType.AxisXYScale;
                        text.AlignH          = FontAlignH.Center;
                        text.AlignV          = FontAlignV.Bottom;
                        text.ForCurveLabel   = true;
                        if (CurveLabelSize != 0)
                        {
                            text.FontSpec.Size = CurveLabelSize;
                        }
                        text.FontSpec.IsFramed  = true;
                        text.FontSpec.FontColor = curve.Line.Color;
                        TextList.Add(text);

                        intCurveCount += 1;
                    }
                }
            }
            catch
            {
            }
            finally
            {
            }
        }