ajout d'un bouton d'aideà avec play/pause quand le menu aide est affiché
This commit is contained in:
@@ -14,6 +14,7 @@ public class VueBandeauControle extends JPanel implements Observer {
|
||||
private JLabel scoreLabel;
|
||||
private JPanel nextPiecePanel;
|
||||
private JButton pauseButton;
|
||||
private JButton aideButton;
|
||||
private JPanel[][] caseNextPiece = new JPanel[4][4];
|
||||
private JLabel nbLigneLabel;
|
||||
private JButton quitterButton;
|
||||
@@ -53,13 +54,29 @@ public class VueBandeauControle extends JPanel implements Observer {
|
||||
quitterButton.setPreferredSize(buttonSize);
|
||||
quitterButton.setMargin(margeBoutton);
|
||||
JPanel boutonsPanel = new JPanel();
|
||||
boutonsPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 10, 0));
|
||||
//boutonsPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 10, 0));
|
||||
boutonsPanel.setLayout(new BoxLayout(boutonsPanel, BoxLayout.X_AXIS));
|
||||
boutonsPanel.setOpaque(false);
|
||||
boutonsPanel.add(pauseButton);
|
||||
boutonsPanel.add(Box.createRigidArea(new Dimension(10, 0)));
|
||||
boutonsPanel.add(quitterButton);
|
||||
pauseButton.setFocusable(false);
|
||||
quitterButton.setFocusable(false);
|
||||
|
||||
// AIDE BUTTON
|
||||
aideButton = new JButton("?");
|
||||
aideButton.setToolTipText("AFFICHER L'AIDE");
|
||||
aideButton.setPreferredSize(new Dimension(45, 20));
|
||||
aideButton.setFocusable(false);
|
||||
JPanel footerPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 10, 5));
|
||||
footerPanel.setMaximumSize(new Dimension(Integer.MAX_VALUE, 40));
|
||||
footerPanel.setOpaque(false);
|
||||
footerPanel.add(aideButton);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
add(Box.createVerticalStrut(20));
|
||||
add(scoreLabel);
|
||||
add(Box.createVerticalStrut(20));
|
||||
@@ -68,6 +85,9 @@ public class VueBandeauControle extends JPanel implements Observer {
|
||||
add(nextPiecePanel);
|
||||
add(Box.createVerticalStrut(20));
|
||||
add(boutonsPanel);
|
||||
add(Box.createVerticalGlue()); //force le JPanel à prendre toute la hauteur
|
||||
|
||||
add(footerPanel);
|
||||
|
||||
// setVisible(true);
|
||||
jeu.addObserver(this);
|
||||
@@ -129,6 +149,10 @@ public class VueBandeauControle extends JPanel implements Observer {
|
||||
nextPiecePanel.repaint();
|
||||
}
|
||||
|
||||
public JButton getAideButton() {
|
||||
return aideButton;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(Observable o, Object arg) {
|
||||
if (o instanceof Jeu) {
|
||||
|
||||
Reference in New Issue
Block a user