public void DropDataViewOnDataView() { PlotLayoutDataView plotLayoutDataView = this.Source.Object as PlotLayoutDataView; PlotLayoutDataView plotLayoutDataView2 = this.Destination.Object as PlotLayoutDataView; if (this.DestinationSide != PlotDragSide.Top && this.DestinationSide != PlotDragSide.Bottom) { plotLayoutDataView.StackingGroupIndex = plotLayoutDataView2.StackingGroupIndex; if (this.DestinationSide == PlotDragSide.Left) { foreach (PlotLayoutDataView dataView in ((IPlotObject)plotLayoutDataView2).Plot.DataViews) { if (dataView.StackingGroupIndex < plotLayoutDataView2.StackingGroupIndex) { dataView.StackingGroupIndex--; } } plotLayoutDataView.DockOrder = 0; plotLayoutDataView.StackingGroupIndex = plotLayoutDataView2.StackingGroupIndex - 1; } else { foreach (PlotLayoutDataView dataView2 in ((IPlotObject)plotLayoutDataView2).Plot.DataViews) { if (dataView2.StackingGroupIndex > plotLayoutDataView2.StackingGroupIndex) { dataView2.StackingGroupIndex++; } } plotLayoutDataView.DockOrder = 0; plotLayoutDataView.StackingGroupIndex = plotLayoutDataView2.StackingGroupIndex + 1; } } else { plotLayoutDataView.StackingGroupIndex = plotLayoutDataView2.StackingGroupIndex; if (this.DestinationSide == PlotDragSide.Top) { foreach (PlotLayoutBlockGroup item in plotLayoutDataView2.StackingGroup.Items) { if (item.Object.DockOrder > plotLayoutDataView2.DockOrder) { item.Object.DockOrder++; } } plotLayoutDataView.DockOrder = plotLayoutDataView2.DockOrder + 1; } else { foreach (PlotLayoutBlockGroup item2 in plotLayoutDataView2.StackingGroup.Items) { if (item2.Object.DockOrder < plotLayoutDataView2.DockOrder) { item2.Object.DockOrder--; } } plotLayoutDataView.DockOrder = plotLayoutDataView2.DockOrder - 1; } } }
public void PerformDataViewBoundsCalculations() { int num = this.DataViewReferenceBottomScreen; int num2 = this.DataViewReferenceBottomLayout; for (int i = 0; i < this.Items.Count; i++) { PlotLayoutBlockGroup plotLayoutBlockGroup = this.Items[i]; PlotLayoutDataView plotLayoutDataView = plotLayoutBlockGroup.Object as PlotLayoutDataView; if (plotLayoutDataView != null) { if (num2 != this.DataViewReferenceBottomLayout) { num2 -= plotLayoutBlockGroup.DepthBottomLayout; } int num3 = num2 - plotLayoutBlockGroup.DataViewHeightLayout; plotLayoutBlockGroup.InnerRectangleLayout = Rectangle.FromLTRB(this.DataViewReferenceLeftLayout, num3, this.DataViewReferenceRightLayout, num2); plotLayoutBlockGroup.BoundsLayout = Rectangle.FromLTRB(this.DataViewReferenceLeftLayout - plotLayoutBlockGroup.DepthLeftLayout, num3 - plotLayoutBlockGroup.DepthTopLayout, this.DataViewReferenceRightLayout + plotLayoutBlockGroup.DepthRightLayout, num2 + plotLayoutBlockGroup.DepthBottomLayout); num2 = num3 - plotLayoutBlockGroup.DepthTopLayout; if (plotLayoutDataView.Visible) { if (num != this.DataViewReferenceBottomScreen) { num -= plotLayoutBlockGroup.DepthBottomScreen; } int num4 = num - plotLayoutBlockGroup.DataViewHeightScreen; plotLayoutBlockGroup.InnerRectangleScreen = Rectangle.FromLTRB(this.DataViewReferenceLeftScreen, num4, this.DataViewReferenceRightScreen, num); plotLayoutBlockGroup.BoundsScreen = Rectangle.FromLTRB(this.DataViewReferenceLeftScreen - plotLayoutBlockGroup.DepthLeftScreen, num4 - plotLayoutBlockGroup.DepthTopScreen, this.DataViewReferenceRightScreen + plotLayoutBlockGroup.DepthRightScreen, num + plotLayoutBlockGroup.DepthBottomScreen); num = num4 - plotLayoutBlockGroup.DepthTopScreen; } } } }
public void TransferBoundsToLayoutObjects() { PlotLayoutDataView plotLayoutDataView = base.Object as PlotLayoutDataView; plotLayoutDataView.Bounds = base.BoundsScreen; plotLayoutDataView.BoundsClip = this.InnerRectangleScreen; }
public void CompleteDrag() { if (this.Visible) { PlotLayoutAxis plotLayoutAxis = this.Source.Object as PlotLayoutAxis; PlotLayoutAxis plotLayoutAxis2 = this.Destination.Object as PlotLayoutAxis; PlotLayoutDockableAll plotLayoutDockableAll = this.Source.Object as PlotLayoutDockableAll; PlotLayoutDockableAll plotLayoutDockableAll2 = this.Destination.Object as PlotLayoutDockableAll; PlotLayoutDockableDataView plotLayoutDockableDataView = this.Source.Object as PlotLayoutDockableDataView; PlotLayoutDockableDataView plotLayoutDockableDataView2 = this.Destination.Object as PlotLayoutDockableDataView; PlotLayoutDataView plotLayoutDataView = this.Source.Object as PlotLayoutDataView; PlotLayoutDataView plotLayoutDataView2 = this.Destination.Object as PlotLayoutDataView; if (plotLayoutDataView != null && plotLayoutDataView2 != null) { this.DropDataViewOnDataView(); } else if (plotLayoutDockableDataView != null) { if (plotLayoutDockableDataView != null && plotLayoutDockableDataView2 != null) { this.DropDockableAllOnDockableAll(); } else if (plotLayoutDockableDataView != null && plotLayoutDataView2 != null) { this.DropDockableDataViewOnDataView(); } else if (plotLayoutDockableAll != null && this.Destination.Object == null) { this.DropDockableAllOnPlotDockGroup(); } if (plotLayoutAxis != null && plotLayoutAxis2 != null) { plotLayoutAxis.DockStyle = plotLayoutAxis2.DockStyle; } else if (plotLayoutDockableAll != null && plotLayoutDockableAll2 != null) { plotLayoutDockableAll.DockStyle = plotLayoutDockableAll2.DockStyle; } else if (plotLayoutDockableAll != null && plotLayoutAxis2 != null) { plotLayoutDockableAll.DockStyle = PlotDockStyleAll.DataView; } else if (plotLayoutDockableAll != null && plotLayoutDataView2 != null) { plotLayoutDockableAll.DockStyle = PlotDockStyleAll.DataView; } else if (plotLayoutAxis != null && plotLayoutDataView2 != null) { plotLayoutAxis.DockStyle = PlotDockStyleAxis.DataView; } else if (plotLayoutDockableAll != null && this.Destination.Object == null) { plotLayoutDockableAll.DockStyle = PlotDockStyleAll.Plot; } } (this.m_ControlBase as PlotLayoutViewer).MakeDirty(); } }
public void Add(PlotLayoutBlockGroup value) { if (value.Object is PlotLayoutDataView) { PlotLayoutDataView plotLayoutDataView = value.Object as PlotLayoutDataView; this.Items.Add(value); plotLayoutDataView.StackingGroup = this; } }
private PlotLayoutBlockGroup GetBlockGroup(PlotLayoutDataView dataView) { foreach (PlotLayoutBlockGroup dataViewGroup in this.DataViewGroups) { if (dataViewGroup.Object == dataView) { return(dataViewGroup); } } return(null); }
public PlotLayoutStackingGroup GetStackingGroup(PlotLayoutDataView dataView) { foreach (PlotLayoutStackingGroup item in this) { if (item.Index == dataView.StackingGroupIndex) { return(item); } } return(null); }
public void PerformDataViewHeightCalculations() { int num = this.DataViewReferenceBottomScreen - this.DataViewReferenceTopScreen - this.TotalInnerDepthHeightScreen; int num2 = this.DataViewReferenceBottomLayout - this.DataViewReferenceTopLayout - this.TotalInnerDepthHeightLayout; foreach (PlotLayoutBlockGroup item in this.Items) { PlotLayoutDataView plotLayoutDataView = item.Object as PlotLayoutDataView; if (plotLayoutDataView != null) { double num3 = (this.TotalDockDepthRatioScreen == 0.0) ? ((this.DataViewVisibleCount == 0) ? 0.0 : (1.0 / (double)this.DataViewVisibleCount)) : (plotLayoutDataView.DockDepthRatio / this.TotalDockDepthRatioScreen); double num4 = (this.TotalDockDepthRatioLayout == 0.0) ? (1.0 / (double)this.Items.Count) : (plotLayoutDataView.DockDepthRatio / this.TotalDockDepthRatioLayout); if (plotLayoutDataView.Visible) { item.DataViewHeightScreen = (int)((double)num * num3); } item.DataViewHeightLayout = (int)((double)num2 * num4); } } }
public void DropDockableDataViewOnDataView() { PlotLayoutDockableDataView plotLayoutDockableDataView = this.Source.Object as PlotLayoutDockableDataView; PlotLayoutDataView plotLayoutDataView = this.Destination.Object as PlotLayoutDataView; int dockOrder = plotLayoutDockableDataView.DockOrder; plotLayoutDockableDataView.DockDataViewName = plotLayoutDataView.Name; if (this.DestinationSide == PlotDragSide.Left) { plotLayoutDockableDataView.DockSide = AlignmentQuadSide.Left; } else if (this.DestinationSide == PlotDragSide.Right) { plotLayoutDockableDataView.DockSide = AlignmentQuadSide.Right; } else if (this.DestinationSide == PlotDragSide.Top) { plotLayoutDockableDataView.DockSide = AlignmentQuadSide.Top; } else if (this.DestinationSide == PlotDragSide.Bottom) { plotLayoutDockableDataView.DockSide = AlignmentQuadSide.Bottom; } this.Source.List.Remove(this.Source); this.FixupStacking(this.Source.List, dockOrder); if (this.Destination.List != null) { if (this.Destination.List.Count != 0) { plotLayoutDockableDataView.DockOrder = this.Destination.List[0].Object.DockOrder - 1; } else { plotLayoutDockableDataView.DockOrder = 0; } plotLayoutDockableDataView.DockPercentStart = 0.0; plotLayoutDockableDataView.DockPercentStop = 1.0; } }
public void Calculate() { this.MaxDepthLeftScreen = 0; this.MaxDepthLeftLayout = 0; this.MaxDepthRightScreen = 0; this.MaxDepthRightLayout = 0; this.MaxDepthTopScreen = 0; this.MaxDepthTopLayout = 0; this.MaxDepthBottomScreen = 0; this.MaxDepthBottomLayout = 0; this.TotalDepthHeightScreen = 0; this.TotalDepthHeightLayout = 0; this.TotalInnerDepthHeightScreen = 0; this.TotalInnerDepthHeightLayout = 0; this.TotalDockDepthRatioScreen = 0.0; this.TotalDockDepthRatioLayout = 0.0; PlotLayoutBlockGroup plotLayoutBlockGroup = null; PlotLayoutBlockGroup plotLayoutBlockGroup2 = null; this.DataViewVisibleCount = 0; for (int i = 0; i < this.Items.Count; i++) { PlotLayoutBlockGroup plotLayoutBlockGroup3 = this.Items[i]; PlotLayoutDataView plotLayoutDataView = plotLayoutBlockGroup3.Object as PlotLayoutDataView; if (plotLayoutDataView != null) { this.TotalDockDepthRatioLayout += plotLayoutDataView.DockDepthRatio; this.MaxDepthLeftLayout = Math.Max(this.MaxDepthLeftLayout, plotLayoutBlockGroup3.DepthLeftLayout); this.MaxDepthRightLayout = Math.Max(this.MaxDepthRightLayout, plotLayoutBlockGroup3.DepthRightLayout); this.TotalDepthHeightLayout += plotLayoutBlockGroup3.DepthHeightLayout; if (plotLayoutDataView.Visible) { this.TotalDockDepthRatioScreen += plotLayoutDataView.DockDepthRatio; if (plotLayoutBlockGroup == null) { plotLayoutBlockGroup = plotLayoutBlockGroup3; } plotLayoutBlockGroup2 = plotLayoutBlockGroup3; this.MaxDepthLeftScreen = Math.Max(this.MaxDepthLeftScreen, plotLayoutBlockGroup3.DepthLeftScreen); this.MaxDepthRightScreen = Math.Max(this.MaxDepthRightScreen, plotLayoutBlockGroup3.DepthRightScreen); this.TotalDepthHeightScreen += plotLayoutBlockGroup3.DepthHeightScreen; this.DataViewVisibleCount++; } } } if (plotLayoutBlockGroup != null) { this.MaxDepthBottomScreen = plotLayoutBlockGroup.DepthBottomScreen; } if (plotLayoutBlockGroup2 != null) { this.MaxDepthTopScreen = plotLayoutBlockGroup2.DepthTopScreen; } if (this.Items.Count != 0) { this.MaxDepthBottomLayout = this.Items[0].DepthBottomLayout; this.MaxDepthTopLayout = this.Items[this.Items.Count - 1].DepthTopLayout; } if (this.DataViewVisibleCount >= 2) { for (int j = 0; j < this.Items.Count; j++) { PlotLayoutBlockGroup plotLayoutBlockGroup3 = this.Items[j]; PlotLayoutDataView plotLayoutDataView = plotLayoutBlockGroup3.Object as PlotLayoutDataView; if (plotLayoutDataView.Visible) { if (plotLayoutBlockGroup3 == plotLayoutBlockGroup) { this.TotalInnerDepthHeightScreen += plotLayoutBlockGroup3.DepthTopScreen; } else if (plotLayoutBlockGroup3 == plotLayoutBlockGroup2) { this.TotalInnerDepthHeightScreen += plotLayoutBlockGroup3.DepthBottomScreen; } else { this.TotalInnerDepthHeightScreen += plotLayoutBlockGroup3.DepthHeightScreen; } } } } if (this.Items.Count >= 2) { for (int k = 0; k < this.Items.Count; k++) { PlotLayoutBlockGroup plotLayoutBlockGroup3 = this.Items[k]; PlotLayoutDataView plotLayoutDataView = plotLayoutBlockGroup3.Object as PlotLayoutDataView; if (k == 0) { this.TotalInnerDepthHeightLayout += plotLayoutBlockGroup3.DepthTopLayout; } else if (k == this.Items.Count - 1) { this.TotalInnerDepthHeightLayout += plotLayoutBlockGroup3.DepthBottomLayout; } else { this.TotalInnerDepthHeightLayout += plotLayoutBlockGroup3.DepthHeightLayout; } } } }