PIbd-14_Antonova_A.A.__Hard/DifferenceOfWheels/DrawningOrnamentTriangle.java

31 lines
674 B
Java
Raw Permalink Normal View History

2024-05-09 20:09:37 +04:00
package DifferenceOfWheels;
import java.awt.*;
public class DrawningOrnamentTriangle 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.MAGENTA);
Polygon elements = new Polygon();
elements.addPoint(x + 7, y + 6);
elements.addPoint(x + 20, y + 6);
elements.addPoint(x + 7, y + 18);
g.fillPolygon(elements);
}
}