|
|
@@ -61,17 +61,20 @@ public class Dashboard_GUI extends JPanel{
|
|
|
|
private final JPanel gegner_hand = new JPanel();
|
|
|
|
private final JPanel gegner_hand = new JPanel();
|
|
|
|
private final JLabel ablagestapel = new JLabel("");
|
|
|
|
private final JLabel ablagestapel = new JLabel("");
|
|
|
|
private final JLabel ziehstapel = new JLabel("");
|
|
|
|
private final JLabel ziehstapel = new JLabel("");
|
|
|
|
private final JScrollPane scrollPane = new JScrollPane();
|
|
|
|
|
|
|
|
private final JLabel lblNewLabel_2_1 = new JLabel("");
|
|
|
|
private final JLabel lblNewLabel_2_1 = new JLabel("");
|
|
|
|
JPanel spielerkarten = new JPanel();
|
|
|
|
JPanel spielerkarten = new JPanel();
|
|
|
|
JLabel labels[] = new JLabel[32];
|
|
|
|
JLabel labels[] = new JLabel[32];
|
|
|
|
private Audio sound = new Audio();
|
|
|
|
private Audio sound = new Audio();
|
|
|
|
private Spiel aktuellesSpiel;
|
|
|
|
private Spiel aktuellesSpiel;
|
|
|
|
private JPanel gegenerkarten = new JPanel();
|
|
|
|
|
|
|
|
private JLabel label_aktuellerSpieler;
|
|
|
|
private JLabel label_aktuellerSpieler;
|
|
|
|
private Texturenpakete texturenpakete;
|
|
|
|
private Texturenpakete texturenpakete;
|
|
|
|
|
|
|
|
private final JPanel spielfeldmitte = new JPanel();
|
|
|
|
|
|
|
|
private final JPanel info_panel = new JPanel();
|
|
|
|
|
|
|
|
private final JPanel rechts = new JPanel();
|
|
|
|
|
|
|
|
private final JPanel mitte = new JPanel();
|
|
|
|
|
|
|
|
|
|
|
|
public Dashboard_GUI(Spiel Spiel, Texturenpakete texturen) {
|
|
|
|
public Dashboard_GUI(Spiel Spiel, Texturenpakete texturen) {
|
|
|
|
|
|
|
|
setMinimumSize(new Dimension(1000, 600));
|
|
|
|
texturenpakete = texturen;
|
|
|
|
texturenpakete = texturen;
|
|
|
|
texturenpakete.addPaket("StandartTexturenBeta3.zip");
|
|
|
|
texturenpakete.addPaket("StandartTexturenBeta3.zip");
|
|
|
|
texturenpakete.setAktivesPaket(0);
|
|
|
|
texturenpakete.setAktivesPaket(0);
|
|
|
@@ -85,15 +88,18 @@ public class Dashboard_GUI extends JPanel{
|
|
|
|
spielfeld.setBackground(new Color(128, 128, 128));
|
|
|
|
spielfeld.setBackground(new Color(128, 128, 128));
|
|
|
|
|
|
|
|
|
|
|
|
game.add(spielfeld, BorderLayout.CENTER);
|
|
|
|
game.add(spielfeld, BorderLayout.CENTER);
|
|
|
|
spielfeld.setLayout(null);
|
|
|
|
spielfeld.setLayout(new BorderLayout(0, 0));
|
|
|
|
|
|
|
|
player_hand.setPreferredSize(new Dimension(100, 240));
|
|
|
|
player_hand.setForeground(new Color(169, 169, 169));
|
|
|
|
player_hand.setForeground(new Color(169, 169, 169));
|
|
|
|
player_hand.setBackground(new Color(169, 169, 169));
|
|
|
|
player_hand.setBackground(new Color(169, 169, 169));
|
|
|
|
player_hand.setBounds(0, 629, 1269, 243);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spielfeld.add(player_hand);
|
|
|
|
spielfeld.add(player_hand, BorderLayout.SOUTH);
|
|
|
|
player_hand.setLayout(new BorderLayout(0, 0));
|
|
|
|
player_hand.setLayout(new BorderLayout(0, 0));
|
|
|
|
|
|
|
|
|
|
|
|
JScrollPane scrollPane_1 = new JScrollPane();
|
|
|
|
JScrollPane scrollPane_1 = new JScrollPane();
|
|
|
|
|
|
|
|
scrollPane_1.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
|
|
|
|
|
|
|
scrollPane_1.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
|
|
|
|
|
|
|
|
scrollPane_1.setPreferredSize(new Dimension(100, 240));
|
|
|
|
player_hand.add(scrollPane_1, BorderLayout.CENTER);
|
|
|
|
player_hand.add(scrollPane_1, BorderLayout.CENTER);
|
|
|
|
spielerkarten.setBackground(new Color(169, 169, 169));
|
|
|
|
spielerkarten.setBackground(new Color(169, 169, 169));
|
|
|
|
|
|
|
|
|
|
|
@@ -104,22 +110,31 @@ public class Dashboard_GUI extends JPanel{
|
|
|
|
spielerkarten.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
|
|
spielerkarten.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));
|
|
|
|
gegner_hand.setBackground(UIManager.getColor("Button.shadow"));
|
|
|
|
gegner_hand.setBackground(UIManager.getColor("Button.shadow"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spielfeld.add(gegner_hand, BorderLayout.NORTH);
|
|
|
|
gegner_hand.setBounds(0, 0, 1269, 152);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spielfeld.add(gegner_hand);
|
|
|
|
|
|
|
|
gegner_hand.setLayout(new BorderLayout(0, 0));
|
|
|
|
gegner_hand.setLayout(new BorderLayout(0, 0));
|
|
|
|
|
|
|
|
|
|
|
|
gegner_hand.add(scrollPane);
|
|
|
|
spielfeldmitte.setPreferredSize(new Dimension(100, 20));
|
|
|
|
gegenerkarten.setBackground(new Color(169, 169, 169));
|
|
|
|
spielfeldmitte.setLayout(new BorderLayout(0, 0));
|
|
|
|
|
|
|
|
|
|
|
|
scrollPane.setViewportView(gegenerkarten);
|
|
|
|
JLabel beschreibung_aktuellerSpieler = new JLabel("Aktueller Spieler:");
|
|
|
|
ablagestapel.setPreferredSize(new Dimension(242, 362));
|
|
|
|
beschreibung_aktuellerSpieler.setFont(new Font("Tahoma", Font.BOLD, 18));
|
|
|
|
ablagestapel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
|
beschreibung_aktuellerSpieler.setForeground(Color.WHITE);
|
|
|
|
ablagestapel.setBounds(618, 267, 137, 210);
|
|
|
|
info_panel.add(beschreibung_aktuellerSpieler);
|
|
|
|
|
|
|
|
label_aktuellerSpieler = new JLabel("Auswahlphase");
|
|
|
|
|
|
|
|
label_aktuellerSpieler.setForeground(Color.WHITE);
|
|
|
|
|
|
|
|
label_aktuellerSpieler.setFont(new Font("Tahoma", Font.BOLD, 18));
|
|
|
|
|
|
|
|
info_panel.add(label_aktuellerSpieler);
|
|
|
|
|
|
|
|
|
|
|
|
spielfeld.add(ablagestapel);
|
|
|
|
|
|
|
|
|
|
|
|
spielfeld.add(spielfeldmitte, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spielfeldmitte.add(info_panel, BorderLayout.NORTH);
|
|
|
|
|
|
|
|
rechts.setPreferredSize(new Dimension(250, 10));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spielfeldmitte.add(rechts, BorderLayout.EAST);
|
|
|
|
|
|
|
|
rechts.setLayout(new BorderLayout(0, 0));
|
|
|
|
|
|
|
|
ziehstapel.setAlignmentX(Component.CENTER_ALIGNMENT);
|
|
|
|
|
|
|
|
rechts.add(ziehstapel, BorderLayout.CENTER);
|
|
|
|
ziehstapel.addMouseListener(new MouseAdapter() {
|
|
|
|
ziehstapel.addMouseListener(new MouseAdapter() {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
@@ -130,33 +145,16 @@ public class Dashboard_GUI extends JPanel{
|
|
|
|
ziehstapel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
|
|
|
|
ziehstapel.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
|
|
|
|
ziehstapel.setPreferredSize(new Dimension(242, 362));
|
|
|
|
ziehstapel.setPreferredSize(new Dimension(242, 362));
|
|
|
|
ziehstapel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
|
ziehstapel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
|
ziehstapel.setBounds(1093, 267, 137, 210);
|
|
|
|
ziehstapel.setIcon(new ImageIcon(texturenpakete.getTextur(32).getScaledInstance(150, 210, Image.SCALE_SMOOTH)));
|
|
|
|
ziehstapel.setIcon(new ImageIcon(texturenpakete.getTextur(32).getScaledInstance(ziehstapel.getWidth(), ziehstapel.getHeight(), Image.SCALE_SMOOTH)));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spielfeld.add(ziehstapel);
|
|
|
|
spielfeldmitte.add(mitte, BorderLayout.SOUTH);
|
|
|
|
|
|
|
|
mitte.setLayout(null);
|
|
|
|
|
|
|
|
spielfeldmitte.add(ablagestapel, BorderLayout.CENTER);
|
|
|
|
|
|
|
|
ablagestapel.setIcon(new ImageIcon(Dashboard_GUI.class.getResource("/img/texturen/standart/32.png")));
|
|
|
|
|
|
|
|
|
|
|
|
JButton btnNewButton_1 = new JButton("Audio");
|
|
|
|
|
|
|
|
btnNewButton_1.addMouseListener(new MouseAdapter() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public void mouseClicked(MouseEvent e) {
|
|
|
|
|
|
|
|
sound.test();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
btnNewButton_1.setBounds(26, 197, 89, 23);
|
|
|
|
|
|
|
|
spielfeld.add(btnNewButton_1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
JLabel beschreibung_aktuellerSpieler = new JLabel("Aktueller Spieler:");
|
|
|
|
ablagestapel.setPreferredSize(new Dimension(242, 362));
|
|
|
|
beschreibung_aktuellerSpieler.setFont(new Font("Tahoma", Font.BOLD, 18));
|
|
|
|
ablagestapel.setHorizontalAlignment(SwingConstants.CENTER);
|
|
|
|
beschreibung_aktuellerSpieler.setForeground(Color.WHITE);
|
|
|
|
|
|
|
|
beschreibung_aktuellerSpieler.setBounds(435, 163, 156, 31);
|
|
|
|
|
|
|
|
spielfeld.add(beschreibung_aktuellerSpieler);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
label_aktuellerSpieler = new JLabel("Auswahlphase");
|
|
|
|
|
|
|
|
label_aktuellerSpieler.setForeground(Color.WHITE);
|
|
|
|
|
|
|
|
label_aktuellerSpieler.setFont(new Font("Tahoma", Font.BOLD, 18));
|
|
|
|
|
|
|
|
label_aktuellerSpieler.setBounds(601, 163, 163, 31);
|
|
|
|
|
|
|
|
spielfeld.add(label_aktuellerSpieler);
|
|
|
|
|
|
|
|
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));
|
|
|
@@ -269,7 +267,7 @@ public class Dashboard_GUI extends JPanel{
|
|
|
|
aktualisiereGUI();
|
|
|
|
aktualisiereGUI();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
labels[i].setIcon(new ImageIcon(texturen.getTextur(aktuellesSpiel.getKartensatz().getHand(Spieler.SPIELER).get(i)).getScaledInstance(ziehstapel.getWidth(), ziehstapel.getHeight(), Image.SCALE_SMOOTH)));
|
|
|
|
labels[i].setIcon(new ImageIcon(texturen.getTextur(aktuellesSpiel.getKartensatz().getHand(Spieler.SPIELER).get(i)).getScaledInstance(150, 210, Image.SCALE_SMOOTH)));
|
|
|
|
spielerkarten.add(labels[i]);
|
|
|
|
spielerkarten.add(labels[i]);
|
|
|
|
spielerkarten.updateUI(); //Panel erneuern
|
|
|
|
spielerkarten.updateUI(); //Panel erneuern
|
|
|
|
}
|
|
|
|
}
|
|
|
@@ -277,7 +275,7 @@ public class Dashboard_GUI extends JPanel{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void aktualisiereAblage(Spiel aktuellesSpiel, Texturenpakete texturen){
|
|
|
|
void aktualisiereAblage(Spiel aktuellesSpiel, Texturenpakete texturen){
|
|
|
|
ablagestapel.setIcon(new ImageIcon(texturen.getTextur(aktuellesSpiel.getKartensatz().getletzteKarte()).getScaledInstance(ziehstapel.getWidth(), ziehstapel.getHeight(), Image.SCALE_SMOOTH)));
|
|
|
|
ablagestapel.setIcon(new ImageIcon(texturen.getTextur(aktuellesSpiel.getKartensatz().getletzteKarte()).getScaledInstance(150, 210, Image.SCALE_SMOOTH)));
|
|
|
|
ablagestapel.revalidate();
|
|
|
|
ablagestapel.revalidate();
|
|
|
|
ablagestapel.repaint();
|
|
|
|
ablagestapel.repaint();
|
|
|
|
}
|
|
|
|
}
|
|
|
|