fix merge conflict
parent
100cf4712c
commit
73768473e1
|
|
@ -225,10 +225,10 @@ public class SpielFrame extends JFrame {
|
||||||
this.setDefaultBackground();
|
this.setDefaultBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Switches the button actions depending on the boardmode
|
* Switches the button actions depending on the boardmode
|
||||||
*/
|
*/
|
||||||
private void setButtonsActions() {
|
public void setButtonsActions() {
|
||||||
|
|
||||||
List<Square> selectables;
|
List<Square> selectables;
|
||||||
|
|
||||||
|
|
@ -272,10 +272,10 @@ public class SpielFrame extends JFrame {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (JButton b : buttons) {
|
for (JButton b : buttons) {
|
||||||
panelLinks.add(b);
|
panelLinks.add(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showWin(int player) {
|
public void showWin(int player) {
|
||||||
JFrame frame = new JFrame("Result");
|
JFrame frame = new JFrame("Result");
|
||||||
|
|
@ -283,20 +283,20 @@ public class SpielFrame extends JFrame {
|
||||||
frame.setSize(300, 150);
|
frame.setSize(300, 150);
|
||||||
frame.setLayout(null);
|
frame.setLayout(null);
|
||||||
|
|
||||||
JLabel jl = new JLabel(String.format("%d - %d", player / 2, player % 2));
|
JLabel jl = new JLabel(String.format("%d - %d", player / 2, player % 2));
|
||||||
jl.setBounds(50, 30, 200, 25);
|
jl.setBounds(50, 30, 200, 25);
|
||||||
jl.setFont(new Font("Tahoma", Font.BOLD, 20));
|
jl.setFont(new Font("Tahoma", Font.BOLD, 20));
|
||||||
frame.add(jl);
|
frame.add(jl);
|
||||||
frame.setVisible(true);
|
frame.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showResult(String res) {
|
public void showResult(String res) {
|
||||||
|
|
||||||
ausgabe.setFont(new Font("Calibri", Font.BOLD, 40));
|
ausgabe.setFont(new Font("Calibri", Font.BOLD, 40));
|
||||||
ausgabe.setForeground(new Color(178, 34, 34));
|
ausgabe.setForeground(new Color(178, 34, 34));
|
||||||
ausgabe.setText(" "+res);
|
ausgabe.setText(" " + res);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int showPromotion() {
|
public int showPromotion() {
|
||||||
final int[] result = { -1 };
|
final int[] result = { -1 };
|
||||||
|
|
@ -416,14 +416,14 @@ public class SpielFrame extends JFrame {
|
||||||
|
|
||||||
aufgebenUndo.add(Box.createHorizontalStrut(10));
|
aufgebenUndo.add(Box.createHorizontalStrut(10));
|
||||||
|
|
||||||
aufgeben2 = new JButton("Aufgeben");
|
aufgeben2 = new JButton("Aufgeben");
|
||||||
aufgeben2.setBackground(Color.LIGHT_GRAY);
|
aufgeben2.setBackground(Color.LIGHT_GRAY);
|
||||||
aufgeben2.setForeground(Color.BLACK);
|
aufgeben2.setForeground(Color.BLACK);
|
||||||
aufgeben2.setFont(new Font("Tahoma", Font.BOLD, 16));
|
aufgeben2.setFont(new Font("Tahoma", Font.BOLD, 16));
|
||||||
aufgeben2.setAlignmentX(Component.CENTER_ALIGNMENT);
|
aufgeben2.setAlignmentX(Component.CENTER_ALIGNMENT);
|
||||||
|
|
||||||
aufgeben2.addActionListener(new ButtonAufgebenListener(this, this.game));
|
aufgeben2.addActionListener(new ButtonAufgebenListener(this, this.game));
|
||||||
aufgebenUndo.add(aufgeben2);
|
aufgebenUndo.add(aufgeben2);
|
||||||
|
|
||||||
aufgebenUndo.add(Box.createHorizontalStrut(10));
|
aufgebenUndo.add(Box.createHorizontalStrut(10));
|
||||||
|
|
||||||
|
|
@ -524,14 +524,14 @@ public class SpielFrame extends JFrame {
|
||||||
|
|
||||||
aufgebenUndo.add(Box.createHorizontalStrut(10));
|
aufgebenUndo.add(Box.createHorizontalStrut(10));
|
||||||
|
|
||||||
aufgeben = new JButton("Aufgeben");
|
aufgeben = new JButton("Aufgeben");
|
||||||
aufgeben.setBackground(Color.LIGHT_GRAY);
|
aufgeben.setBackground(Color.LIGHT_GRAY);
|
||||||
aufgeben.setForeground(Color.BLACK);
|
aufgeben.setForeground(Color.BLACK);
|
||||||
aufgeben.setFont(new Font("Tahoma", Font.BOLD, 16));
|
aufgeben.setFont(new Font("Tahoma", Font.BOLD, 16));
|
||||||
aufgeben.setAlignmentX(Component.CENTER_ALIGNMENT);
|
aufgeben.setAlignmentX(Component.CENTER_ALIGNMENT);
|
||||||
aufgeben.addActionListener(new ButtonAufgebenListener(this, this.game));
|
aufgeben.addActionListener(new ButtonAufgebenListener(this, this.game));
|
||||||
|
|
||||||
aufgebenUndo.add(aufgeben);
|
aufgebenUndo.add(aufgeben);
|
||||||
|
|
||||||
aufgebenUndo.add(Box.createHorizontalStrut(10));
|
aufgebenUndo.add(Box.createHorizontalStrut(10));
|
||||||
|
|
||||||
|
|
@ -616,60 +616,20 @@ public class SpielFrame extends JFrame {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public JButton getAufgeben() {
|
public JButton getAufgeben() {
|
||||||
return aufgeben;
|
return aufgeben;
|
||||||
}
|
|
||||||
|
|
||||||
public void setAufgeben(JButton aufgeben) {
|
|
||||||
this.aufgeben = aufgeben;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JButton getAufgeben2() {
|
|
||||||
return aufgeben2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAufgeben2(JButton aufgeben2) {
|
|
||||||
this.aufgeben2 = aufgeben2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMode(BoardMode mode) {
|
|
||||||
this.mode = mode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public void setAufgeben(JButton aufgeben) {
|
||||||
* Inverts the Enabled property of the controlpanelButtons
|
this.aufgeben = aufgeben;
|
||||||
*/
|
|
||||||
public void enableControlPanelButtons() {
|
|
||||||
for (Component c : this.controlPanel.getComponents()) {
|
|
||||||
if (c instanceof JButton) {
|
|
||||||
c.setEnabled(!c.isEnabled());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public JButton getAufgeben2() {
|
||||||
* Adds the buttons to the boardpanel
|
return aufgeben2;
|
||||||
*/
|
|
||||||
public void applyBoardButtons() {
|
|
||||||
for (JButton b : buttons) {
|
|
||||||
panelLinks.add(b);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public JButton getAufgeben() {
|
public void setAufgeben2(JButton aufgeben2) {
|
||||||
return aufgeben;
|
this.aufgeben2 = aufgeben2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAufgeben(JButton aufgeben) {
|
|
||||||
this.aufgeben = aufgeben;
|
|
||||||
}
|
|
||||||
|
|
||||||
public JButton getAufgeben2() {
|
|
||||||
return aufgeben2;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAufgeben2(JButton aufgeben2) {
|
|
||||||
this.aufgeben2 = aufgeben2;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue