Пример #1
0
        /// <summary>
        /// Place a list of <see c_ref="CurveItem" />'s in the selection list, removing all other
        /// items.
        /// </summary>
        /// <param name="master">The <see c_ref="MasterPane" /> that is the "owner"
        /// of the <see c_ref="CurveItem" />'s.</param>
        /// <param name="ciList">The list of <see c_ref="CurveItem" /> to be added to the list.</param>
        public void Select(MasterPane master, CurveList ciList)
        {
            //Clear the selection, but don't send the event,
            //the event will be sent in "AddToSelection" by calling "UpdateSelection"
            ClearSelection(master, false);

            AddToSelection(master, ciList);
        }
Пример #2
0
        /// <summary>
        /// The Copy Constructor
        /// </summary>
        /// <param name="rhs">The XAxis object from which to copy</param>
        public CurveList(CurveList rhs)
        {
            maxPts = rhs.maxPts;

            foreach (CurveItem item in rhs)
            {
                Add((CurveItem)((ICloneable)item).Clone());
            }
        }
Пример #3
0
        /// <summary>
        /// Add a list of <see c_ref="CurveItem" />'s to the selection list.
        /// </summary>
        /// <param name="master">The <see c_ref="MasterPane" /> that is the "owner"
        /// of the <see c_ref="CurveItem" />'s.</param>
        /// <param name="ciList">The list of <see c_ref="CurveItem" />'s to be added to the list.</param>
        public void AddToSelection(MasterPane master, CurveList ciList)
        {
            foreach (CurveItem ci in ciList)
            {
                if (Contains(ci) == false)
                {
                    Add(ci);
                }
            }

            UpdateSelection(master);
        }
Пример #4
0
        /// <summary>
        /// Render all the <see c_ref="CurveItem"/> objects in the list to the
        /// specified <see c_ref="Graphics"/>
        /// device by calling the <see c_ref="CurveItem.Draw"/> member function of
        /// each <see c_ref="CurveItem"/> object.
        /// </summary>
        /// <param name="g">
        /// A graphic device object to be drawn into.  This is normally e.Graphics from the
        /// PaintEventArgs argument to the Paint() method.
        /// </param>
        /// <param name="pane">
        /// A reference to the <see c_ref="GraphPane"/> object that is the parent or
        /// owner of this object.
        /// </param>
        /// <param name="scaleFactor">
        /// The scaling factor to be used for rendering objects.  This is calculated and
        /// passed down by the parent <see c_ref="GraphPane"/> object using the
        /// <see c_ref="PaneBase.CalcScaleFactor"/> method, and is used to proportionally adjust
        /// font sizes, etc. according to the actual size of the graph.
        /// </param>
        public void Draw(Graphics g, GraphPane pane, float scaleFactor)
        {
            // Configure the accumulator for stacked bars
            //Bar.ResetBarStack();

            // Count the number of BarItems in the curvelist
            int pos = NumBars;

            // sorted overlay bars are a special case, since they are sorted independently at each
            // ordinal position.
            if (pane._barSettings.Type == BarType.SortedOverlay)
            {
                // First, create a new curveList with references (not clones) of the curves
                CurveList tempList = new CurveList();
                foreach (CurveItem curve in this)
                {
                    if (curve.IsBar)
                    {
                        tempList.Add(curve);
                    }
                }

                // Loop through the bars, graphing each ordinal position separately
                for (int i = 0; i < maxPts; i++)
                {
                    // At each ordinal position, sort the curves according to the value axis value
                    tempList.Sort(pane._barSettings.Base == BarBase.X ? SortType.YValues : SortType.XValues, i);
                    // plot the bars for the current ordinal position, in sorted order
                    foreach (BarItem barItem in tempList)
                    {
                        barItem.Bar.DrawSingleBar(g, pane, barItem,
                                                  barItem.BaseAxis(pane),
                                                  barItem.ValueAxis(pane),
                                                  0, i, barItem.GetBarWidth(pane), scaleFactor);
                    }
                }
            }



            // Loop for each curve in reverse order to pick up the remaining curves
            // The reverse order is done so that curves that are later in the list are plotted behind
            // curves that are earlier in the list

            for (int i = Count - 1; i >= 0; i--)
            {
                CurveItem curve = this[i];

                if (curve.IsBar)
                {
                    pos--;
                }

                // Render the curve

                //	if it's a sorted overlay bar type, it's already been done above
                if (!(curve.IsBar && pane._barSettings.Type == BarType.SortedOverlay))
                {
                    curve.Draw(g, pane, pos, scaleFactor);
                }
            }
        }