Alexander Hartung
3 years ago
5 changed files with 88 additions and 5 deletions
-
9src/main/java/solitaer/BaseStack.java
-
3src/main/java/solitaer/Card.java
-
31src/main/java/solitaer/MyMouseListener.java
-
38src/main/java/solitaer/SaveStack.java
-
12src/main/java/solitaer/SolitaerGamePanel.java
@ -0,0 +1,38 @@ |
|||
package solitaer; |
|||
|
|||
import java.awt.Color; |
|||
import java.awt.Graphics; |
|||
|
|||
public class SaveStack extends BaseStack { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
public SaveStack(int _x, int _y) { |
|||
// TODO Auto-generated constructor stub |
|||
super(); |
|||
super.setLocation(_x, _y); |
|||
super.setSize(72, 450); |
|||
super.setOpaque(false); |
|||
super.setLayout(null); |
|||
} |
|||
|
|||
@Override |
|||
protected boolean cardCheck(Card _topStack, Card _playerCard) { |
|||
// TODO Auto-generated method stub |
|||
return false; |
|||
} |
|||
|
|||
@Override |
|||
protected void paintComponent(Graphics g) { |
|||
// TODO Auto-generated method stub |
|||
super.paintComponent(g); |
|||
if (stackIsEmpty()) { |
|||
g.setColor(Color.pink); |
|||
g.fillRect(0, 0, this.getWidth(), 96); |
|||
|
|||
g.setColor(Color.black); |
|||
g.drawRect(0, 0, this.getWidth() - 1, 96 - 1); |
|||
} |
|||
} |
|||
|
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue