2022-11-05 23:24:05 +04:00
|
|
|
import java.awt.*;
|
|
|
|
import java.util.Random;
|
|
|
|
|
|
|
|
public class DrawningRollers {
|
|
|
|
private RollersCount rollersCount;
|
|
|
|
private Color colorRollers;
|
|
|
|
|
|
|
|
public void setRollersCount(int count){
|
|
|
|
switch (count) {
|
|
|
|
case 4 -> rollersCount = RollersCount.Four;
|
|
|
|
case 5 -> rollersCount = RollersCount.Five;
|
|
|
|
case 6 -> rollersCount = RollersCount.Six;
|
|
|
|
default -> rollersCount = RollersCount.Four;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-07 00:26:51 +04:00
|
|
|
public DrawningRollers(int count, Color colorRollers){
|
2022-11-05 23:24:05 +04:00
|
|
|
setRollersCount(count);
|
|
|
|
this.colorRollers = colorRollers;
|
|
|
|
}
|
|
|
|
|
2022-11-07 00:26:51 +04:00
|
|
|
public void DrawRollers(Graphics2D g, float _startPosX, float _startPosY){
|
2022-11-05 23:24:05 +04:00
|
|
|
Color penColor = Color.BLACK;
|
|
|
|
Color mainColor = colorRollers==null ? Color.LIGHT_GRAY : colorRollers;
|
|
|
|
|
|
|
|
// Крупные катки - всегда
|
|
|
|
g.setColor(mainColor);
|
|
|
|
g.fillOval((int)_startPosX + 5, (int)_startPosY + 60, 22, 22);
|
|
|
|
g.setColor(penColor);
|
|
|
|
g.drawOval((int)_startPosX + 5, (int)_startPosY + 60, 22, 22);
|
|
|
|
g.setColor(mainColor);
|
|
|
|
g.fillOval((int)_startPosX + 83, (int)_startPosY + 60, 22, 22);
|
|
|
|
g.setColor(penColor);
|
|
|
|
g.drawOval((int)_startPosX + 83, (int)_startPosY + 60, 22, 22);
|
|
|
|
|
|
|
|
// Малые катки - всегда
|
|
|
|
g.setColor(mainColor);
|
|
|
|
g.fillOval((int)_startPosX + 43, (int)_startPosY + 58, 6, 6);
|
|
|
|
g.setColor(penColor);
|
|
|
|
g.drawOval((int)_startPosX + 43, (int)_startPosY + 58, 6, 6);
|
|
|
|
g.setColor(mainColor);
|
|
|
|
g.fillOval((int)_startPosX + 61, (int)_startPosY + 58, 6, 6);
|
|
|
|
g.setColor(penColor);
|
|
|
|
g.drawOval((int)_startPosX + 61, (int)_startPosY + 58, 6, 6);
|
|
|
|
|
|
|
|
// Средние катки - не всегда
|
|
|
|
switch (rollersCount){
|
|
|
|
case Six:
|
|
|
|
g.setColor(mainColor);
|
|
|
|
g.fillOval((int)_startPosX + 33, (int)_startPosY + 73, 10, 10);
|
|
|
|
g.setColor(penColor);
|
|
|
|
g.drawOval((int)_startPosX + 33, (int)_startPosY + 73, 10, 10);
|
|
|
|
case Five:
|
|
|
|
g.setColor(mainColor);
|
|
|
|
g.fillOval((int)_startPosX + 68, (int)_startPosY + 73, 10, 10);
|
|
|
|
g.setColor(penColor);
|
|
|
|
g.drawOval((int)_startPosX + 68, (int)_startPosY + 73, 10, 10);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Центры крупных катков
|
|
|
|
g.setColor(Color.BLACK);
|
|
|
|
g.fillOval((int)_startPosX + 13, (int)_startPosY + 68, 6, 6);
|
|
|
|
g.fillOval((int)_startPosX + 91, (int)_startPosY + 68, 6, 6);
|
|
|
|
}
|
|
|
|
}
|