這一節主要是講多pane的創建方法。裡面大部分的方法和屬性在以前的章節中已經介紹過了,這裡只 想講三個地方:MasterPane類、ColorSymbolRotator類和ZOrder這個屬性的用法。
首先就是 MasterPane類。這個類就是創建多pane的類,是一個GraPHPane類的集合。它裡面的大部分屬性和方法都 繼承自PaneBase和Object。像.Net一樣,這個類提供了Item和PaneList屬性來設置和獲取裡面的成員。在 程序中我們也看到了,其實MasterPane什麼也沒做,就是把其它的類一項項的Add進它的集合中。
ColorSymbolRotator類就是一個為GraPHPane.AddCurve方法循環提供不同顏色和符號的類。這個 類的東西不多,我個人認為就相當於一個枚舉一樣,我們可以看到程序中只用到了rotator.NextColor rotator.NextSymbol這兩個屬性,來獲取不同的顏色和符號。
最後就是Zorder這個屬性了,在前 面的幾節中我們也見過這個屬性,可是當時我沒有講,現在我說說。Zorder就是圖形在Z軸的位置。如果 我們在平面上把左右看成X軸,把上下看成Y軸,那麼內外就是Z軸了,也就是Zorder就是圖形在內外的位 置(這個內外是針對其它圖形來說的)。我們可以看看示圖中的DRAFT這個水印的效果,這就是Zorder的功 能。如果你把程序中的
text.ZOrder = ZOrder.A_InFront;改成text.ZOrder = ZOrder.G_BehindAll;
那麼DRAFT就是如下的效果了,DRAFT就在各個Pane的下面了。
Zorder是一個枚舉共有七個枚舉值。分別是G_BehindAll、F_BehindAxisFill、E_BehindAxis、 D_BehindCurves、C_BehindAxisBorder、B_BehindLegend和A_InFront。具體的解釋如
Member NameDescription
G_BehindAll SpecifIEs that the GraphItem will be behind all other objects (including the PaneBaseTitle). F_BehindAxisFill SpecifIEs that the GraphItem will be behind the AxisRect background Fill (see AxisFill). E_BehindAxis SpecifIEs that the GraphItem will be behind the Axis objects. D_BehindCurves SpecifIEs that the GraphItem will be behind the CurveItem objects. C_BehindAxisBorder SpecifIEs that the GraphItem will be behind the Axis border. B_BehindLegend SpecifIEs that the GraphItem will be behind the Legend object. A_InFront SpecifIEs that the GraphItem will be in front of all other objects, except for the other GraphItem objects that have the same ZOrder and are before this object in the GraphItemList.Member Name
Description
G_BehindAll SpecifIEs that the GraphItem will be behind all other objects (including the PaneBaseTitle). F_BehindAxisFill SpecifIEs that the GraphItem will be behind the AxisRect background Fill (see AxisFill). E_BehindAxis SpecifIEs that the GraphItem will be behind the Axis objects. D_BehindCurves SpecifIEs that the GraphItem will be behind the CurveItem objects. C_BehindAxisBorder SpecifIEs that the GraphItem will be behind the Axis border. B_BehindLegend SpecifIEs that the GraphItem will be behind the Legend object. A_InFront SpecifIEs that the GraphItem will be in front of all other objects, except for the other GraphItem objects that have the same ZOrder and are before this object in the GraphItemList.