PIbd-23_Dolgov_D.A._Airbus..../DrawingSquareIlum.java
2022-12-05 21:01:53 +04:00

47 lines
1.3 KiB
Java

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