99 lines
2.9 KiB
Java
99 lines
2.9 KiB
Java
import java.awt.*;
|
|
import javax.swing.JFrame;
|
|
import javax.swing.*;
|
|
|
|
/**
|
|
* TODO fertig beschreiben
|
|
*/
|
|
public class MultiMenuView {
|
|
int semesterCounter = 1;
|
|
private JPanel multiPanel = new JPanel(null);
|
|
|
|
private ImageIcon humanPlayerIcon = new ImageIcon("graphics/humanPlayer.png");
|
|
private ImageIcon aiPlayerIcon = new ImageIcon("graphics/aiPlayer.png");
|
|
|
|
JButton PlayerLeftButton = new JButton("<-");
|
|
JButton PlayerRightButton = new JButton("->");
|
|
JButton semesterUpButton = new JButton("^");
|
|
JButton semesterDownButton = new JButton("v");
|
|
|
|
JLabel semesterLabel = new JLabel("Semester");
|
|
private JLabel titelLabel = new JLabel("Multiplayer");
|
|
private JLabel PlayerIcon = new JLabel(humanPlayerIcon);
|
|
private JLabel PlayerName = new JLabel("Name");
|
|
private JTextField PlayerTextField = new JTextField(20);
|
|
JLabel semesterCounterLabel = new JLabel(String.valueOf(semesterCounter));
|
|
|
|
private Font robotoFont = new Font("Roboto", Font.BOLD, 45);
|
|
public MultiMenuView() {
|
|
buildPanel();
|
|
}
|
|
|
|
/**
|
|
* TODO fertig beschreiben
|
|
*/
|
|
public void buildPanel(){
|
|
titelLabel.setBounds(20,20,700,100);
|
|
PlayerIcon.setBounds(75, 400, 200, 128);
|
|
PlayerName.setBounds(50, 625, 200, 30);
|
|
PlayerTextField.setBounds(50, 650, 250, 50);
|
|
semesterCounterLabel.setBounds(725, 475, 50, 50); // zwischen den Up/Down-Buttons
|
|
PlayerLeftButton.setBounds(50, 450, 50, 50);
|
|
PlayerRightButton.setBounds(250, 450, 50, 50);
|
|
semesterLabel.setBounds(500, 400, 200, 30);
|
|
semesterUpButton.setBounds(700, 400, 50, 50);
|
|
semesterDownButton.setBounds(700, 550, 50, 50);
|
|
|
|
|
|
multiPanel.setLayout(null);
|
|
titelLabel.setFont(robotoFont.deriveFont(50f));
|
|
semesterLabel.setFont(robotoFont.deriveFont(20f));
|
|
|
|
multiPanel.add(PlayerName);
|
|
multiPanel.add(titelLabel);
|
|
multiPanel.add(PlayerIcon);
|
|
multiPanel.add(PlayerTextField);
|
|
multiPanel.add(semesterCounterLabel);
|
|
multiPanel.add(semesterUpButton);
|
|
multiPanel.add(semesterDownButton);
|
|
multiPanel.add(PlayerLeftButton);
|
|
multiPanel.add(PlayerRightButton);
|
|
multiPanel.add(semesterLabel);
|
|
}
|
|
|
|
/**
|
|
* TODO fertig beschreiben
|
|
* @return
|
|
*/
|
|
public JPanel getMultiPanel() {
|
|
return multiPanel;
|
|
}
|
|
|
|
/**
|
|
* TODO fertig beschreiben
|
|
*/
|
|
public void togglePlayerIcon() {
|
|
if (PlayerIcon.getIcon() == humanPlayerIcon) {
|
|
PlayerIcon.setIcon(aiPlayerIcon);
|
|
} else {
|
|
PlayerIcon.setIcon(humanPlayerIcon);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* TODO fertig beschreiben
|
|
* @return
|
|
*/
|
|
public JButton getPlayerLeftButton() {
|
|
return PlayerLeftButton;
|
|
}
|
|
|
|
/**
|
|
* TODO fertig beschreiben
|
|
* @return
|
|
*/
|
|
public JButton getPlayerRightButton() {
|
|
return PlayerRightButton;
|
|
}
|
|
}
|