Pibd-22_Emelyanov_A.S._Airb.../DrawningIlluminator.java
ArtemEmelyanov 0f832390b4 Complete lab
2022-11-29 21:33:34 +04:00

37 lines
1.1 KiB
Java

import java.awt.*;
public class DrawningIlluminator implements IDrawningIlluminator{
private IlluminatorCount _Illuminator;
@Override
public void SetIlluminatorCount(int numOfIllum) {
_Illuminator = IlluminatorCount.GetIlluminatorCount(numOfIllum);
}
@Override
public void DrawIlluminator(Graphics g, int _startPosX, int _startPosY) {
Graphics2D g2d = (Graphics2D) g;
g2d.setColor(Color.BLACK);
int numOfIlluminator = 0;
switch (_Illuminator)
{
case Ten:
numOfIlluminator = 10;
break;
case Twenty:
numOfIlluminator = 20;
break;
case Thirty:
numOfIlluminator = 30;
break;
}
for(int i = numOfIlluminator; i >= 1; --i){
g2d.setColor(Color.CYAN);
g2d.fillOval(_startPosX + 105 - 3 * i, _startPosY + 35, 3, 3);
g2d.setColor(Color.BLACK);
g2d.drawOval(_startPosX + 105 - 3 * i, _startPosY + 35, 3, 3);
}
}
}