PIbd-23_Dolgov_D.A._Airbus..../DrawingIlum.java
2022-11-08 14:55:22 +04:00

50 lines
1.4 KiB
Java

import java.awt.*;
public class DrawingIlum {
private DopIlum il = DopIlum.Ten;
public void setIl(int num){
switch(num)
{
case 0:
il = DopIlum.Twenty;
break;
case 1:
il = DopIlum.Thirty;
break;
default:
break;
}
}
private Color color;
public void Init(int num, Color color) {
setIl(num);
this.color = color;
}
public void DrawIl(int startPosX, int startPosY, Graphics2D g) {
g.setColor(Color.blue);
for (int tempX = 98; tempX > 38; tempX -= 6) {
g.fillOval((int) startPosX + tempX, (int) startPosY + 20, 4, 4);
}
switch (il) {
case Twenty: {
for (int tempX = 98; tempX > 38; tempX -= 6) {
g.fillOval((int) startPosX + tempX, (int) startPosY + 26, 4, 4);
}
break;
}
case Thirty: {
for (int tempX = 98; tempX > 38; tempX -= 6) {
g.fillOval((int) startPosX + tempX, (int) startPosY + 25, 4, 4);
g.fillOval((int) startPosX + tempX, (int) startPosY + 30, 4, 4);
}
break;
}
default:
break;
}
}
}