OSDN Git Service

a8673063e6818733c15460052701e625bdc969c4
[sudokuki/sudokuki.git] / src / classes / net / jankenpoi / sudokuki / ui / swing / ClearAllMovesAction.java
1 /*\r
2  * Sudokuki - essential sudoku game\r
3  * Copyright (C) 2007-2013 Sylvain Vedrenne\r
4  *\r
5  * This program is free software: you can redistribute it and/or modify\r
6  * it under the terms of the GNU General Public License as published by\r
7  * the Free Software Foundation, either version 3 of the License, or\r
8  * (at your option) any later version.\r
9  * \r
10  * This program is distributed in the hope that it will be useful,\r
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
13  * GNU General Public License for more details.\r
14  * \r
15  * You should have received a copy of the GNU General Public License\r
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
17  */\r
18 package net.jankenpoi.sudokuki.ui.swing;\r
19 \r
20 import java.awt.event.ActionEvent;\r
21 \r
22 import javax.swing.AbstractAction;\r
23 import javax.swing.Icon;\r
24 \r
25 import net.jankenpoi.sudokuki.view.GridView;\r
26 \r
27 @SuppressWarnings("serial")\r
28 public class ClearAllMovesAction extends AbstractAction {\r
29 \r
30         private GridView view;\r
31 \r
32         public ClearAllMovesAction(String text, Icon icon,\r
33                         String desc, Integer mnemonic, GridView view) {\r
34                 super(text, icon);\r
35                 \r
36                 putValue(SHORT_DESCRIPTION, desc);\r
37                 putValue(MNEMONIC_KEY, mnemonic);\r
38 \r
39                 this.view = view;\r
40         }\r
41 \r
42         @Override\r
43         public void actionPerformed(ActionEvent e) {\r
44                 view.getController().notifyClearAllMovesRequested();\r
45         }\r
46 \r
47 }\r