Dashboard Aussetzen Aktualisiert
This commit is contained in:
@@ -25,6 +25,7 @@ import java.awt.event.MouseAdapter;
|
|||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import javax.swing.UIManager;
|
import javax.swing.UIManager;
|
||||||
import java.awt.Font;
|
import java.awt.Font;
|
||||||
|
import javax.swing.JButton;
|
||||||
|
|
||||||
public class Dashboard_GUI extends JPanel{
|
public class Dashboard_GUI extends JPanel{
|
||||||
private static final long serialVersionUID = -7380187913989942586L;
|
private static final long serialVersionUID = -7380187913989942586L;
|
||||||
@@ -42,7 +43,6 @@ public class Dashboard_GUI extends JPanel{
|
|||||||
private final JPanel spielfeld = new JPanel();
|
private final JPanel spielfeld = new JPanel();
|
||||||
private final JPanel player_hand = new JPanel();
|
private final JPanel player_hand = new JPanel();
|
||||||
private final JPanel gegner_hand = new JPanel();
|
private final JPanel gegner_hand = new JPanel();
|
||||||
private final JLabel ablagestapel = new JLabel("");
|
|
||||||
private final JLabel ziehstapel = new JLabel("");
|
private final JLabel ziehstapel = new JLabel("");
|
||||||
JPanel spielerkarten = new JPanel();
|
JPanel spielerkarten = new JPanel();
|
||||||
JLabel labels[] = new JLabel[32];
|
JLabel labels[] = new JLabel[32];
|
||||||
@@ -53,6 +53,8 @@ public class Dashboard_GUI extends JPanel{
|
|||||||
private final JPanel info_panel = new JPanel();
|
private final JPanel info_panel = new JPanel();
|
||||||
private final JPanel rechts = new JPanel();
|
private final JPanel rechts = new JPanel();
|
||||||
private final JPanel mitte = new JPanel();
|
private final JPanel mitte = new JPanel();
|
||||||
|
JButton aussetzen = new JButton("Aussetzen");
|
||||||
|
JLabel ablagestapel = new JLabel("");
|
||||||
|
|
||||||
public Dashboard_GUI(Spiel Spiel, Texturenpakete texturen) {
|
public Dashboard_GUI(Spiel Spiel, Texturenpakete texturen) {
|
||||||
setMinimumSize(new Dimension(1000, 600));
|
setMinimumSize(new Dimension(1000, 600));
|
||||||
@@ -128,14 +130,23 @@ public class Dashboard_GUI extends JPanel{
|
|||||||
ziehstapel.setHorizontalAlignment(SwingConstants.CENTER);
|
ziehstapel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||||
ziehstapel.setIcon(new ImageIcon(texturenpakete.getTextur(32).getScaledInstance(150, 210, Image.SCALE_SMOOTH)));
|
ziehstapel.setIcon(new ImageIcon(texturenpakete.getTextur(32).getScaledInstance(150, 210, Image.SCALE_SMOOTH)));
|
||||||
|
|
||||||
spielfeldmitte.add(mitte, BorderLayout.SOUTH);
|
spielfeldmitte.add(mitte, BorderLayout.CENTER);
|
||||||
mitte.setLayout(null);
|
mitte.setLayout(null);
|
||||||
spielfeldmitte.add(ablagestapel, BorderLayout.CENTER);
|
|
||||||
ablagestapel.setIcon(new ImageIcon(Dashboard_GUI.class.getResource("/img/texturen/standart/32.png")));
|
JButton aussetzen = new JButton("Aussetzen");
|
||||||
|
aussetzen.setVisible(false);
|
||||||
|
aussetzen.addMouseListener(new MouseAdapter() {
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent e) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
aussetzen.setBounds(473, 554, 89, 23);
|
||||||
|
mitte.add(aussetzen);
|
||||||
|
|
||||||
|
|
||||||
ablagestapel.setPreferredSize(new Dimension(242, 362));
|
ablagestapel.setIcon(new ImageIcon(texturenpakete.getTextur(32).getScaledInstance(150, 210, Image.SCALE_SMOOTH)));
|
||||||
ablagestapel.setHorizontalAlignment(SwingConstants.CENTER);
|
ablagestapel.setBounds(398, 85, 268, 401);
|
||||||
|
mitte.add(ablagestapel);
|
||||||
panelCont.add(start, "3");
|
panelCont.add(start, "3");
|
||||||
start.setLayout(new BorderLayout(0, 0));
|
start.setLayout(new BorderLayout(0, 0));
|
||||||
panel.setPreferredSize(new Dimension(10, 30));
|
panel.setPreferredSize(new Dimension(10, 30));
|
||||||
@@ -222,7 +233,7 @@ public class Dashboard_GUI extends JPanel{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void aktualisiereHand() {
|
public void aktualisiereHand() {
|
||||||
|
|
||||||
//Alle Elemente entfernen
|
//Alle Elemente entfernen
|
||||||
for(Component c : spielerkarten.getComponents()){
|
for(Component c : spielerkarten.getComponents()){
|
||||||
@@ -255,13 +266,13 @@ public class Dashboard_GUI extends JPanel{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void aktualisiereAblage(){
|
public void aktualisiereAblage(){
|
||||||
ablagestapel.setIcon(new ImageIcon(texturenpakete.getTextur(aktuellesSpiel.getKartensatz().getletzteKarte()).getScaledInstance(150, 210, Image.SCALE_SMOOTH)));
|
ablagestapel.setIcon(new ImageIcon(texturenpakete.getTextur(aktuellesSpiel.getKartensatz().getletzteKarte()).getScaledInstance(150, 210, Image.SCALE_SMOOTH)));
|
||||||
ablagestapel.revalidate();
|
ablagestapel.revalidate();
|
||||||
ablagestapel.repaint();
|
ablagestapel.repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
void aktualisiereSpieleranzeige() {
|
public void aktualisiereSpieleranzeige() {
|
||||||
if(aktuellesSpiel.getamZug() == Spieler.COMPUTER) {
|
if(aktuellesSpiel.getamZug() == Spieler.COMPUTER) {
|
||||||
label_aktuellerSpieler.setText("Gegner");
|
label_aktuellerSpieler.setText("Gegner");
|
||||||
label_aktuellerSpieler.setForeground(Color.RED);
|
label_aktuellerSpieler.setForeground(Color.RED);
|
||||||
@@ -277,6 +288,11 @@ public class Dashboard_GUI extends JPanel{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void aussetzen(boolean status) {
|
||||||
|
aussetzen.setVisible(status);
|
||||||
|
}
|
||||||
|
|
||||||
public void aktualisiereGUI(){
|
public void aktualisiereGUI(){
|
||||||
aktualisiereSpieleranzeige();
|
aktualisiereSpieleranzeige();
|
||||||
aktualisiereAblage();
|
aktualisiereAblage();
|
||||||
|
Reference in New Issue
Block a user