public Cascade(boolean b, Main m){
if(b){
this.m=m;
initComponents();
initConfig();
repaint();
}
}//End Construktor
private void initComponents(){
leftSidePanel.setLayout(new FlowLayout());
rightSidePanel.setLayout(new BorderLayout());
this.setLayout(new BorderLayout());
modeSwitch.setEnabled(false);
switchStones.setEnabled(false);
leftSidePanel.add(playerALabel);
leftSidePanel.add(switchStones);
leftSidePanel.add(modeSwitch);
leftSidePanel.add(playerBLabel);
switchStones.addActionListener(this);
modeSwitch.addActionListener(this);
playerALabel.setBackground(CLIENTBOWL);
playerBLabel.setBackground(SPIELFELDCOLOR);
this.add(leftSidePanel, BorderLayout.NORTH);
this.add(rightSidePanel, BorderLayout.CENTER);
this.setVisible(true);
}
private void initConfig(){
if (m.readConfigDialogFromMain()!=null){
configDialog = m.readConfigDialogFromMain();
}
else{
configDialog = new ConfigDialog(m);
}
configDialog.setModal(true);
configDialog.setVisible(true);
modeSwitch.setEnabled(true);
switchStones.setEnabled(true);
this.getSizeOfField();
this.maxSwitchAvailable = configDialog.getMaxSwitch();
this.beginner = configDialog.getBeginner();
this.getPlayerLabels();
this.setPlayMode(configDialog.getPlayMode());
m.setSize(this.getWidth(), this.getHeight());
m.repaint();
}