001: /*
002: * $RCSfile: AboutAction.java,v $
003: * @modification $Date: 2002/12/16 13:23:45 $
004: * @version $Id: AboutAction.java,v 1.2 2002/12/16 13:23:45 deniger Exp $
005: *
006: */
007:
008: package com.memoire.vainstall.builder.action;
009:
010: import com.memoire.vainstall.VAGlobals;
011: import com.memoire.vainstall.builder.gui.AboutVAIBuilderFrame;
012: import com.memoire.vainstall.builder.util.*;
013:
014: import java.awt.Rectangle;
015: import java.awt.event.*;
016:
017: import javax.swing.*;
018:
019: /**
020: * This is action that handles the About window.
021: *
022: * @see com.memoire.vainstall.builder.action.AbstractVAIBuilderAction
023: * @see com.memoire.vainstall.builder.gui.AboutVAIBuilderFrame
024: * @see java.awt.event.WindowListener
025: *
026: * @author Henrik Falk
027: * @version $Id: AboutAction.java,v 1.2 2002/12/16 13:23:45 deniger Exp $
028: */
029: public class AboutAction extends AbstractVAIBuilderAction implements
030: WindowListener {
031:
032: /**
033: * We keep a reference to the window to have only one opened window
034: * and keep track of the window bounds
035: */
036: AboutVAIBuilderFrame about;
037:
038: /**
039: * Default constructor
040: */
041: public AboutAction() {
042: super ();
043: }
044:
045: /**
046: * Implements the runnit method which show the About window
047: */
048: public void runnit() {
049:
050: // if show before then restore window and show it
051: if (about != null) {
052: // about.setExtendedState(JFrame.NORMAL);
053: about.setVisible(true);
054: return;
055: }
056:
057: // create window and listen to windowDeactivated()
058: about = new AboutVAIBuilderFrame();
059: about.addWindowListener(this );
060:
061: // set bounds from properties
062: if (getModel().getWindowList().get("AboutVAIBuilderFrame") == null) {
063: ((AboutVAIBuilderFrame) about).center();
064: } else {
065: about.setBounds((Rectangle) getModel().getWindowList().get(
066: "AboutVAIBuilderFrame"));
067: }
068:
069: // create nodes for tree in window
070: HtmlNode root = new HtmlNode();
071: root.initialize(VAGlobals.getResource(
072: "com.memoire.vainstall.builder.Language",
073: "AboutAction_AboutName"), VAGlobals.getResource(
074: "com.memoire.vainstall.builder.Language",
075: "AboutAction_AboutTitle"),
076: "/com/memoire/vainstall/builder/resources/about.html");
077:
078: HtmlNode copyrights = new HtmlNode();
079: copyrights
080: .initialize(
081: VAGlobals
082: .getResource(
083: "com.memoire.vainstall.builder.Language",
084: "AboutAction_CopyrightName"),
085: VAGlobals
086: .getResource(
087: "com.memoire.vainstall.builder.Language",
088: "AboutAction_CopyrightTitle"),
089: "/com/memoire/vainstall/builder/resources/copyrights.html");
090: root.add(copyrights);
091:
092: about.setNode(root);
093:
094: about.setVisible(true);
095:
096: }
097:
098: /**
099: * Method to handle events for the WindowListener interface.
100: * @param e java.awt.event.WindowEvent
101: */
102: public void windowActivated(java.awt.event.WindowEvent e) {
103: }
104:
105: /**
106: * Method to handle events for the WindowListener interface.
107: * @param e java.awt.event.WindowEvent
108: */
109: public void windowClosed(java.awt.event.WindowEvent e) {
110: }
111:
112: /**
113: * Method to handle events for the WindowListener interface.
114: * @param e java.awt.event.WindowEvent
115: */
116: public void windowClosing(java.awt.event.WindowEvent e) {
117: }
118:
119: /**
120: * Method to handle events for the WindowListener interface.
121: * @param e java.awt.event.WindowEvent
122: */
123: public void windowDeactivated(java.awt.event.WindowEvent e) {
124: getModel().getWindowList().put("AboutVAIBuilderFrame",
125: about.getBounds());
126: }
127:
128: /**
129: * Method to handle events for the WindowListener interface.
130: * @param e java.awt.event.WindowEvent
131: */
132: public void windowDeiconified(java.awt.event.WindowEvent e) {
133: }
134:
135: /**
136: * Method to handle events for the WindowListener interface.
137: * @param e java.awt.event.WindowEvent
138: */
139: public void windowIconified(java.awt.event.WindowEvent e) {
140: }
141:
142: /**
143: * Method to handle events for the WindowListener interface.
144: * @param e java.awt.event.WindowEvent
145: */
146: public void windowOpened(java.awt.event.WindowEvent e) {
147: }
148:
149: }
|