33 lines
1.0 KiB
Java
33 lines
1.0 KiB
Java
import javax.swing.*;
|
|
import java.awt.*;
|
|
public class DrawingDeck extends JComponent {
|
|
private AdditionalEnum _decksEnum;
|
|
public void SetAddEnum(int decksAmount) {
|
|
_decksEnum = AdditionalEnum.FromInteger(decksAmount);
|
|
}
|
|
public void DrawDeck(Color colorDeck, Graphics g,float _startPosX,float _startPosY)
|
|
{
|
|
super.paintComponent(g);
|
|
Graphics2D g2d = (Graphics2D) g;
|
|
int numOfDecks = 0;
|
|
switch (_decksEnum)
|
|
{
|
|
case One:
|
|
numOfDecks = 1;
|
|
break;
|
|
case Two:
|
|
numOfDecks = 2;
|
|
break;
|
|
case Three:
|
|
numOfDecks = 3;
|
|
break;
|
|
}
|
|
for(int i = 0; i < numOfDecks; ++i){
|
|
g2d.setPaint(colorDeck);
|
|
g2d.fillRect((int)_startPosX+30 + 5*i, (int)_startPosY+25 - 5*i, 30*2 - 5*i, 5);
|
|
g2d.setPaint(Color.BLACK);
|
|
g2d.drawRect((int)_startPosX+30 + 5*i, (int)_startPosY+25 - 5*i, 30*2 - 5*i, 5);
|
|
}
|
|
}
|
|
}
|