import javax.swing.*; import java.awt.*; public class DrawningIlluminator extends JComponent { private IlluminatorCount _Illuminator; public void SetIlluminatorCount(int numOfIllum) { _Illuminator = IlluminatorCount.GetIlluminatorCount(numOfIllum); } public void DrawIlluminator(Graphics g, int _startPosX, int _startPosY) { super.paintComponent(g); 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); } } }