37 lines
965 B
Java
37 lines
965 B
Java
package DifferenceOfWheels;
|
|
|
|
import java.awt.*;
|
|
|
|
public class DrawningOrnamentStar implements IOrnaments{
|
|
int CountWeel;
|
|
@Override
|
|
public void SetCount(int n) {
|
|
CountWeel = n;
|
|
}
|
|
|
|
@Override
|
|
public int get_count_weels() {
|
|
return CountWeel;
|
|
}
|
|
|
|
@Override
|
|
public void DrawOrnament(Graphics2D g, int x, int y) {
|
|
g.setColor(Color.BLACK);
|
|
g.fillOval(x, y, 25, 25);
|
|
|
|
g.setColor(Color.CYAN);
|
|
Polygon elements = new Polygon();
|
|
elements.addPoint(x + 12, y + 2);
|
|
elements.addPoint(x + 15, y + 8);
|
|
elements.addPoint(x + 21, y + 10);
|
|
elements.addPoint(x + 15, y + 13);
|
|
elements.addPoint(x + 19, y + 19);
|
|
elements.addPoint(x + 12, y + 15);
|
|
elements.addPoint(x + 5, y + 19);
|
|
elements.addPoint(x + 9, y + 13);
|
|
elements.addPoint(x + 3, y + 10);
|
|
elements.addPoint(x + 10, y + 8);
|
|
g.fillPolygon(elements);
|
|
}
|
|
}
|