1 | using System.Drawing;
|
---|
2 | namespace Netron.Diagramming.Core {
|
---|
3 | /// <summary>
|
---|
4 | /// Abstract base implementation of the <see cref="ITracker"/> interface.
|
---|
5 | /// </summary>
|
---|
6 | public abstract class TrackerBase : ITracker {
|
---|
7 | #region Fields
|
---|
8 | /// <summary>
|
---|
9 | /// the Rectangle field
|
---|
10 | /// </summary>
|
---|
11 | private Rectangle mRectangle;
|
---|
12 | #endregion
|
---|
13 |
|
---|
14 | #region Properties
|
---|
15 | /// <summary>
|
---|
16 | /// Gets or sets the Rectangle
|
---|
17 | /// </summary>
|
---|
18 | public Rectangle Rectangle {
|
---|
19 | get {
|
---|
20 | return mRectangle;
|
---|
21 | }
|
---|
22 | set {
|
---|
23 | mRectangle = value;
|
---|
24 | }
|
---|
25 | }
|
---|
26 | /// <summary>
|
---|
27 | /// the ShowHandles field
|
---|
28 | /// </summary>
|
---|
29 | private bool mShowHandles;
|
---|
30 | /// <summary>
|
---|
31 | /// Gets or sets the ShowHandles
|
---|
32 | /// </summary>
|
---|
33 | public bool ShowHandles {
|
---|
34 | get { return mShowHandles; }
|
---|
35 | set { mShowHandles = value; }
|
---|
36 | }
|
---|
37 | #endregion
|
---|
38 |
|
---|
39 | #region Constructors
|
---|
40 |
|
---|
41 | /// <summary>
|
---|
42 | /// Initializes a new instance of the <see cref="T:TrackerBase"/> class.
|
---|
43 | /// </summary>
|
---|
44 | public TrackerBase() {
|
---|
45 | }
|
---|
46 | /// <summary>
|
---|
47 | /// Initializes a new instance of the <see cref="T:TrackerBase"/> class.
|
---|
48 | /// </summary>
|
---|
49 | /// <param name="rectangle">The rectangle.</param>
|
---|
50 | public TrackerBase(Rectangle rectangle) {
|
---|
51 | mRectangle = rectangle;
|
---|
52 | }
|
---|
53 | #endregion
|
---|
54 |
|
---|
55 | #region Methods
|
---|
56 | /// <summary>
|
---|
57 | /// Paints the entity using the given graphics object
|
---|
58 | /// </summary>
|
---|
59 | /// <param name="g"></param>
|
---|
60 | public abstract void Paint(Graphics g);
|
---|
61 | //{
|
---|
62 | // g.DrawRectangle(ArtPallet.HighlightPen, mRectangle);
|
---|
63 | //}
|
---|
64 | /// <summary>
|
---|
65 | /// Returns the relative coordinate of the grip-point hit, if any, of the tracker.
|
---|
66 | /// </summary>
|
---|
67 | /// <param name="p"></param>
|
---|
68 | /// <returns></returns>
|
---|
69 | public abstract Point Hit(Point p);
|
---|
70 | /// <summary>
|
---|
71 | /// Transforms the specified rectangle.
|
---|
72 | /// </summary>
|
---|
73 | /// <param name="rectangle">The rectangle.</param>
|
---|
74 | public abstract void Transform(Rectangle rectangle);
|
---|
75 | #endregion
|
---|
76 |
|
---|
77 | }
|
---|
78 | }
|
---|