public virtual void CalculateEachStackingGroupBounds()
        {
            int num  = this.BoundsScreen.Left;
            int num2 = this.BoundsLayout.Left;

            for (int i = 0; i < this.Count; i++)
            {
                PlotLayoutStackingGroup plotLayoutStackingGroup = this[i];
                int maxDepthLeftScreen  = plotLayoutStackingGroup.MaxDepthLeftScreen;
                int maxDepthLeftLayout  = plotLayoutStackingGroup.MaxDepthLeftLayout;
                int dataViewWidthScreen = plotLayoutStackingGroup.DataViewWidthScreen;
                int dataViewWidthLayout = plotLayoutStackingGroup.DataViewWidthLayout;
                int maxDepthRightScreen = plotLayoutStackingGroup.MaxDepthRightScreen;
                int maxDepthRightLayout = plotLayoutStackingGroup.MaxDepthRightLayout;
                int num3 = maxDepthLeftScreen + dataViewWidthScreen + maxDepthRightScreen + plotLayoutStackingGroup.OuterMarginScreen * 2;
                int num4 = maxDepthLeftLayout + dataViewWidthLayout + maxDepthRightLayout + plotLayoutStackingGroup.OuterMarginLayout * 2;
                plotLayoutStackingGroup.BoundsScreen = new Rectangle(num, this.BoundsScreen.Top, num3, this.BoundsScreen.Height);
                plotLayoutStackingGroup.BoundsLayout = new Rectangle(num2, this.BoundsLayout.Top, num4, this.BoundsLayout.Height);
                num  += num3 + PlotLayoutStackingGroup.DockMarginScreen;
                num2 += num4;
                plotLayoutStackingGroup.DataViewReferenceLeftScreen  = plotLayoutStackingGroup.BoundsScreen.Left + plotLayoutStackingGroup.MaxDepthLeftScreen + plotLayoutStackingGroup.OuterMarginScreen;
                plotLayoutStackingGroup.DataViewReferenceRightScreen = plotLayoutStackingGroup.BoundsScreen.Right - plotLayoutStackingGroup.MaxDepthRightScreen - plotLayoutStackingGroup.OuterMarginScreen;
                plotLayoutStackingGroup.DataViewReferenceLeftLayout  = plotLayoutStackingGroup.BoundsLayout.Left + plotLayoutStackingGroup.MaxDepthLeftLayout + plotLayoutStackingGroup.OuterMarginLayout;
                plotLayoutStackingGroup.DataViewReferenceRightLayout = plotLayoutStackingGroup.BoundsLayout.Right - plotLayoutStackingGroup.MaxDepthRightLayout - plotLayoutStackingGroup.OuterMarginLayout;
            }
        }
Example #2
0
 private void AssignGroups()
 {
     this.PlotDockGroup.Clear();
     this.LayoutGroupOrphan.Clear();
     this.StackingGroups.Clear();
     foreach (PlotLayoutBlockGroup dataViewGroup in this.DataViewGroups)
     {
         dataViewGroup.Clear();
         PlotLayoutStackingGroup plotLayoutStackingGroup = this.StackingGroups.GetStackingGroup(dataViewGroup.DataView);
         if (plotLayoutStackingGroup == null)
         {
             plotLayoutStackingGroup       = new PlotLayoutStackingGroup();
             plotLayoutStackingGroup.Index = dataViewGroup.DataView.StackingGroupIndex;
             this.StackingGroups.Add(plotLayoutStackingGroup);
         }
         plotLayoutStackingGroup.Add(dataViewGroup);
     }
     foreach (PlotLayoutBlockItem blockItem in this.BlockItems)
     {
         if (blockItem.Object is PlotLayoutAxis)
         {
             PlotLayoutAxis       plotLayoutAxis = blockItem.Object as PlotLayoutAxis;
             PlotLayoutBlockGroup blockGroup     = this.GetBlockGroup(plotLayoutAxis.DockDataView);
             if (blockGroup != null)
             {
                 blockGroup.Add(blockItem);
             }
             else
             {
                 this.LayoutGroupOrphan.Add(blockItem);
             }
         }
         else if (blockItem.Object is PlotLayoutDockableAll)
         {
             PlotLayoutDockableAll plotLayoutDockableAll = blockItem.Object as PlotLayoutDockableAll;
             if (plotLayoutDockableAll.DockStyle == PlotDockStyleAll.Plot)
             {
                 this.PlotDockGroup.Add(blockItem);
             }
             else
             {
                 PlotLayoutBlockGroup blockGroup = this.GetBlockGroup(plotLayoutDockableAll.DockDataView);
                 if (blockGroup != null)
                 {
                     blockGroup.Add(blockItem);
                 }
                 else
                 {
                     this.LayoutGroupOrphan.Add(blockItem);
                 }
             }
         }
     }
 }
Example #3
0
        int IComparer.Compare(object x, object y)
        {
            PlotLayoutStackingGroup plotLayoutStackingGroup  = x as PlotLayoutStackingGroup;
            PlotLayoutStackingGroup plotLayoutStackingGroup2 = y as PlotLayoutStackingGroup;

            if (plotLayoutStackingGroup == null)
            {
                throw new Exception("x is not a PlotLayoutStackingGroup object");
            }
            if (plotLayoutStackingGroup2 == null)
            {
                throw new Exception("y is not a PlotLayoutStackingGroup object");
            }
            return(plotLayoutStackingGroup.Index.CompareTo(plotLayoutStackingGroup2.Index));
        }
 public int IndexOf(PlotLayoutStackingGroup value)
 {
     return(this.m_List.IndexOf(value));
 }
 public int Add(PlotLayoutStackingGroup value)
 {
     return(this.m_List.Add(value));
 }
        public virtual void SetDataViewWidthsAndReferences()
        {
            this.MaxDepthTopScreen    = 0;
            this.MaxDepthTopLayout    = 0;
            this.MaxDepthBottomScreen = 0;
            this.MaxDepthBottomLayout = 0;
            int num  = 0;
            int num2 = 0;
            int num3 = 0;
            int num4 = 0;
            int num5 = 0;

            if (this.Count != 0)
            {
                int num6 = 0;
                for (int i = 0; i < this.Count; i++)
                {
                    PlotLayoutStackingGroup plotLayoutStackingGroup = this[i];
                    num2 += plotLayoutStackingGroup.MaxDepthWidthLayout;
                    this.MaxDepthTopLayout    = Math.Max(this.MaxDepthTopLayout, plotLayoutStackingGroup.MaxDepthTopLayout);
                    this.MaxDepthBottomLayout = Math.Max(this.MaxDepthBottomLayout, plotLayoutStackingGroup.MaxDepthBottomLayout);
                    num4 += plotLayoutStackingGroup.OuterMarginLayout * 2;
                    if (plotLayoutStackingGroup.DataViewVisibleCount != 0)
                    {
                        num += plotLayoutStackingGroup.MaxDepthWidthScreen;
                        this.MaxDepthTopScreen    = Math.Max(this.MaxDepthTopScreen, plotLayoutStackingGroup.MaxDepthTopScreen);
                        this.MaxDepthBottomScreen = Math.Max(this.MaxDepthBottomScreen, plotLayoutStackingGroup.MaxDepthBottomScreen);
                        num3 += plotLayoutStackingGroup.OuterMarginScreen * 2;
                        num5++;
                    }
                }
                if (num5 != 0)
                {
                    num6 = (num5 - 1) * PlotLayoutStackingGroup.DockMarginScreen;
                    int num7  = this.BoundsScreen.Width - num - num3 - num6;
                    int num8  = this.BoundsLayout.Width - num2 - num4;
                    int num9  = num7 / num5;
                    int num10 = num8 / this.Count;
                    int num11 = num7 - num9 * num5;
                    int num12 = num8 - num10 * this.Count;
                    foreach (PlotLayoutStackingGroup item in this)
                    {
                        if (item.DataViewVisibleCount != 0)
                        {
                            if (num11 > 0)
                            {
                                item.DataViewWidthScreen = num9 + 1;
                                num11--;
                            }
                            else
                            {
                                item.DataViewWidthScreen = num9;
                            }
                        }
                        if (num12 > 0)
                        {
                            item.DataViewWidthLayout = num10 + 1;
                            num12--;
                        }
                        else
                        {
                            item.DataViewWidthLayout = num10;
                        }
                    }
                    foreach (PlotLayoutStackingGroup item2 in this)
                    {
                        if (item2.DataViewVisibleCount != 0)
                        {
                            item2.DataViewReferenceTopScreen    = this.BoundsScreen.Top + this.MaxDepthTopScreen + item2.OuterMarginScreen;
                            item2.DataViewReferenceBottomScreen = this.BoundsScreen.Bottom - this.MaxDepthBottomScreen - item2.OuterMarginScreen;
                        }
                        item2.DataViewReferenceTopLayout    = this.BoundsLayout.Top + this.MaxDepthTopLayout + item2.OuterMarginLayout;
                        item2.DataViewReferenceBottomLayout = this.BoundsLayout.Bottom - this.MaxDepthBottomLayout - item2.OuterMarginLayout;
                    }
                }
            }
        }