예제 #1
0
        public void Add(PlotLayoutBlockItem value)
        {
            PlotLayoutDockableDataView plotLayoutDockableDataView = value.Object as PlotLayoutDockableDataView;

            if (plotLayoutDockableDataView != null)
            {
                if (plotLayoutDockableDataView.DockLeft)
                {
                    this.ListLeft.Add(value);
                    value.List = this.ListLeft;
                }
                else if (plotLayoutDockableDataView.DockRight)
                {
                    this.ListRight.Add(value);
                    value.List = this.ListRight;
                }
                else if (plotLayoutDockableDataView.DockTop)
                {
                    this.ListTop.Add(value);
                    value.List = this.ListTop;
                }
                else if (plotLayoutDockableDataView.DockBottom)
                {
                    this.ListBottom.Add(value);
                    value.List = this.ListBottom;
                }
            }
        }
        public void FixupStacking(PlotLayoutBlockItemCollection list, int targetIndex)
        {
            PlotLayoutBlockItemCollection plotLayoutBlockItemCollection = new PlotLayoutBlockItemCollection();

            foreach (PlotLayoutBlockItem item in list)
            {
                if (item.Object.DockOrder == targetIndex)
                {
                    plotLayoutBlockItemCollection.Add(item);
                }
            }
            plotLayoutBlockItemCollection.SortDockPercentStart();
            for (int i = 0; i < plotLayoutBlockItemCollection.Count; i++)
            {
                PlotLayoutBlockItem        plotLayoutBlockItem2       = plotLayoutBlockItemCollection[i];
                PlotLayoutDockableDataView plotLayoutDockableDataView = plotLayoutBlockItem2.Object as PlotLayoutDockableDataView;
                if (plotLayoutDockableDataView != null)
                {
                    plotLayoutDockableDataView.DockPercentStart = (double)i * 1.0 / (double)plotLayoutBlockItemCollection.Count;
                    plotLayoutDockableDataView.DockPercentStop  = plotLayoutDockableDataView.DockPercentStart + 1.0 / (double)plotLayoutBlockItemCollection.Count;
                }
            }
        }
예제 #3
0
 private void Setup(PaintArgs p, Rectangle rScreen, Rectangle rLayout)
 {
     if (this.m_ObjectsDirty)
     {
         this.LayoutObjects.Clear();
         foreach (PlotLayoutBase xAxis in this.Plot.XAxes)
         {
             this.LayoutObjects.Add(xAxis);
         }
         foreach (PlotLayoutBase yAxis in this.Plot.YAxes)
         {
             this.LayoutObjects.Add(yAxis);
         }
         foreach (PlotLayoutBase legend in this.Plot.Legends)
         {
             this.LayoutObjects.Add(legend);
         }
         foreach (PlotLayoutBase table in this.Plot.Tables)
         {
             this.LayoutObjects.Add(table);
         }
         foreach (PlotLayoutBase label in this.Plot.Labels)
         {
             this.LayoutObjects.Add(label);
         }
         this.BlockItems.Clear();
         this.BlockObjects.Clear();
         this.BlockObjects.Add(this.PlotDockGroup);
         foreach (PlotLayoutBase layoutObject in this.LayoutObjects)
         {
             PlotLayoutBlockItem plotLayoutBlockItem = new PlotLayoutBlockItem();
             plotLayoutBlockItem.Object = layoutObject;
             this.BlockItems.Add(plotLayoutBlockItem);
             this.BlockObjects.Add(plotLayoutBlockItem);
         }
         this.DataViewGroups.Clear();
         foreach (PlotLayoutDataView dataView in this.Plot.DataViews)
         {
             PlotLayoutBlockGroup plotLayoutBlockGroup = new PlotLayoutBlockGroup();
             plotLayoutBlockGroup.Object   = dataView;
             plotLayoutBlockGroup.DataView = dataView;
             this.DataViewGroups.Add(plotLayoutBlockGroup);
             this.BlockObjects.Add(plotLayoutBlockGroup);
         }
         this.m_ObjectsDirty = false;
     }
     foreach (PlotLayoutBase layoutObject2 in this.LayoutObjects)
     {
         layoutObject2.Bounds                 = rScreen;
         layoutObject2.BoundsClip             = rScreen;
         layoutObject2.TextOverlapPixelsStart = 0;
         layoutObject2.TextOverlapPixelsStop  = 0;
     }
     for (int i = 0; i < 2; i++)
     {
         this.AssignGroups();
         foreach (PlotLayoutDataView dataView2 in this.Plot.DataViews)
         {
             dataView2.Bounds                 = Rectangle.Empty;
             dataView2.BoundsClip             = Rectangle.Empty;
             dataView2.DockDepthPixels        = 0;
             dataView2.TextOverlapPixelsStart = 0;
             dataView2.TextOverlapPixelsStop  = 0;
         }
         foreach (PlotLayoutBase layoutObject3 in this.LayoutObjects)
         {
             ((IPlotLayout)layoutObject3).CalculateDepthPixels(p);
         }
         this.PlotDockGroup.SortDockOrders();
         this.DataViewGroups.SortDockOrders();
         this.StackingGroups.SortStackingIndex();
         this.StackingGroups.SortDataViewsDockOrder();
         this.PlotDockGroup.Calculate(p);
         this.DataViewGroups.Calculate(p);
         this.PlotDockGroup.InnerRectangleScreen = new Rectangle(rScreen.Left + this.PlotDockGroup.DepthLeftScreen, rScreen.Top + this.PlotDockGroup.DepthTopScreen, rScreen.Width - this.PlotDockGroup.DepthWidthScreen, rScreen.Height - this.PlotDockGroup.DepthHeightScreen);
         this.PlotDockGroup.InnerRectangleLayout = new Rectangle(rLayout.Left + this.PlotDockGroup.DepthLeftLayout, rLayout.Left + this.PlotDockGroup.DepthTopLayout, rLayout.Width - this.PlotDockGroup.DepthWidthLayout, rLayout.Height - this.PlotDockGroup.DepthHeightLayout);
         this.StackingGroups.BoundsScreen        = this.PlotDockGroup.InnerRectangleScreen;
         this.StackingGroups.BoundsLayout        = this.PlotDockGroup.InnerRectangleLayout;
         this.StackingGroups.Calculate();
         this.StackingGroups.SetDataViewWidthsAndReferences();
         this.StackingGroups.CalculateEachStackingGroupBounds();
         this.StackingGroups.PerformDataViewHeightCalculations();
         this.StackingGroups.PerformDataViewBoundsCalculations();
         this.PlotDockGroup.CalculateAndSetAllDockObjectBounds();
         this.DataViewGroups.CalculateAndSetAllDockObjectBounds();
         this.BlockItems.TransferBoundsToLayoutObjects();
         this.DataViewGroups.TransferBoundsToLayoutObjects();
     }
 }
예제 #4
0
 public int IndexOf(PlotLayoutBlockItem value)
 {
     return(this.m_List.IndexOf(value));
 }
예제 #5
0
 public int Add(PlotLayoutBlockItem value)
 {
     return(this.m_List.Add(value));
 }