Generated on Fri Oct 6 16:26:43 2006 for Gecode/J by doxygen 1.4.7

AboutWindow.java

Go to the documentation of this file.
00001 /*
00002  *  Main authors:
00003  *     Mikael Lagerkvist <lagerkvist@gecode.org>
00004  *     Guido Tack <tack@gecode.org>
00005  *
00006  *  Copyright:
00007  *     Mikael Lagerkvist, 2006
00008  *     Guido Tack, 2006
00009  *
00010  *  Last modified:
00011  *     $Date: 2006-02-09 17:28:21 +0100 (Thu, 09 Feb 2006) $ by $Author: tack $
00012  *     $Revision: 2944 $
00013  *
00014  *  This file is part of Gecode, the generic constraint
00015  *  development environment:
00016  *     http://www.gecode.org
00017  *
00018  *  See the file "LICENSE" for information on usage and
00019  *  redistribution of this file, and for a
00020  *     DISCLAIMER OF ALL WARRANTIES.
00021  *
00022  */
00023 
00024 package org.gecode.explorer.swing;
00025 
00026 import java.awt.*;
00027 import java.awt.event.*;
00028 import javax.swing.*;
00029 import javax.swing.event.*;
00030 
00031 class AboutWindow extends JDialog implements HyperlinkListener {
00032     public AboutWindow(Frame owner) {
00033         super(owner, "About the Gecode/J Explorer");
00034         setVisible(false);
00035 
00036         String text =
00037             "<HEAD></HEAD><BODY>"+
00038             "<H1 align='center'>The Gecode/J Explorer</H1>"+
00039             "<P align='center'>&copy; 2005,2006 The Gecode Team</P>"+
00040             "<P align='center'><A HREF='/'>"+
00041             "http://www.gecode.org</A></P>"+
00042             "</BODY>";
00043 
00044         JEditorPane ep = new JEditorPane("text/html", text);
00045         ep.setBackground(owner.getBackground());
00046         ep.setEditable(false);
00047         ep.addHyperlinkListener(this);
00048         getContentPane().add(ep);
00049         pack();
00050         setResizable(false);
00051     }
00052     public void open() {
00053         setVisible(true);
00054     }
00055 
00056 
00057     public void hyperlinkUpdate(HyperlinkEvent e) {
00058         if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
00059             try {
00060                 BareBonesBrowserLaunch.openURL("http://www.gecode.org");
00061             } catch (Exception t) {}
00062         }
00063     }
00064 
00065 }