diff --git a/DopIlum.java b/DopIlum.java new file mode 100644 index 0000000..fee8318 --- /dev/null +++ b/DopIlum.java @@ -0,0 +1,3 @@ +enum DopIlum { + Ten, Twenty, Thirty +} diff --git a/DrawingIlum.java b/DrawingIlum.java new file mode 100644 index 0000000..b96bcac --- /dev/null +++ b/DrawingIlum.java @@ -0,0 +1,49 @@ +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; + } + } +}