|
|
@ -40,6 +40,16 @@ public class Card extends JPanel { |
|
|
|
return nr; |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isred() { |
|
|
|
return this.symbol == Symbol.Herz |
|
|
|
|| this.symbol == Symbol.Karo; |
|
|
|
} |
|
|
|
|
|
|
|
public boolean isblack() { |
|
|
|
return this.symbol == Symbol.Kreuz |
|
|
|
|| this.symbol == Symbol.Pik; |
|
|
|
} |
|
|
|
|
|
|
|
private String getNrText() { |
|
|
|
if (this.nr < 10) { |
|
|
|
return "0" + this.nr; |
|
|
@ -107,7 +117,7 @@ public class Card extends JPanel { |
|
|
|
g.setColor(Color.black); |
|
|
|
g.drawRect(0, 0, this.getWidth() - 1, this.getHeight() - 1); |
|
|
|
|
|
|
|
if (this.symbol == Symbol.Herz || this.symbol == Symbol.Karo) |
|
|
|
if (this.isred()) |
|
|
|
g.setColor(Color.red); |
|
|
|
else |
|
|
|
g.setColor(Color.black); |
|
|
|