OSDN Git Service

add a little program 'chartool'
[sawarabi-fonts/sawarabi-fonts.git] / chartool / src / jp / sourceforge / sawarabifonts / chartool / JsScriptableObject.java
1 /*
2  * Copyright (C) 2010, mshio <mshio@users.sourceforge.jp>
3  *
4  * This program is free software: you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16  * ---
17  * Require JDK 1.5 (or later)
18  */
19 package jp.sourceforge.sawarabifonts.chartool;
20
21 import javax.swing.JFrame;
22 import javax.swing.JOptionPane;
23
24 import org.mozilla.javascript.ScriptableObject;
25
26 public class JsScriptableObject extends ScriptableObject {
27         private static final long serialVersionUID = 2857654503604299849L;
28
29         private JFrame frame = null;
30
31         @Override
32         public String getClassName() {
33                 return "JsScriptableObject";
34         }
35
36         public void setFrame(JFrame frame) {
37                 this.frame = frame;
38         }
39
40         public void alert(String message) {
41                 if (frame != null) {
42                         JOptionPane.showMessageDialog(frame, message);
43                 }
44         }
45 }