Class MasterPane
A collection class containing a list of GraphPane objects organized together in some form.
Inherited Members
Namespace: ZedGraph
Assembly: ZedGraph.dll
Syntax
[Serializable]
public class MasterPane : PaneBase, ICloneable, ISerializable, IDeserializationCallback
Constructors
| Improve this Doc View SourceMasterPane()
Default constructor for the class. Sets the Rect to (0, 0, 500, 375).
Declaration
public MasterPane()
MasterPane(SerializationInfo, StreamingContext)
Constructor for deserializing objects
Declaration
protected MasterPane(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | A SerializationInfo instance that defines the serialized data |
StreamingContext | context | A StreamingContext instance that contains the serialized data |
MasterPane(String, RectangleF)
Default constructor for the class. Specifies the Title of the MasterPane, and the size of the Rect.
Declaration
public MasterPane(string title, RectangleF paneRect)
Parameters
Type | Name | Description |
---|---|---|
String | title | |
RectangleF | paneRect |
MasterPane(MasterPane)
The Copy Constructor - Make a deep-copy clone of this class instance.
Declaration
public MasterPane(MasterPane rhs)
Parameters
Type | Name | Description |
---|---|---|
MasterPane | rhs | The MasterPane object from which to copy |
Fields
| Improve this Doc View Sourceschema2
Current schema value that defines the version of the serialized file
Declaration
public const int schema2 = 11
Field Value
Type | Description |
---|---|
Int32 |
Properties
| Improve this Doc View SourceInnerPaneGap
Gets or sets the size of the margin between adjacent GraphPane objects.
Declaration
public float InnerPaneGap { get; set; }
Property Value
Type | Description |
---|---|
Single | The value is in points (1/72nd inch). |
Remarks
This property is scaled according to CalcScaleFactor(), based on BaseDimension. The default value comes from InnerPaneGap.
IsAntiAlias
Gets or sets a value that determines if all drawing operations for this MasterPane will be forced to operate in Anti-alias mode. Note that if this value is set to "true", it overrides the setting for sub-objects. Otherwise, the sub-object settings (such as IsAntiAlias) will be honored.
Declaration
public bool IsAntiAlias { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
IsCommonScaleFactor
Gets or sets a value that determines if the DoLayout(Graphics) method will automatically set the BaseDimension of each GraphPane in the PaneList such that the scale factors have the same value.
Declaration
public bool IsCommonScaleFactor { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
The scale factors, calculated by CalcScaleFactor(), determine scaled font sizes, tic lengths, etc. This function will insure that for multiple graphpanes, a certain specified font size will be the same for all the panes.
See Also
IsUniformLegendEntries
Gets or set the value of the IsUniformLegendEntries
Declaration
public bool IsUniformLegendEntries { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Item[Int32]
Declaration
public GraphPane this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The ordinal position (zero-based) of the GraphPane object to be accessed. |
Property Value
Type | Description |
---|---|
GraphPane | A GraphPane object reference. |
Item[String]
Declaration
public GraphPane this[string title] { get; }
Parameters
Type | Name | Description |
---|---|---|
String | title | The string title of the GraphPane object to be accessed. |
Property Value
Type | Description |
---|---|
GraphPane | A GraphPane object reference. |
PaneList
Gets or sets the PaneList collection instance that holds the list of GraphPane objects that are included in this MasterPane.
Declaration
public PaneList PaneList { get; set; }
Property Value
Type | Description |
---|---|
PaneList |
See Also
Methods
| Improve this Doc View SourceAdd(GraphPane)
Declaration
public void Add(GraphPane pane)
Parameters
Type | Name | Description |
---|---|---|
GraphPane | pane | A reference to the GraphPane object to be added |
See Also
| Improve this Doc View SourceAxisChange()
Call AxisChange() for all GraphPane objects in the PaneList list.
Declaration
public void AxisChange()
Remarks
This overload of AxisChange just uses a throw-away bitmap as Graphics. If you have a Graphics instance available from your Windows Form, you should use the AxisChange(Graphics) overload instead.
AxisChange(Graphics)
Call AxisChange() for all GraphPane objects in the PaneList list.
Declaration
public void AxisChange(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Clone()
Typesafe, deep-copy clone method.
Declaration
public MasterPane Clone()
Returns
Type | Description |
---|---|
MasterPane | A new, independent copy of this class |
CommonScaleFactor()
Method that forces the scale factor calculations (via CalcScaleFactor()), to give a common scale factor for all GraphPane objects in the PaneList.
Declaration
public void CommonScaleFactor()
Remarks
This will make it such that a given font size will result in the same output font size for all GraphPane's. Note that this does not make the scale factor for the GraphPane's the same as that of the MasterPane.
See Also
| Improve this Doc View SourceDoLayout(Graphics)
Modify the GraphPane Rect sizes of each GraphPane such that they fit within the MasterPane in a pre-configured layout.
Declaration
public void DoLayout(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g |
Remarks
The SetLayout(Graphics, PaneLayout) method (and overloads) is used for setting the layout configuration.
See Also
Draw(Graphics)
Declaration
public override void Draw(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Overrides
Remarks
This method should be part of the Paint() update process. Calling this routine will redraw all features of all the GraphPane items. No preparation is required other than instantiated GraphPane objects that have been added to the list with the Add(GraphPane) method.
FindChartRect(PointF)
Declaration
public GraphPane FindChartRect(PointF mousePt)
Parameters
Type | Name | Description |
---|---|---|
PointF | mousePt | The mouse point location where you want to search |
Returns
Type | Description |
---|---|
GraphPane | A GraphPane object that contains the mouse point, or null if no GraphPane was found. |
FindNearestPaneObject(PointF, Graphics, out GraphPane, out Object, out Int32)
Find the pane and the object within that pane that lies closest to the specified mouse (screen) point.
Declaration
public bool FindNearestPaneObject(PointF mousePt, Graphics g, out GraphPane pane, out object nearestObj, out int index)
Parameters
Type | Name | Description |
---|---|---|
PointF | mousePt | The screen point, in pixel coordinates. |
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
GraphPane | pane | A reference to the GraphPane object that was clicked. |
Object | nearestObj | A reference to the nearest object to the specified screen point. This can be any of Axis, Legend, Title, TextObj, ArrowObj, or CurveItem. Note: If the pane title is selected, then the GraphPane object will be returned. |
Int32 | index | The index number of the item within the selected object
(where applicable). For example, for a CurveItem object,
|
Returns
Type | Description |
---|---|
Boolean | true if a GraphPane was found, false otherwise. |
Remarks
This method first finds the GraphPane within the list that contains
the specified mouse point. It then calls the FindNearestObject(PointF, Graphics, out Object, out Int32)
method to determine which object, if any, was clicked. With the exception of the
See Also
| Improve this Doc View SourceFindPane(PointF)
Declaration
public GraphPane FindPane(PointF mousePt)
Parameters
Type | Name | Description |
---|---|---|
PointF | mousePt | The mouse point location where you want to search |
Returns
Type | Description |
---|---|
GraphPane | A GraphPane object that contains the mouse point, or null if no GraphPane was found. |
GetObjectData(SerializationInfo, StreamingContext)
Populates a SerializationInfo instance with the data needed to serialize the target object
Declaration
[SecurityPermission(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(SerializationInfo info, StreamingContext context)
Parameters
Type | Name | Description |
---|---|---|
SerializationInfo | info | A SerializationInfo instance that defines the serialized data |
StreamingContext | context | A StreamingContext instance that contains the serialized data |
Overrides
| Improve this Doc View SourceOnDeserialization(Object)
Respond to the callback when the MasterPane objects are fully initialized.
Declaration
public void OnDeserialization(object sender)
Parameters
Type | Name | Description |
---|---|---|
Object | sender |
ReSize(Graphics)
Redo the layout using the current size of the Rect, and also handle resizing the contents by calling DoLayout(Graphics).
Declaration
public void ReSize(Graphics g)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Remarks
This method will use the pane layout that was specified by a call to SetLayout(Graphics, PaneLayout). If SetLayout(Graphics, PaneLayout) has not previously been called, it will default to PaneLayout.
See Also
ReSize(Graphics, RectangleF)
Change the size of the Rect, and also handle resizing the contents by calling DoLayout(Graphics).
Declaration
public override void ReSize(Graphics g, RectangleF rect)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
RectangleF | rect |
Overrides
Remarks
This method will use the pane layout that was specified by a call to SetLayout(Graphics, PaneLayout). If SetLayout(Graphics, PaneLayout) has not previously been called, it will default to PaneLayout.
See Also
SetLayout(Graphics, Boolean, Int32[])
Declaration
public void SetLayout(Graphics g, bool isColumnSpecified, int[] countList)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally created with a call to the CreateGraphics() method of the Control or Form. |
Boolean | isColumnSpecified | Specifies whether the number of columns in each row, or
the number of rows in each column will be specified. A value of true indicates the
number of columns in each row are specified in |
Int32[] | countList | An integer array specifying either the number of columns in
each row or the number of rows in each column, depending on the value of
|
Remarks
This method specifies the number of rows in each column, or the number of columns in each row, allowing for irregular layouts. Overloads are available that provide other layout options.
See Also
SetLayout(Graphics, Boolean, Int32[], Single[])
Declaration
public void SetLayout(Graphics g, bool isColumnSpecified, int[] countList, float[] proportion)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally created with a call to the CreateGraphics() method of the Control or Form. |
Boolean | isColumnSpecified | Specifies whether the number of columns in each row, or
the number of rows in each column will be specified. A value of true indicates the
number of columns in each row are specified in |
Int32[] | countList | An integer array specifying either the number of columns in
each row or the number of rows in each column, depending on the value of
|
Single[] | proportion | An array of float values specifying proportional sizes for each
row or column. Note that these proportions apply to the non-specified dimension -- that is,
if |
Remarks
This method specifies the number of panes in each row or column, allowing for irregular layouts.
See Also
SetLayout(Graphics, Int32, Int32)
Declaration
public void SetLayout(Graphics g, int rows, int columns)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally created with a call to the CreateGraphics() method of the Control or Form. |
Int32 | rows | The number of rows of GraphPane objects to include in the layout |
Int32 | columns | The number of columns of GraphPane objects to include in the layout |
Remarks
This method explicitly specifies the number of rows and columns to use in the layout, and all GraphPane objects will have the same size. Overloads are available that provide other layout options
See Also
SetLayout(Graphics, PaneLayout)
Automatically set all of the GraphPane Rect's in the list to a pre-defined layout configuration from a PaneLayout enumeration.
Declaration
public void SetLayout(Graphics g, PaneLayout paneLayout)
Parameters
Type | Name | Description |
---|---|---|
Graphics | g | A graphic device object to be drawn into. This is normally created with a call to the CreateGraphics() method of the Control or Form. |
PaneLayout | paneLayout | A PaneLayout enumeration that describes how the panes should be laid out within the Rect. |
Remarks
This method uses a PaneLayout enumeration to describe the type of layout to be used. Overloads are available that provide other layout options
See Also
Explicit Interface Implementations
| Improve this Doc View SourceICloneable.Clone()
Implement the ICloneable interface in a typesafe manner by just calling the typed version of Clone() to make a deep copy.
Declaration
object ICloneable.Clone()
Returns
Type | Description |
---|---|
Object | A deep copy of this object |