Chinaunix首页 | 论坛 | 博客
  • 博客访问: 543548
  • 博文数量: 855
  • 博客积分: 40000
  • 博客等级: 大将
  • 技术积分: 5005
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-16 19:08
文章分类

全部博文(855)

文章存档

2011年(1)

2008年(854)

我的朋友

分类:

2008-10-16 19:17:35

    有了以上的基础,我们加个游戏管理与界面就可以进行游戏了!呵呵~     /*

     * @(#)ChineseChessGUIView.java

     * Author: 88250 <>,

     * Created on May 26, 2008, 3:52:51 PM

     *

     * 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 3 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 Library 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 cn.edu.ynu.sei.chinesechess.ui;

 

    import org.jdesktop.application.Action;

    import org.jdesktop.application.ResourceMap;

    import org.jdesktop.application.SingleFrameApplication;

    import org.jdesktop.application.FrameView;

    import org.jdesktop.application.TaskMonitor;

    import java.awt.event.ActionEvent;

    import java.awt.event.ActionListener;

    import javax.swing.Timer;

    import javax.swing.Icon;

    import javax.swing.JDialog;

    import javax.swing.JFrame;

 

    /**

     * Chinese chess application's main frame view.

     * @author 88250 <>,

     * @version 1.0.1.4, Jun 4, 2008

     */

    public class ChineseChessGUIView extends FrameView {

 

        /**

         * Constructor with parameter.

         * @param app single frame application

         */

        public ChineseChessGUIView(SingleFrameApplication app) {

            super(app);

 

            initComponents();

 

            // status bar initialization - message timeout, idle icon and busy animation, etc

            ResourceMap resourceMap = getResourceMap();

            int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");

            messageTimer = new Timer(messageTimeout, new ActionListener() {

 

                                 public void actionPerformed(ActionEvent e) {

                                     statusMessageLabel.setText("");

                                     System.out.println("!");

                                 }

                             });

            messageTimer.setRepeats(false);

            int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");

            for (int i = 0; i < busyIcons.length; i++) {

                busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");

            }

            busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {

 

                                  public void actionPerformed(ActionEvent e) {

                                      busyIconIndex = (busyIconIndex + 1) % busyIcons.length;

                                      statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);

                                  }

                              });

 

[1]           ...

【责编:landy】

--------------------next---------------------

阅读(242) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~