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

📄 aboutdialog.java

📁 java写的qq代码实现qq的部分功能
💻 JAVA
字号:
/*
* LumaQQ - Java QQ Client
*
* Copyright (C) 2004 luma <stubma@163.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package edu.tsinghua.lumaqq.ui.dialogs;

import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.TitleAreaDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Shell;

import edu.tsinghua.lumaqq.Colors;
import edu.tsinghua.lumaqq.IconHolder;
import edu.tsinghua.lumaqq.LumaQQ;
import edu.tsinghua.lumaqq.ui.tool.UITool;

/**
 * 关于对话框
 * 
 * @author luma
 */
public class AboutDialog extends TitleAreaDialog {
    /**
     * @param parentShell
     */
    public AboutDialog(Shell parentShell) {
        super(parentShell);        
    }
    
    /* (non-Javadoc)
     * @see org.eclipse.jface.window.Window#configureShell(org.eclipse.swt.widgets.Shell)
     */
    protected void configureShell(Shell newShell) {
        newShell.setText(LumaQQ.getString("about.title"));
        newShell.setImage(IconHolder.getInstance().getImage(IconHolder.icoAbout));
    }
    
    /* (non-Javadoc)
     * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
     */
    protected Control createDialogArea(Composite parent) {
        Composite composite = (Composite)super.createDialogArea(parent);        
        
        UITool.setDefaultBackground(Colors.WHITE);
        
        Composite c = UITool.createContainer(composite, new GridData(GridData.FILL_BOTH), new GridLayout(2, true));        
        
        Group contriGroup = UITool.createGroup(c, LumaQQ.getString("about.group.contributor"), new GridData(GridData.FILL_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL), new GridLayout());
        UITool.createLabel(contriGroup, "三三");
        UITool.createLabel(contriGroup, "notXX@smth");
        UITool.createLabel(contriGroup, "Gavin@smth");
        UITool.createLabel(contriGroup, "gnulinux@smth");
        UITool.createLabel(contriGroup, "sdumjr@smth");
        UITool.createLabel(contriGroup, "civet@linuxsir");
        UITool.createLabel(contriGroup, "e-xiaobin@X-SAiRE");
        UITool.createLabel(contriGroup, "zening@gmail");
        
        Group thankGroup = UITool.createGroup(c, LumaQQ.getString("about.group.thanks"), new GridData(GridData.FILL_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL), new GridLayout());
        UITool.createLabel(thankGroup, "Chicyu@smth");
        UITool.createLabel(thankGroup, "hongjq@smth");
        UITool.createLabel(thankGroup, "wqfox@smth");
        UITool.createLabel(thankGroup, "j4me@smth");
        UITool.createLabel(thankGroup, "henryouly@linuxsir");
        UITool.createLabel(thankGroup, "jeff_yecn@linuxsir");
        UITool.createLabel(thankGroup, "puzzlebird@linuxsir");
        UITool.createLabel(thankGroup, "webzi@linuxsir");
        UITool.createLabel(thankGroup, "Yuking@linuxsir");
        UITool.createLabel(thankGroup, "Winnie@qq");
        UITool.createLabel(thankGroup, "OpenQ Team");
        UITool.createLabel(thankGroup, "isQ Team");
        
        setTitle(LumaQQ.getString("about.version", new Object[] { LumaQQ.getString("update.time") }));
        setMessage(LumaQQ.getString("about.message"));
        setTitleImage(IconHolder.getInstance().getImage(IconHolder.icoAboutTitleImage));

        return composite;
    }
    
    /* (non-Javadoc)
     * @see org.eclipse.jface.dialogs.Dialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
     */
    protected void createButtonsForButtonBar(Composite parent) {
        createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true).addMouseListener(new MouseAdapter() {
            /* (non-Javadoc)
             * @see org.eclipse.swt.events.MouseAdapter#mouseDown(org.eclipse.swt.events.MouseEvent)
             */
            public void mouseDown(MouseEvent e) {
                if(e.stateMask == SWT.CONTROL)
                    setTitleImage(IconHolder.getInstance().getImage(IconHolder.icoMe));
            }
        });
    }
    
    /* (non-Javadoc)
     * @see org.eclipse.jface.window.Window#getInitialLocation(org.eclipse.swt.graphics.Point)
     */
    protected Point getInitialLocation(Point initialSize) {
		// 窗口居中
		Rectangle displayRect = getShell().getDisplay().getClientArea();
		return new Point((displayRect.width - initialSize.x) / 2, (displayRect.height - initialSize.y) / 2);
    }
}

⌨️ 快捷键说明

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