/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the FontChangedEventArgs class. /// </summary> /// <param name="newFont">The newly created <see cref="Font"/></param> /// <param name="newColor">The <see cref="Color"/> for the newly created font.</param> /// <param name="newAlignment">The <see cref="VGAlignment"/> for the newly created font.</param> /// <param name="newGroup">vector graphics /// group to which the new font should be applied.</param> public FontChangedEventArgs(Font newFont, Color newColor, VGAlignment newAlignment, VGStyleGroup newGroup) { this.font = newFont; this.fontColor = newColor; this.fontAlignment = newAlignment; this.elementGroup = newGroup; }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGRichText class. /// </summary> /// <param name="newShapeDrawAction"><see cref="ShapeDrawAction"/> for the bounds.</param> /// <param name="newRtf">string to display</param> /// <param name="newTransparency">A flag indicating a transparent background if true.</param> /// <param name="newPen">Pen to use</param> /// <param name="newBrush">Brush for drawing</param> /// <param name="newFont">Font for drawing name</param> /// <param name="newFontColor">Font color for drawing name.</param> /// <param name="position">TopLeft text position</param> /// <param name="size">Size of the clipping rectangle.</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRichText( ShapeDrawAction newShapeDrawAction, string newRtf, bool newTransparency, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, PointF position, SizeF size, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, new RectangleF(position, size), newStyleGroup, newName, newElementGroup, null) { this.RebuildUnderlyingRichTextBox(); this.richTextBox.Rtf = newRtf; this.textLength = this.richTextBox.TextLength; }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGBrowser class. /// </summary> /// <param name="newShapeDrawAction"><see cref="ShapeDrawAction"/> for the bounds.</param> /// <param name="newBrowserURL"><see cref="Uri"/> for the browser start location</param> /// <param name="newBrowseDepth">The number of links the user is allowed to follow, /// including backward links.</param> /// <param name="newPen">Pen to use</param> /// <param name="newBrush">Brush for drawing</param> /// <param name="newFont">Font for drawing name</param> /// <param name="newFontColor">Font color for drawing name.</param> /// <param name="position">TopLeft text position</param> /// <param name="size">Size of the clipping rectangle.</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGBrowser( ShapeDrawAction newShapeDrawAction, string newBrowserURL, int newBrowseDepth, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, PointF position, SizeF size, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, new RectangleF(position, size), newStyleGroup, newName, newElementGroup, null) { this.InitializeFields(); this.BrowserURL = newBrowserURL; this.BrowseDepth = newBrowseDepth; }
/// <summary> /// Initializes a new instance of the VGRegion class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRegion( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, newBounds, newStyleGroup, newName, newElementGroup, null) { this.region = new Region(); this.region.MakeEmpty(); this.region.Union(newBounds); }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGFlash class. /// </summary> /// <param name="newShapeDrawAction"><see cref="ShapeDrawAction"/> for the bounds.</param> /// <param name="newFilename">Filename of the flash movie without path</param> /// <param name="newPath">Path to the flash movie.</param> /// <param name="newPen">Pen to use</param> /// <param name="newBrush">Brush for drawing</param> /// <param name="newFont">Font for drawing name</param> /// <param name="newFontColor">Font color for drawing name.</param> /// <param name="position">TopLeft text position</param> /// <param name="size">Size of the clipping rectangle.</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGFlash( ShapeDrawAction newShapeDrawAction, string newFilename, string newPath, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, PointF position, SizeF size, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, new RectangleF(position, size), newStyleGroup, newName, newElementGroup, null) { this.IntializeFields(); this.Filepath = newPath; this.Filename = newFilename; }
/////////////////////////////////////////////////////////////////////////////// // Defining Constants // /////////////////////////////////////////////////////////////////////////////// #region CONSTANTS #endregion //CONSTANTS /////////////////////////////////////////////////////////////////////////////// // Defining Variables, Enumerations, Events // /////////////////////////////////////////////////////////////////////////////// #region FIELDS #endregion //FIELDS /////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGScrollImage class. /// When newShapeDrawAction is set to None, only the image will /// be drawn, with Edge an additional border is drawn, /// with fill an additional (hopefully transparent) fill is drawn over the image. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both, None</param> /// <param name="newPen">Pen for additional borderline.</param> /// <param name="newBrush">Brush for additional fills.</param> /// <param name="newFont">Font for drawing name</param> /// <param name="newFontColor">Font color for drawing name.</param> /// <param name="newImageFile">filename without path</param> /// <param name="newPath">path to image file</param> /// <param name="newLayout"><see cref="ImageLayout"/> of the image</param> /// <param name="newAlpha">The transparency alpha for this image.0=transparent,1=opaque</param> /// <param name="newCanvas"><see cref="Size"/> of the owning original canvas</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGScrollImage( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, string newImageFile, string newPath, ImageLayout newLayout, float newAlpha, Size newCanvas, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, newImageFile, newPath, newLayout, newAlpha, newCanvas, newStyleGroup, newName, newElementGroup, false) { }
/// <summary> /// Initializes a new instance of the VGEllipse class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGEllipse( ShapeDrawAction newShapeDrawAction, Brush newBrush, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newBrush, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGPolyline class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGPolyline( ShapeDrawAction newShapeDrawAction, Pen newPen, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.Path = new GraphicsPath(); }
/// <summary> /// Initializes a new instance of the VGEllipse class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGEllipse( ShapeDrawAction newShapeDrawAction, Pen newPen, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newBounds, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGSharp class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGSharp( ShapeDrawAction newShapeDrawAction, Pen newPen, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newBounds, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGRectangle class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRectangle( ShapeDrawAction newShapeDrawAction, Pen newPen, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.Bounds = Rectangle.Empty; }
/// <summary> /// Initializes a new instance of the VGRectangle class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRectangle( ShapeDrawAction newShapeDrawAction, Brush newBrush, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newBrush, newBounds, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGRegion class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRegion( ShapeDrawAction newShapeDrawAction, Brush newBrush, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newBrush, newStyleGroup, newName, newElementGroup) { this.region = new Region(); this.region.MakeEmpty(); }
/// <summary> /// Initializes a new instance of the VGCursor class. /// </summary> /// <param name="newPen">A <see cref="Pen"/> for the edges.</param> /// <param name="newBrush">A <see cref="Brush"/> for the fills.<remarks>Currently used only for Mouse button fills.</remarks></param> /// <param name="newCursorType">A <see cref="DrawingCursors"/> to define the type of the cursor.</param> /// <param name="newSize">A <see cref="float"/> with the cursors size</param> /// <param name="newStyleGroup">A <see cref="VGStyleGroup"/> with the elements category</param> public VGCursor( Pen newPen, Brush newBrush, DrawingCursors newCursorType, float newSize, VGStyleGroup newStyleGroup) : base(ShapeDrawAction.Edge, newPen, newBrush, newStyleGroup, string.Empty, string.Empty) { this.Bounds = new RectangleF(0, 0, newSize, newSize); this.cursorType = newCursorType; }
/// <summary> /// Initializes a new instance of the VGSharp class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGSharp( ShapeDrawAction newShapeDrawAction, Pen newPen, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newFont, newFontColor, newBounds, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGEllipse class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGEllipse( ShapeDrawAction newShapeDrawAction, Brush newBrush, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newBrush, newFont, newFontColor, newBounds, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGLine class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGLine( ShapeDrawAction newShapeDrawAction, Pen newPen, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.Bounds = Rectangle.Empty; this.firstPoint = PointF.Empty; this.secondPoint = PointF.Empty; }
/// <summary> /// Initializes a new instance of the VGRegion class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRegion( ShapeDrawAction newShapeDrawAction, Pen newPen, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newBounds, newStyleGroup, newName, newElementGroup) { this.region = new Region(); this.region.MakeEmpty(); this.region.Union(newBounds); }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGRegion class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGRegion( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newBrush, newBounds, newStyleGroup, newName, newElementGroup) { this.region = new Region(); this.region.MakeEmpty(); this.region.Union(newBounds); }
/// <summary> /// Searches the collection list for all members with /// the given group and returns this items in a new /// <see cref="VGElementCollection"/> /// </summary> /// <param name="searchGroup">The <see cref="VGStyleGroup"/> /// that the elements should match.</param> /// <returns>A <see cref="VGElementCollection"/> with the /// members of the list that are in the given search group.</returns> public VGElementCollection FindAllGroupMembers(VGStyleGroup searchGroup) { VGElementCollection subList = new VGElementCollection(); foreach (VGElement element in this.List) { if ((element.StyleGroup & searchGroup) == searchGroup) { subList.Add(element); } } return(subList); }
/// <summary> /// Initializes a new instance of the VGLine class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="pt1">first point</param> /// <param name="pt2">second point</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGLine( ShapeDrawAction newShapeDrawAction, Pen newPen, PointF pt1, PointF pt2, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.firstPoint = pt1; this.secondPoint = pt2; this.Bounds = this.GetBounds(); this.pointsAreSet = true; }
/// <summary> /// Initializes a new instance of the VGArrow class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGArrow( ShapeDrawAction newShapeDrawAction, Pen newPen, Font newFont, Color newFontColor, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newFont, newFontColor, newStyleGroup, newName, newElementGroup) { this.InitializeDefaults(); this.Bounds = Rectangle.Empty; this.firstPoint = PointF.Empty; this.secondPoint = PointF.Empty; }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGImage class. /// When newShapeDrawAction is set to None, only the image will /// be drawn, with Edge an additional border is drawn, /// with fill an additional (hopefully transparent) fill is drawn over the image. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both, None</param> /// <param name="newPen">Pen for additional borderline.</param> /// <param name="newBrush">Brush for additional fills.</param> /// <param name="newFont">Font for drawing name</param> /// <param name="newFontColor">Font color for drawing name.</param> /// <param name="newImageFile">filename without path</param> /// <param name="newPath">path to image file</param> /// <param name="newLayout"><see cref="ImageLayout"/> of the image</param> /// <param name="newAlpha">The transparency alpha for this image.0=transparent,1=opaque</param> /// <param name="newCanvas"><see cref="Size"/> of the owning original canvas</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> /// <param name="withoutImageInMemoryCreation">Omits internal image creation during /// construction.</param> public VGImage( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, string newImageFile, string newPath, ImageLayout newLayout, float newAlpha, Size newCanvas, VGStyleGroup newStyleGroup, string newName, string newElementGroup, bool withoutImageInMemoryCreation) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, RectangleF.Empty, newStyleGroup, newName, newElementGroup, null) { this.filename = newImageFile; this.Filepath = newPath; this.canvas = newCanvas; this.alpha = newAlpha; if (!withoutImageInMemoryCreation) { if (!this.CreateInternalImage()) { return; } var unit = new GraphicsUnit(); this.Bounds = this.Image.GetBounds(ref unit); } this.layout = newLayout; this.InitTransparencyMatrix(); }
/// <summary> /// Initializes a new instance of the VGPolyline class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="pts">Point list that constitutes polyline</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGPolyline( ShapeDrawAction newShapeDrawAction, Pen newPen, PointF[] pts, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.Path = new GraphicsPath(); if (pts.Length >= 2) { this.Path.AddLines(pts); } else if (pts.Length == 1) { this.FirstPt = pts[0]; } }
/// <summary> /// Initializes a new instance of the VGPolyline class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGPolyline( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, RectangleF.Empty, newStyleGroup, newName, newElementGroup, null) { this.Path = new GraphicsPath(); }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the VGText class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newText">string to display</param> /// <param name="newFont">Font to use for the text</param> /// <param name="newFontColor">Color for the text</param> /// <param name="newAlignment">The <see cref="HorizontalAlignment"/> for the text.</param> /// <param name="newLineSpacing">The <see cref="float"/> with the new line spacing for the text.</param> /// <param name="newPadding">The <see cref="float"/> with the new text padding.</param> /// <param name="newPen">Pen for bounds</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newNameFont">Font for name</param> /// <param name="newNameFontColor">Color for name</param> /// <param name="newBounds">Bounds of element</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> /// <param name="newSound">Audio contents of Element</param> public VGText( ShapeDrawAction newShapeDrawAction, string newText, Font newFont, Color newFontColor, HorizontalAlignment newAlignment, float newLineSpacing, float newPadding, Pen newPen, Brush newBrush, Font newNameFont, Color newNameFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup, AudioFile newSound) : base( newShapeDrawAction, newPen, newBrush, newNameFont, newNameFontColor, newBounds, newStyleGroup, newName, newElementGroup, newSound) { this.textFontColor = newFontColor; this.textAlignment = newAlignment; this.text = newText; this.textFont = newFont; this.LineSpacing = newLineSpacing != 0 ? newLineSpacing : 1.0f; this.Padding = newPadding; }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the BrushChangedEventArgs class. /// </summary> /// <param name="newBrush">The newly created <see cref="Brush"/>.</param> /// <param name="newGroup">vector graphics /// group to which the new brush should be applied.</param> public BrushChangedEventArgs(Brush newBrush, VGStyleGroup newGroup) { this.brush = newBrush; this.brushGroup = newGroup; }
/// <summary> /// Initializes a new instance of the VGEllipse class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGEllipse( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base( newShapeDrawAction, newPen, newBrush, newFont, newFontColor, newBounds, newStyleGroup, newName, newElementGroup, null) { }
/// <summary> /// Initializes a new instance of the VGEllipse class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for fills</param> /// <param name="newBounds">bounding rectangle</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGEllipse( ShapeDrawAction newShapeDrawAction, Brush newBrush, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newBrush, newBounds, newStyleGroup, newName, newElementGroup) { }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBounds">Bounds of element</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGElement( ShapeDrawAction newShapeDrawAction, Pen newPen, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) { this.InitStandards(); this.styleGroup = newStyleGroup; this.name = newName; this.elementGroup = newElementGroup; this.shapeDrawAction = newShapeDrawAction; this.pen = newPen == null ? null : (Pen)newPen.Clone(); this.Bounds = newBounds; }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for text and fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">Bounds of element</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGElement( ShapeDrawAction newShapeDrawAction, Brush newBrush, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup) { this.InitStandards(); this.styleGroup = newStyleGroup; this.name = newName; this.elementGroup = newElementGroup; this.shapeDrawAction = newShapeDrawAction; this.Brush = newBrush == null ? null : (Brush)newBrush.Clone(); this.Font = newFont == null ? null : (Font)newFont.Clone(); this.FontColor = newFontColor; this.Bounds = newBounds; }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newBrush">Brush for text and fills</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGElement( ShapeDrawAction newShapeDrawAction, Brush newBrush, VGStyleGroup newStyleGroup, string newName, string newElementGroup) { this.InitStandards(); this.styleGroup = newStyleGroup; this.name = newName; this.elementGroup = newElementGroup; this.shapeDrawAction = newShapeDrawAction; this.Brush = newBrush == null ? null : (Brush)newBrush.Clone(); }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGElement( ShapeDrawAction newShapeDrawAction, Pen newPen, Font newFont, Color newFontColor, VGStyleGroup newStyleGroup, string newName, string newElementGroup) { this.InitStandards(); this.styleGroup = newStyleGroup; this.name = newName; this.elementGroup = newElementGroup; this.Font = newFont == null ? null : (Font)newFont.Clone(); this.FontColor = newFontColor; this.shapeDrawAction = newShapeDrawAction; this.pen = newPen == null ? null : (Pen)newPen.Clone(); }
/// <summary> /// Initializes a new instance of the VGElement class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newBrush">Brush for text and fills</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newBounds">Bounds of element</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> /// <param name="newSound">The <see cref="AudioFile"/> to play with this element.</param> public VGElement( ShapeDrawAction newShapeDrawAction, Pen newPen, Brush newBrush, Font newFont, Color newFontColor, RectangleF newBounds, VGStyleGroup newStyleGroup, string newName, string newElementGroup, AudioFile newSound) { this.InitStandards(); this.pen = newPen == null ? null : (Pen)newPen.Clone(); this.Brush = newBrush == null ? null : (Brush)newBrush.Clone(); this.Bounds = newBounds; this.styleGroup = newStyleGroup; this.name = newName; this.elementGroup = newElementGroup; this.Font = newFont == null ? null : (Font)newFont.Clone(); this.FontColor = newFontColor; this.shapeDrawAction = newShapeDrawAction; if (newSound != null) { this.Sound = (AudioFile)newSound.Clone(); } }
/// <summary> /// Initializes a new instance of the VGEllipse class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGEllipse( ShapeDrawAction newShapeDrawAction, Pen newPen, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { }
/////////////////////////////////////////////////////////////////////////////// // Construction and Initializing methods // /////////////////////////////////////////////////////////////////////////////// #region CONSTRUCTION /// <summary> /// Initializes a new instance of the PenChangedEventArgs class. /// </summary> /// <param name="newPen">This is the new created pen.</param> /// <param name="newGroup">vector graphics /// group to which the new pen should be applied.</param> public PenChangedEventArgs(Pen newPen, VGStyleGroup newGroup) { this.pen = newPen; this.penGroup = newGroup; }
/// <summary> /// Initializes a new instance of the VGArrow class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGArrow( ShapeDrawAction newShapeDrawAction, Pen newPen, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.InitializeDefaults(); this.Bounds = Rectangle.Empty; this.firstPoint = PointF.Empty; this.secondPoint = PointF.Empty; }
/// <summary> /// Initializes a new instance of the VGSharp class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGSharp( ShapeDrawAction newShapeDrawAction, Pen newPen, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newStyleGroup, newName, newElementGroup) { this.Bounds = Rectangle.Empty; }
/// <summary> /// This method updates the style of the elements from the given <see cref="VGStyleGroup"/> /// with the new value and updates the pictures styles. /// </summary> /// <param name="vGStyleGroup"> /// The <see cref="VGStyleGroup"/> whichs style should /// be changed /// </param> /// <param name="e"> /// The <see cref="ShapePropertiesChangedEventArgs"/> with the new style. /// </param> public void ShapePropertiesChanged(VGStyleGroup vGStyleGroup, ShapePropertiesChangedEventArgs e) { var sublist = this.Elements.FindAllGroupMembers(vGStyleGroup); var showNumbers = false; var drawAction = e.ShapeDrawAction; if (vGStyleGroup == VGStyleGroup.AOI_STATISTICS_ARROW) { if ((e.ShapeDrawAction & ShapeDrawAction.Name) == ShapeDrawAction.Name) { drawAction &= ~ShapeDrawAction.Name; showNumbers = true; } } foreach (VGElement element in sublist) { element.Pen = e.Pen; element.Brush = e.Brush; element.TextAlignment = e.TextAlignment; element.ShapeDrawAction = drawAction; if (element is VGArrow) { ((VGArrow)element).WeightFont = e.NewFont; ((VGArrow)element).WeightFontColor = e.NewFontColor; if (showNumbers) { ((VGArrow)element).HideWeights = false; } else { ((VGArrow)element).HideWeights = true; } } else { element.Font = e.NewFont; element.FontColor = e.NewFontColor; } } this.DrawForeground(true); switch (vGStyleGroup) { case VGStyleGroup.AOI_STATISTICS_ARROW: this.ArrowPen = e.Pen; this.ArrowBrush = e.Brush; this.ArrowFont = e.NewFont; this.ArrowFontColor = e.NewFontColor; this.ArrowTextAlignment = e.TextAlignment; this.ArrowDrawAction = e.ShapeDrawAction; break; case VGStyleGroup.AOI_STATISTICS_BUBBLE: this.BubblePen = e.Pen; this.BubbleBrush = e.Brush; this.BubbleFont = e.NewFont; this.BubbleFontColor = e.NewFontColor; this.BubbleTextAlignment = e.TextAlignment; this.BubbleDrawAction = e.ShapeDrawAction; break; } }
/// <summary> /// Searches the collection list for all members with /// the given group and returns this items in a new /// <see cref="VGElementCollection"/> /// </summary> /// <param name="searchGroup">The <see cref="VGStyleGroup"/> /// that the elements should match.</param> /// <returns>A <see cref="VGElementCollection"/> with the /// members of the list that are in the given search group.</returns> public VGElementCollection FindAllGroupMembers(VGStyleGroup searchGroup) { VGElementCollection subList = new VGElementCollection(); foreach (VGElement element in this.List) { if ((element.StyleGroup & searchGroup) == searchGroup) { subList.Add(element); } } return subList; }
/// <summary> /// Initializes a new instance of the VGLine class. /// </summary> /// <param name="newShapeDrawAction">Drawing action: Edge, Fill, Both</param> /// <param name="newPen">Pen for edges</param> /// <param name="newFont">Font for text</param> /// <param name="newFontColor">Color for text</param> /// <param name="newStyleGroup">Group Enumeration, <see cref="VGStyleGroup"/></param> /// <param name="newName">Name of Element</param> /// <param name="newElementGroup">Element group description</param> public VGLine( ShapeDrawAction newShapeDrawAction, Pen newPen, Font newFont, Color newFontColor, VGStyleGroup newStyleGroup, string newName, string newElementGroup) : base(newShapeDrawAction, newPen, newFont, newFontColor, newStyleGroup, newName, newElementGroup) { this.Bounds = Rectangle.Empty; this.firstPoint = PointF.Empty; this.secondPoint = PointF.Empty; }
/// <summary> /// Virtual. An override should reset this shape to default values. /// This base class implementation resets the base class fields. /// </summary> public virtual void Reset() { this.TextAlignment = VGAlignment.Center; this.Brush = DefaultBrush; this.Font = DefaultFont; this.FontColor = DefaultFontColor; this.Visible = true; this.GrabHandles.Clear(); this.styleGroup = VGStyleGroup.None; this.isInEditMode = false; this.Modified = false; this.location = new PointF(0, 0); this.ModifierKeys = Keys.None; this.pen = DefaultPen; this.shapeDrawAction = ShapeDrawAction.Edge; this.size = new SizeF(100, 100); this.name = string.Empty; }
/// <summary> /// Set standard values for members variables. /// </summary> private void InitStandards() { this.TextAlignment = VGAlignment.Center; this.Visible = true; this.Brush = (Brush)VGElement.DefaultBrush.Clone(); this.pen = (Pen)VGElement.DefaultPen.Clone(); this.Font = (Font)VGElement.DefaultFont.Clone(); this.FontColor = VGElement.DefaultFontColor; this.styleGroup = VGStyleGroup.None; this.name = string.Empty; this.GrabHandles = new List<GrabHandle>(); this.location = PointF.Empty; this.size = SizeF.Empty; this.Sound = new AudioFile(); }