-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMyShapes.java
More file actions
101 lines (83 loc) · 2.01 KB
/
MyShapes.java
File metadata and controls
101 lines (83 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package java2ddrawingapplication;
import java2ddrawingapplication.Protoype.Prototype;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Point;
import java.awt.Stroke;
/**
*
* @author Ismael Youssef
*/
public abstract class MyShapes {
private Point startPoint = new Point();
private Point endPoint = new Point();
private Paint paint;
private Stroke stroke;
public MyShapes()
{
stroke = new BasicStroke(5, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND);
paint = Color.BLACK;
}
public MyShapes(Point pntA, Point pntB, Paint paint, Stroke strk)
{
startPoint = pntA;
endPoint = pntB;
this.paint = paint;
stroke = strk;
}
public abstract void draw(Graphics2D g2d);
/**
* @return the startPoint
*/
public Point getStartPoint() {
return startPoint;
}
/**
* @param startPoint the startPoint to set
*/
public void setStartPoint(Point startPoint) {
this.startPoint = startPoint;
}
/**
* @return the endPoint
*/
public Point getEndPoint() {
return endPoint;
}
/**
* @param endPoint the endPoint to set
*/
public void setEndPoint(Point endPoint) {
this.endPoint = endPoint;
}
/**
* @return the paint
*/
public Paint getPaint() {
return paint;
}
/**
* @param paint the paint to set
*/
public void setPaint(Paint paint) {
this.paint = paint;
}
/**
* @return the stroke
*/
public Stroke getStroke() {
return stroke;
}
/**
* @param stroke the stroke to set
*/
public void setStroke(Stroke stroke) {
this.stroke = stroke;
}
}