public override object CreateShape(PaintSpace p) { Line line = new Line(p, pointStart, pointEnd); //line.Draw(p.MainGraphics); return(line); }
public override object CreateShape(PaintSpace p) { Ellipse ellipse = new Ellipse(p, pointStart, pointEnd); //ellipse.Draw(p.MainGraphics); return(ellipse); }
public override object onMouseDown(MouseEventArgs e, PaintSpace p) { TextForm textGetter = new TextForm(p); textGetter.ShowDialog(); return(new Text(p, e.Location, textGetter.getText(), textGetter.getFont())); }
public override object CreateShape(PaintSpace p) { Hyperbola hyperbola = new Hyperbola(p, pointStart, pointEnd); //hyperbola.Draw(p.MainGraphics); return(hyperbola); }
public object CreateShape(PaintSpace p) { Bezier bezier = new Bezier(p, pointList); pointList.Clear(); return(bezier); }
public override object CreateShape(PaintSpace p) { MyRectangle rect = new MyRectangle(p, pointStart, pointEnd); //rect.Draw(p.MainGraphics); return(rect); }
public object CreateShape(PaintSpace p) { Polygon polygon = new Polygon(p, pointList); pointList.Clear(); return(polygon); }
public override object CreateShape(PaintSpace p) { Parabola parabola = new Parabola(p, pointStart, pointEnd); //parabola.Draw(p.MainGraphics); return(parabola); }
public override PaintSpace GetParams() { PaintSpace ps = base.GetParams(); ps.TextFont = this.font; return(ps); }
public object CreateShape(PaintSpace p) { Zigzag polygon = new Zigzag(p, pointList); pointList.Clear(); return(polygon); }
public override void UpdateParams(PaintSpace p) { if (shape != null) { base.UpdateParams(p); shape.UpdateParams(p); } }
private void ResetParams(PaintSpace p) { setForeColor(p.ForeColor); setBackColor(p.BackColor); setDashStyle((DashStyle)p.DashStyle); setBorderWidth(p.BorderWidth); setFont(p.TextFont); }
public Polygon(PaintSpace p, List <Point> pointLists) : base(p) { this.pointLists = new List <Point>(); foreach (Point point in pointLists) { this.pointLists.Add(new Point(point.X, point.Y)); } }
public override PaintSpace GetParams() { PaintSpace ps = base.GetParams(); ps.BackColor = BackColor; ps.Pattern = pattern; return(ps); }
public virtual PaintSpace GetParams() { PaintSpace ps = new PaintSpace(); ps.ForeColor = ForeColor; ps.DashStyle = dashStyle; ps.BorderWidth = width; return(ps); }
public Shape(PaintSpace p) { transformationMatrix = new Matrix(); previousMatrix = transformationMatrix.Clone(); this.ForeColor = p.ForeColor; this.dashStyle = (int)p.DashStyle; this.width = p.BorderWidth; }
public object CreatePartShape(PaintSpace p) { if (pointList.Count > 2) { Polygon polygon = new Polygon(p, pointList); return(polygon); } return(new Line(p, pointList[0], pointList[1])); }
public override object onMouseMove(MouseEventArgs e, PaintSpace p) { if (isDragging) { Update(e); //p.MainGraphics.Clear(Color.Transparent); return(CreateTransformation()); } return(null); }
public override object onMouseMove(MouseEventArgs e, PaintSpace p) { if (isDragging) { Update(e); object shape = CreateShape(p); pointPrev = pointEnd; return(shape); } return(null); }
public override object onMouseDown(MouseEventArgs e, PaintSpace p) { pointStart = e.Location; isRightBtn = (e.Button == MouseButtons.Right) ? true : false; isLeftBtn = (e.Button == MouseButtons.Left) ? true : false; isDragging = true; Update(e); return(null); }
public override void onMouseDown(MouseEventArgs e, PaintSpace p) { base.onMouseDown(e, p); if (IsLeftBtn && pointList.Count < 3) { pointList.Add(StartPoint); p.MainGraphics.DrawEllipse(p.MainPen, StartPoint.X, StartPoint.Y, 2, 2); } if (IsRightBtn && pointList.Count > 1) { Draw(p); } }
public override void onMouseMove(MouseEventArgs e, PaintSpace p) { base.onMouseMove(e, p); if (IsDragging) { if (lastPoint != EndPoint) { graphicsPath.AddLine(EndPoint, lastPoint); lastPoint = EndPoint; Draw(p.MainPen, p.MainGraphics); //Console.WriteLine("Draw Draw Draw !!!!"); } } }
public override object CreateShape(PaintSpace p) { PaintSpace np = new PaintSpace { BackColor = Color.Transparent, ForeColor = Color.Transparent, MainGraphics = p.MainGraphics, DashStyle = (int)DashStyle.Solid, BorderWidth = 0.5f }; MyRectangle rect = new MyRectangle(np, pointStart, pointEnd); return(rect); }
public override Object onMouseMove(MouseEventArgs e, PaintSpace p) { base.onMouseMove(e, p); if (isDragging) { if (lastPoint != pointEnd) { graphicsPath.AddLine(pointEnd, lastPoint); lastPoint = pointEnd; Pen pen = new Pen(p.ForeColor, p.BorderWidth); pen.DashStyle = (System.Drawing.Drawing2D.DashStyle)p.DashStyle; Draw(pen, p.MainGraphics); //Console.WriteLine("Draw Draw Draw !!!!"); } } return(null); }
public override object onMouseDown(MouseEventArgs e, PaintSpace p) { if (e.Button == MouseButtons.Left) { pointList.Add(e.Location); Console.WriteLine(pointList.Count); foreach (Point po in pointList) { Console.WriteLine("{0},{1}", po.X, po.Y); } Console.WriteLine(); } if (pointList.Count == 4) { return(CreateShape(p)); } if (pointList.Count > 1) { return(CreatePartShape(p)); } return(null); }
public Line(PaintSpace p, Point pointStart, Point pointEnd) : base(p) { this.pointStart = pointStart; this.pointEnd = pointEnd; }
public virtual void UpdateParams(PaintSpace p) { this.ForeColor = p.ForeColor; this.dashStyle = (int)p.DashStyle; this.width = p.BorderWidth; }
public override void UpdateParams(PaintSpace p) { base.UpdateParams(p); BackColor = p.BackColor; pattern = p.Pattern; }
public override void onMouseDown(MouseEventArgs e, PaintSpace p) { base.onMouseDown(e, p); lastPoint = EndPoint; }
public FilledShape(PaintSpace p) : base(p) { BackColor = p.BackColor; pattern = p.Pattern; }