36 lines
965 B
Java
36 lines
965 B
Java
import java.awt.*;
|
|
|
|
public class DrawningWeels {
|
|
|
|
private int count;
|
|
DrawningWeels (int n){
|
|
count = n;
|
|
}
|
|
public int get_countWheels(){
|
|
return count;
|
|
}
|
|
|
|
public void DrawningWeel (Graphics g, int x, int y){
|
|
g.setColor(Color.BLACK);
|
|
//g.fillOval(x, y, 25, 25);
|
|
|
|
switch (get_countWheels()){
|
|
case 2:
|
|
g.fillOval(x + 10, y + 67, 25, 25);
|
|
g.fillOval(x + 85, y + 67, 25, 25);
|
|
break;
|
|
case 3:
|
|
g.fillOval(x + 10, y + 67, 25, 25);
|
|
g.fillOval(x + 38, y + 67, 25, 25);
|
|
g.fillOval(x + 85, y + 67, 25, 25);
|
|
break;
|
|
case 4:
|
|
g.fillOval(x + 5, y + 67, 25, 25);
|
|
g.fillOval(x + 32, y + 67, 25, 25);
|
|
g.fillOval(x + 61, y + 67, 25, 25);
|
|
g.fillOval(x + 88, y + 67, 25, 25);
|
|
break;
|
|
}
|
|
}
|
|
}
|