Permalink
Browse files

stub in TODOs

  • Loading branch information...
1 parent ba4e71e commit 8c81d43369af1225a611b101ff59a482a63b69b4 @xiongchiamiov committed Oct 7, 2011
Showing with 28 additions and 1 deletion.
  1. +28 −1 Mahjongg2D.java
View
@@ -164,11 +164,26 @@ private void layoutMenus()
mnuItems[0].addActionListener(this);
mnuGame.add(mnuItems[0]);
+ mnuItems[1] = new JMenuItem("New Game");
+ mnuItems[1].setAccelerator(KeyStroke.getKeyStroke('N', ActionEvent.ALT_MASK));
+ mnuItems[1].addActionListener(this);
+ mnuGame.add(mnuItems[1]);
+
+ mnuItems[2] = new JMenuItem("Hint");
+ mnuItems[2].setAccelerator(KeyStroke.getKeyStroke('H', ActionEvent.ALT_MASK));
+ mnuItems[2].addActionListener(this);
+ mnuGame.add(mnuItems[2]);
+
mnuItems[3] = new JMenuItem("Cheat");
mnuItems[3].setAccelerator(KeyStroke.getKeyStroke('C', ActionEvent.ALT_MASK));
mnuItems[3].addActionListener(this);
mnuGame.add(mnuItems[3]);
+ mnuItems[4] = new JMenuItem("Quit");
+ mnuItems[4].setAccelerator(KeyStroke.getKeyStroke('Q', ActionEvent.ALT_MASK));
+ mnuItems[4].addActionListener(this);
+ mnuGame.add(mnuItems[4]);
+
setJMenuBar(menuBar); // tell the frame which menu bar to use
}
@@ -270,7 +285,15 @@ public void actionPerformed(ActionEvent e)
// Does the user want to restart the current game?
if ("Restart".equals(e.getActionCommand()))
{
- // call restart method
+ // TODO
+ }
+ else if ("New Game".equals(e.getActionCommand()))
+ {
+ // TODO
+ }
+ else if ("Hint".equals(e.getActionCommand()))
+ {
+ // TODO
}
else if ("Cheat".equals(e.getActionCommand()))
{
@@ -280,6 +303,10 @@ else if ("Cheat".equals(e.getActionCommand()))
this.tileCount = 2;
updateStatusBar();
}
+ else if ("Quit".equals(e.getActionCommand()))
+ {
+ // TODO
+ }
repaint();
}

0 comments on commit 8c81d43

Please sign in to comment.