//circle public ICircle CreateCircle(IGraphElementHost host) { var e = new Circle(host); OnCreateGraphElement(e); return(e); }
//text public IText CreateText(IGraphElementHost host, string caption) { var e = new Text(host, caption); OnCreateGraphElement(e); return(e); }
//polygon public IPolygon CreatePoly(IGraphElementHost host) { var e = new Poly(host); OnCreateGraphElement(e); return(e); }
//rectangle public IRectangle CreateRectangle(IGraphElementHost host) { var e = new Rectangle(host); OnCreateGraphElement(e); return(e); }
//dot public IDot CreateDot(IGraphElementHost host) { var e = new Dot(host); OnCreateGraphElement(e); return(e); }
public Rectangle(IGraphElementHost host) : base(host) { Position = new PointF(0, 0); Size = new SizeF(40, 20); PPath.AddRectangle(Position.X, Position.Y, Size.Width, Size.Height); }
public Dot(IGraphElementHost host) : base(host) { DotSize = 1; PNode.Brush = null; PPath.AddRectangle(Position.X, Position.Y, DotSize, DotSize); }
public Solid(IGraphElementHost host) : base(host) { if (PPath != null) { Pen = null; } }
public Poly(IGraphElementHost host) : base(host) { Position = new PointF(0, 0); FPoints = new EditableList <PointF>(); FPoints.Added += new CollectionDelegate <PointF>(PointsChanged); FPoints.Removed += new CollectionDelegate <PointF>(PointsChanged); IsClosed = false; }
public Text(IGraphElementHost host, string caption) : base(host) { if (caption == null) { caption = ""; } Caption = caption; Brush = null; }
public Circle(IGraphElementHost host) : base(host) { Radius = 5; if (Parent != null) { PPath.AddEllipse(Position.X, Position.Y, Radius, Radius); } else { PPath.AddEllipse(0, 0, Radius, Radius); } }
public TempPath(IGraphElementHost host, ISolid start) : base(host) { Points = new List <PointF>(); Start = start; PNode.Brush = null; //start point Points.Add(Start.GlobalMiddle); //end point Points.Add(Start.GlobalMiddle); }
public GraphElement(IGraphElementHost host) { PNode = CreatePNode(); PNode.Tag = this; FHost = host; PNode.Brush = Brushes.Black; IsSelectable = (host is ISelectable); IsMovable = (host is IMovable); IsConnectable = (host is IConnectable); IsHoverable = (host is IHoverable); IsClickable = (host is IClickable); Selectable = (host as ISelectable); Movable = (host as IMovable); Connectable = (host as IConnectable); Hoverable = (host as IHoverable); Clickable = (host as IClickable); //enable piccolo input events? PNode.Pickable = IsSelectable || IsMovable || IsConnectable || IsHoverable || IsClickable; if (IsMovable) { PNode.TransformChanged += BoundsChanged; } if (IsHoverable) { PNode.MouseEnter += new PInputEventHandler(GraphElement_MouseEnter); PNode.MouseLeave += new PInputEventHandler(GraphElement_MouseLeave); PNode.MouseMove += new PInputEventHandler(GraphElement_MouseMove); } if (IsClickable) { PNode.Click += new PInputEventHandler(PNode_Click); PNode.DoubleClick += new PInputEventHandler(PNode_DoubleClick); PNode.MouseDown += new PInputEventHandler(PNode_MouseDown); PNode.MouseUp += new PInputEventHandler(PNode_MouseUp); } }
public LinkPath(IGraphElementHost host, ITempPath temppath, ISolid end) : base(host, temppath.Start) { Points = temppath.Points; PathConstruction(end); }
public LinkPath(IGraphElementHost host, ISolid start, ISolid end) : base(host, start) { PathConstruction(end); }