Skip to content

Commit

Permalink
bump to v0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
xehpuk committed Oct 25, 2020
1 parent 981725c commit 71c523d
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/mine/MineMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class MineMenu extends JMenuBar implements ItemListener {

public MineMenu() {
super();

final JMenu gameMenu = new JMenu("Spiel");
gameMenu.setMnemonic(KeyEvent.VK_S);
final JMenuItem newGame = new JMenuItem("Neu");
Expand Down Expand Up @@ -116,7 +116,7 @@ public void actionPerformed(ActionEvent e) {
}
});
gameMenu.add(quit);

beginners.addItemListener(this);
advanced.addItemListener(this);
pros.addItemListener(this);
Expand All @@ -129,9 +129,9 @@ public void actionPerformed(ActionEvent e) {
MineFrame.getInstance().getDialog().setVisible(true);
}
});

add(gameMenu);

final JMenu viewMenu = new JMenu("Ansicht");
viewMenu.setMnemonic(KeyEvent.VK_A);
final JMenuItem screen = new JMenuItem("Screenshot");
Expand Down Expand Up @@ -208,10 +208,10 @@ public void itemStateChanged(ItemEvent e) {
lookAndFeelRadioButton.addItemListener(lookAndFeelListener);
lookAndFeelMenu.add(lookAndFeelRadioButton);
}

viewMenu.add(lookAndFeelMenu);
add(viewMenu);

final JMenu helpMenu = new JMenu("?");
helpMenu.setMnemonic('?');
final JMenuItem help = new JMenuItem("Hilfe");
Expand All @@ -223,43 +223,43 @@ public void itemStateChanged(ItemEvent e) {
info.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
JOptionPane.showMessageDialog(MineFrame.getInstance(), "MineSweeper v0.4.1 by xehpuk", "Info", JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(MineFrame.getInstance(), "MineSweeper v0.4.2 by xehpuk", "Info", JOptionPane.INFORMATION_MESSAGE);
}
});
// TODO update info (JEditorPane?)
helpMenu.add(info);
add(helpMenu);
}

public final MineFileChooser getFileChooser() {
return fileChooser;
}

@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.DESELECTED)
setOldMode((JRadioButtonMenuItem) e.getItemSelectable());
else
setCurrentMode((JRadioButtonMenuItem) e.getItemSelectable());;
}

public final JRadioButtonMenuItem getCurrentMode() {
return currentMode;
}

public final void setCurrentMode(JRadioButtonMenuItem currentMode) {
this.currentMode = currentMode;
}

public void setOldMode(JRadioButtonMenuItem itemSelectable) {
oldMode = itemSelectable;
}

public void restoreMode() {
getOldMode().setSelected(true);
}

private final JRadioButtonMenuItem getOldMode() {
return oldMode;
}
}
}

0 comments on commit 71c523d

Please sign in to comment.