40 lines
1.2 KiB
Java
40 lines
1.2 KiB
Java
import java.awt.*;
|
|
|
|
public class WindowDrawing{
|
|
private NumWindow numWindow;
|
|
public NumWindow getSomeProperty() {
|
|
return numWindow;
|
|
}
|
|
public void setNumWindow(int kWindow){
|
|
switch(kWindow){
|
|
case 10:
|
|
numWindow = NumWindow.tenWindows;
|
|
break;
|
|
case 20:
|
|
numWindow = NumWindow.twentyWindows;
|
|
break;
|
|
case 30:
|
|
numWindow = NumWindow.thirtyWindows;
|
|
break;
|
|
default:
|
|
numWindow = NumWindow.tenWindows;
|
|
System.out.println("Ошибка! Количество " + kWindow);
|
|
break;
|
|
}
|
|
}
|
|
void Draw(int _startPosX, int _startPosY, Color color, Graphics2D g){
|
|
g.setColor(color);
|
|
int windowSpacing = 4;
|
|
int windowCount = switch (numWindow) {
|
|
case tenWindows -> 10;
|
|
case twentyWindows -> 20;
|
|
case thirtyWindows -> 30;
|
|
};
|
|
for (int j = 0; j < windowCount / 10; j++) {
|
|
for (int i = 0; i < 10; i++) {
|
|
g.fillOval(_startPosX + 35 + i * 8, _startPosY + 30 + j * windowSpacing, 4, 4);
|
|
}
|
|
}
|
|
}
|
|
}
|