KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > memoire > vainstall > builder > action > AboutAction


1 /*
2  * $RCSfile: AboutAction.java,v $
3  * @modification $Date: 2002/12/16 13:23:45 $
4  * @version $Id: AboutAction.java,v 1.2 2002/12/16 13:23:45 deniger Exp $
5  *
6  */

7
8 package com.memoire.vainstall.builder.action;
9
10 import com.memoire.vainstall.VAGlobals;
11 import com.memoire.vainstall.builder.gui.AboutVAIBuilderFrame;
12 import com.memoire.vainstall.builder.util.*;
13
14 import java.awt.Rectangle JavaDoc;
15 import java.awt.event.*;
16
17 import javax.swing.*;
18
19 /**
20  * This is action that handles the About window.
21  *
22  * @see com.memoire.vainstall.builder.action.AbstractVAIBuilderAction
23  * @see com.memoire.vainstall.builder.gui.AboutVAIBuilderFrame
24  * @see java.awt.event.WindowListener
25  *
26  * @author Henrik Falk
27  * @version $Id: AboutAction.java,v 1.2 2002/12/16 13:23:45 deniger Exp $
28  */

29 public class AboutAction extends AbstractVAIBuilderAction implements WindowListener {
30
31     /**
32      * We keep a reference to the window to have only one opened window
33      * and keep track of the window bounds
34      */

35     AboutVAIBuilderFrame about;
36
37     /**
38      * Default constructor
39      */

40     public AboutAction() {
41         super();
42     }
43
44     /**
45      * Implements the runnit method which show the About window
46      */

47     public void runnit() {
48
49         // if show before then restore window and show it
50
if (about != null) {
51        // about.setExtendedState(JFrame.NORMAL);
52
about.setVisible(true);
53             return;
54         }
55
56         // create window and listen to windowDeactivated()
57
about = new AboutVAIBuilderFrame();
58         about.addWindowListener(this);
59
60         // set bounds from properties
61
if(getModel().getWindowList().get("AboutVAIBuilderFrame") == null ) {
62             ((AboutVAIBuilderFrame)about).center();
63         } else {
64             about.setBounds((Rectangle JavaDoc)getModel().getWindowList().get("AboutVAIBuilderFrame"));
65         }
66
67         // create nodes for tree in window
68
HtmlNode root = new HtmlNode();
69         root.initialize(VAGlobals.getResource("com.memoire.vainstall.builder.Language","AboutAction_AboutName"),
70             VAGlobals.getResource("com.memoire.vainstall.builder.Language","AboutAction_AboutTitle"),
71             "/com/memoire/vainstall/builder/resources/about.html");
72
73         HtmlNode copyrights = new HtmlNode();
74         copyrights.initialize(VAGlobals.getResource("com.memoire.vainstall.builder.Language","AboutAction_CopyrightName"),
75             VAGlobals.getResource("com.memoire.vainstall.builder.Language","AboutAction_CopyrightTitle"),
76             "/com/memoire/vainstall/builder/resources/copyrights.html");
77         root.add(copyrights);
78
79         about.setNode(root);
80
81         about.setVisible(true);
82         
83     }
84
85      /**
86       * Method to handle events for the WindowListener interface.
87       * @param e java.awt.event.WindowEvent
88       */

89      public void windowActivated(java.awt.event.WindowEvent JavaDoc e) {
90      }
91
92      /**
93       * Method to handle events for the WindowListener interface.
94       * @param e java.awt.event.WindowEvent
95       */

96      public void windowClosed(java.awt.event.WindowEvent JavaDoc e) {
97      }
98
99      /**
100       * Method to handle events for the WindowListener interface.
101       * @param e java.awt.event.WindowEvent
102       */

103      public void windowClosing(java.awt.event.WindowEvent JavaDoc e) {
104      }
105
106      /**
107       * Method to handle events for the WindowListener interface.
108       * @param e java.awt.event.WindowEvent
109       */

110      public void windowDeactivated(java.awt.event.WindowEvent JavaDoc e) {
111          getModel().getWindowList().put("AboutVAIBuilderFrame",about.getBounds());
112      }
113
114      /**
115       * Method to handle events for the WindowListener interface.
116       * @param e java.awt.event.WindowEvent
117       */

118      public void windowDeiconified(java.awt.event.WindowEvent JavaDoc e) {
119      }
120
121      /**
122       * Method to handle events for the WindowListener interface.
123       * @param e java.awt.event.WindowEvent
124       */

125      public void windowIconified(java.awt.event.WindowEvent JavaDoc e) {
126      }
127
128      /**
129       * Method to handle events for the WindowListener interface.
130       * @param e java.awt.event.WindowEvent
131       */

132      public void windowOpened(java.awt.event.WindowEvent JavaDoc e) {
133      }
134
135 }
136
Popular Tags