Class GraphObjList
A collection class containing a list of TextObj objects to be displayed on the graph.
Implements
Inherited Members
Namespace: ZedGraph
Assembly: ZedGraph.dll
Syntax
[Serializable]
public class GraphObjList : List<GraphObj>, IList<GraphObj>, ICollection<GraphObj>, IEnumerable<GraphObj>, IList, ICollection, IEnumerable, ICloneable
Constructors
| Improve this Doc View SourceGraphObjList()
Default constructor for the GraphObjList collection class
Declaration
public GraphObjList()
GraphObjList(GraphObjList)
The Copy Constructor
Declaration
public GraphObjList(GraphObjList rhs)
Parameters
Type | Name | Description |
---|---|---|
GraphObjList | rhs | The GraphObjList object from which to copy |
Properties
| Improve this Doc View SourceItem[String]
Indexer to access the specified GraphObj object by its Tag. Note that the Tag must be a String type for this method to work.
Declaration
public GraphObj this[string tag] { get; }
Parameters
Type | Name | Description |
---|---|---|
String | tag | The String type tag to search for. |
Property Value
Type | Description |
---|---|
GraphObj | A GraphObj object reference. |
See Also
Methods
| Improve this Doc View SourceClone()
Typesafe, deep-copy clone method.
Declaration
public GraphObjList Clone()
Returns
Type | Description |
---|---|
GraphObjList | A new, independent copy of this class |
Draw(Graphics, PaneBase, Single, ZOrder)
Render text to the specified Graphics device by calling the Draw method of each GraphObj object in the collection.
Declaration
public void Draw(Graphics g, PaneBase pane, float scaleFactor, ZOrder zOrder)
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. |
PaneBase | pane | A reference to the PaneBase object that is the parent or owner of this object. |
Single | scaleFactor | The scaling factor to be used for rendering objects. This is calculated and passed down by the parent GraphPane object using the CalcScaleFactor() method, and is used to proportionally adjust font sizes, etc. according to the actual size of the graph. |
ZOrder | zOrder | A ZOrder enumeration that controls the placement of this GraphObj relative to other graphic objects. The order of GraphObj's with the same ZOrder value is control by their order in this GraphObjList. |
Remarks
This method is normally only called by the Draw method of the parent GraphPane object.
FindPoint(PointF, PaneBase, Graphics, Single, out Int32)
Determine if a mouse point is within any GraphObj, and if so, return the index number of the the GraphObj.
Declaration
public bool FindPoint(PointF mousePt, PaneBase pane, Graphics g, float scaleFactor, out int index)
Parameters
Type | Name | Description |
---|---|---|
PointF | mousePt | The screen point, in pixel coordinates. |
PaneBase | pane | A reference to the PaneBase object that is the parent or owner of this object. |
Graphics | g | A graphic device object to be drawn into. This is normally e.Graphics from the PaintEventArgs argument to the Paint() method. |
Single | scaleFactor | The scaling factor to be used for rendering objects. This is calculated and passed down by the parent GraphPane object using the CalcScaleFactor() method, and is used to proportionally adjust font sizes, etc. according to the actual size of the graph. |
Int32 | index | The index number of the TextObj that is under the mouse point. The TextObj object is accessible via the GraphObjList indexer property. |
Returns
Type | Description |
---|---|
Boolean | true if the mouse point is within a GraphObj bounding box, false otherwise. |
See Also
| Improve this Doc View SourceIndexOfTag(String)
Declaration
public int IndexOfTag(string tag)
Parameters
Type | Name | Description |
---|---|---|
String | tag | The String tag that is in the Tag attribute of the item to be found. |
Returns
Type | Description |
---|---|
Int32 | The zero-based index of the specified GraphObj, or -1 if the GraphObj is not in the list |
Remarks
| Improve this Doc View SourceMove(Int32, Int32)
Move the position of the object at the specified index to the new relative position in the list.
Declaration
public int Move(int index, int relativePos)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero-based index of the object to be moved. |
Int32 | relativePos | The relative number of positions to move the object. A value of -1 will move the object one position earlier in the list, a value of 1 will move it one position later. To move an item to the beginning of the list, use a large negative value (such as -999). To move it to the end of the list, use a large positive value. |
Returns
Type | Description |
---|---|
Int32 | The new position for the object, or -1 if the object was not found. |
Remarks
For Graphic type objects, this method controls the Z-Order of the items. Objects at the beginning of the list appear in front of objects at the end of the list.
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()
Declaration
object ICloneable.Clone()
Returns
Type | Description |
---|---|
Object | A deep copy of this object |