View Javadoc

1   /**
2    * This program is free software: you can redistribute it and/or modify
3    * it under the terms of the GNU General Public License as published by
4    * the Free Software Foundation, version 3.
5    *
6    * This program is distributed in the hope that it will be useful,
7    * but WITHOUT ANY WARRANTY; without even the implied warranty of
8    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9    * GNU General Public License for more details.
10   *
11   * You should have received a copy of the GNU General Public License
12   * along with this program. If not, see <http://www.gnu.org/licenses/>.
13   */
14  
15  package net.curre.prefcount.gui;
16  
17  import java.beans.PropertyChangeEvent;
18  import java.beans.PropertyChangeListener;
19  import java.util.ResourceBundle;
20  import javax.swing.*;
21  
22  import net.curre.prefcount.App;
23  import net.curre.prefcount.PrefCountRegistry;
24  import net.curre.prefcount.gui.aa.AAJOptionPane;
25  
26  /**
27   * Object of this class represents an about information pane.
28   * <p/>
29   * Created date: Jan 27, 2008
30   *
31   * @author Yevgeny Nyden
32   */
33  public class AboutJOptionPane extends AAJOptionPane implements PropertyChangeListener {
34  
35    private static ImageIcon ICON;
36  
37    static {
38      ICON = new ImageIcon(App.class.getResource("images/PrefCount-48x48.png"));
39    }
40  
41    /** Creats an about JOptionPane object. */
42    public AboutJOptionPane() {
43      super(ResourceBundle.getBundle("default").getString("pref.aboutFrame.message"),
44            JOptionPane.INFORMATION_MESSAGE,
45            JOptionPane.DEFAULT_OPTION,
46            ICON);
47      super.addPropertyChangeListener(this);
48    }
49  
50    /** Closes the about information pane. */
51    public void propertyChange(PropertyChangeEvent propertyChangeEvent) {
52      if (propertyChangeEvent.getPropertyName().equals(JOptionPane.VALUE_PROPERTY)) {
53        PrefCountRegistry.getInstance().getMainWindow().closeAnimatedInnerPanel();
54      }
55    }
56  
57  }