⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bsaboutdialog.java

📁 一款即时通讯软件
💻 JAVA
字号:
package edu.ou.kmi.buddyspace.gui;

/*
 * BSAboutDialog.java
 *
 * Project: BuddySpace
 * (C) Copyright Knowledge Media Institute 2002
 *
 *
 * Created on 9 October 2002, 8:23
 */

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import java.net.*;
import javax.swing.event.*;

import org.jabber.jabberbeans.*;
import org.jabber.jabberbeans.util.*;

import edu.ou.kmi.buddyspace.gui.*;

/**
 * About dialog showing the basic product info.
 *
 * @author  Jiri Komzak, Knowledge Media Institute, Open University, United Kingdom
 */

public class BSAboutDialog extends JDialog
                           implements ActionListener, HyperlinkListener {

    private JButton okButton;
    private JEditorPane infoPane;
    private BSMainFrame parent;

    /** Constructor */
    BSAboutDialog(BSMainFrame parent) {
        super(parent, "About", true);

        this.parent = parent;

        Container pane = getContentPane();
        pane.setLayout(new GridBagLayout());

        GridBagConstraints constr;

        JLabel label1 = new JLabel("<html><center>" +
                                   "<h2>BuddySpace<sup><small>TM</small></sup> &amp; BuddySpace2<sup><small>TM</small></sup></h2>" +
                                   "<i>Version 2.8</i><br><br> " +
                                   "Copyright &copy; 2000-2005, " +
                                   "Knowledge Media Institute,<br>" +
                                   "The Open University, UK" +
                                   "</center></html>");
        constr = new GridBagConstraints();
        constr.gridy = 1;
        constr.anchor = GridBagConstraints.CENTER;
        constr.insets = new Insets(10,10,10,10);
        pane.add(label1, constr);

        Icon icon = new ImageIcon(ClassLoader.getSystemResource("images/logo.gif"));
        JLabel iconLabel = new JLabel(icon);
        constr = new GridBagConstraints();
        constr.gridy = 2;
        pane.add(iconLabel, constr);

        /*Icon icon2 = new ImageIcon(ClassLoader.getSystemResource("images/jabber-powered-20.png"));
        JLabel iconLabel2 = new JLabel(icon2);
        constr = new GridBagConstraints();
        constr.gridx = 1; constr.gridy = 4;
        constr.insets = new Insets(10,0,0,0);
        pane.add(iconLabel2, constr);*/

        infoPane = new JEditorPane();
        infoPane.setContentType("text/html");
        /*try {infoPane.setPage("http://jabber.open.ac.uk");}
        catch (java.io.IOException e) {};*/
        infoPane.setText(
                   "<html><body><center>" +
                   "<table cellspacing=\"0\" cellpadding=\"0\">" +
                   "<tr><td align=\"right\">Client architecture &amp; implementation:</td> " +
                   "<td align=\"left\">&nbsp; Jiri Komzak</td></tr> " +
                   "<tr><td align=\"right\">Enhanced presence architect:</td> " +
                   "<td align=\"left\">&nbsp; Martin Dzbor</td></tr> " +
                   "<tr><td align=\"right\">BuddyFinder and SimLink extensions:</td> " +
                   "<td align=\"left\">&nbsp; Chris Denham</td></tr> " +
                   "<tr><td align=\"right\">Automatic roster and server hooks:</td> " +
                   "<td align=\"left\">&nbsp; Adam Sporka</td></tr> " +
                   "<tr><td align=\"right\">Client and website graphic design:</td> " +
                   "<td align=\"left\">&nbsp; Harriett Cornish</td></tr> " +
                   "<tr><td align=\"right\">BuddySpace website:</td> " +
                   "<td align=\"left\">&nbsp; Damian Dadswell</td></tr> " +
                   "<tr><td align=\"right\">World maps:</td> " +
                   "<td align=\"left\">&nbsp; Ray Munns</td></tr> " +
                   "<tr><td align=\"right\">Project principal investigator:</td> " +
                   "<td align=\"left\">&nbsp; Marc Eisenstadt</td></tr></table> " +

                   "<br>Since 1st February 2004, work on BuddySpace has been " +
                   "funded by the European Union Sixth Framework Programme under " +
                   "Integrated Project 2205, \"ELeGI (European Learning Grid " +
                   "Infrastructure)\", which falls under the heading of EU " +
                   "Information Society Technologies Priority 2.3.1.12 " +
                   "(Technology-enhanced learning and access to cultural heritage).<br>" +

                   "<br>Earlier sources of funding were crucial in the original " +
                   "creation of BuddySpace. In particular, " +
                   "we gratefully acknowledge funding support from " +
                   "the Advanced Knowledge Technologies (AKT) " +
                   "Interdisciplinary Research Collaboration (IRC), " +
                   "which is sponsored by the UK Engineering and " +
                   "Physical Sciences Research Council under grant " +
                   "number GR/N15764/01.<br>" +
                   "Full project details: " +
                   "<a href=\"http://www.aktors.org\">www.aktors.org</a> " +
                   "and <a href=\"http://www.aktors.org/coakting\">www.aktors.org/coakting</a>" +

                   "<br><br>BuddySpace project details: " +
                   "<a href=\"http://kmi.open.ac.uk/projects/buddyspace/\">" +
                   "http://kmi.open.ac.uk/projects/buddyspace/</a><br><br> " +

                   "Portions created by or assigned to Jabber.com, Inc. " +
                   "are Copyright &copy; 1999-2000 Jabber.com, Inc.  All Rights Reserved.<br> " +
                   "Contact information for Jabber.com, Inc. is available at " +
                   "<a href=\"http://www.jabber.com/\">http://www.jabber.com/</a>.<br> " +
                   "Portions Copyright &copy; 1998-1999 Jeremie Miller." +

                   "<br><br>This product includes software developed by L2FProd.com<br> " +
                   "(<a href=\"http://www.L2FProd.com/\">http://www.L2FProd.com/</a>)." +

                   "<br><br>For full licenses see documentation." +
                   "</center></body></html>");
        infoPane.addHyperlinkListener(this);
        infoPane.setEditable(false);
        JScrollPane scrollPane = new JScrollPane(infoPane);
        scrollPane.setAutoscrolls(true);
        scrollPane.setPreferredSize(new Dimension(350, 170));
        constr = new GridBagConstraints();
        constr.gridy = 5;
        constr.weightx = 1; constr.weighty = 1;
        constr.fill = GridBagConstraints.HORIZONTAL;
        constr.insets = new Insets(10,10,10,10);
        pane.add(scrollPane, constr);

        okButton = new JButton("OK");
        okButton.addActionListener(this);
        constr = new GridBagConstraints();
        constr.gridy = 7;
        constr.insets = new Insets(10,10,10,10);
        pane.add(okButton, constr);

        pack();
        setLocationRelativeTo(parent);

        addWindowListener(new WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent windowEvent) {
                infoPane.scrollRectToVisible(new Rectangle(0, 0, 1, 1));
            }
        });
    }

    /** Closes on OK button click */
    public void actionPerformed(ActionEvent evt) {
        Object src = evt.getSource();

        if (src == okButton)
            setVisible(false);
    }

    /** Called when link action performed - calls open link in extern browser */
    public void hyperlinkUpdate(HyperlinkEvent evt) {
        if (HyperlinkEvent.EventType.ACTIVATED == evt.getEventType()) {
            URL url = evt.getURL();
            if (url == null) return;
            JID jid = new JID(url.toString());
            String namespace = "http";
            if (parent != null)
                parent.performAction(jid, namespace);
        }
    }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -