亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tictactoedialogview.java

?? Myjxta的源代碼 基于JXTA的P2P即時通信系統
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* * TicTacToePanel.java * * Created on February 6, 2005, 6:28 AM */package net.jxta.myjxta.plugins.tictactoe;import info.clearthought.layout.TableLayout;import net.jxta.logging.Logging;import net.jxta.myjxta.View;import net.jxta.myjxta.dialog.Dialog;import net.jxta.myjxta.plugin.PluginView;import net.jxta.myjxta.util.Resources;import javax.swing.*;import javax.swing.border.TitledBorder;import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.MouseAdapter;import java.awt.event.MouseEvent;import java.io.File;import java.util.ArrayList;import java.util.Iterator;import java.util.List;import java.util.logging.Level;import java.util.logging.Logger;/** * @author Jeff Moore */public final class TicTacToeDialogView extends JPanel implements PluginView {    private final int gridRows = 3;    private final int gridColumns = 3;    private static final String NO_RESPONSE_PANEL = "noResponsePanel";    private static final String CONFIG_CHOOSE_ICON_PANEL = "configChooseIconPanel";    public static final String ICON_TYPE_CUSTOM = "IconTypeCustom";    public static final String ICON_TYPE_X = "IconTypeX";    public static final String ICON_TYPE_O = "IconTypeO";    private final TicTacToeGridBox[][] grid = new TicTacToeGridBox[gridRows][gridColumns];    private static final String CONFIG_PANEL = "ConfigPanel";    private static final String GAME_CONTROL_PANEL = "gameControlPanel";    private static final String ERROR_PANEL = "errorPanel";    private final static String DISPLAY_LOCAL_PLAYERS_TURN = "Your Turn!";    private final static String DISPLAY_REMOTE_PLAYERS_TURN = "'s Turn!";    private final static String DISPLAY_SESSION_TTT_DISCONNECTED = "Disconnected";    private final static String DISPLAY_SESSION_TTT_DISCONNECTING = "Disconnecting";    private final static String DISPLAY_SESSION_TTT_ENDED = "Game Over";    private final static String DISPLAY_SESSION_TTT_ENDING = "Game Ending...";    private final static String DISPLAY_SESSION_TTT_STARTING = "Starting";    private final static String DISPLAY_SESSION_TTT_STARTED = "Started";    private final static String DISPLAY_SESSION_TTT_CONNECTED = "Connected";    private final static String DISPLAY_SESSION_TTT_CONNECTING = "Connecting";    private final static String GAME_DRAW = "Draw!!";    private final static String GAME_WON = "Game Won!!";    private final static String GAME_LOST = "Game Lost!!";    private final int blinkVector = 8; //# times to blink    private final int blinkRate = 250; // in milliseconds    private JLabel localPlayerNameLabel = null;    private JLabel remotePlayerNameLabel = null;    private JLabel remotePlayerWinsLabel = null;    private JLabel localPlayerWinsLabel = null;    private ImageIcon localPlayerIcon = null;    private ImageIcon remotePlayerIcon = null;    private String localPlayerIconType = null;    private String remotePlayerIconType = null;    private JLabel productLabel = null;    private JLabel errorMessageLabel = null;    private JLabel protocolStateLabel = null;    private JLabel messageLabel = null;    private JLabel playersTurnLabel = null;    private JLabel localPlayerIconLabel = null;    private JLabel remotePlayerIconLabel = null;    private JLabel customIconLabel = null;    private JLabel currentIconLabel = null;    private JLabel remoteIconLabel = null;    private TicTacToeGameControl gameControl = null;    private List<MoveListener> moveListeners = null;    private ImageIcon iconX = null;    private ImageIcon iconBlank = null;    private ImageIcon iconO = null;    private JLabel gameStateLabel = null;    private CardLayout cardLayout = null;    private CardLayout configCardLayout = null;    private JPanel deckPanel = null;    private JPanel configDeckPanel = null;    private Dialog tttDialog = null;    private JButton startGameButton = null;    private JButton closeButton = null;    private JButton playAgainButton = null;    private String remotePlayerName = null;    private String localPlayerName = null;    private String localPlayerIconFileName = null;    private final boolean m_isLocallyInitiated;    static final Logger LOG = Logger.getLogger(TicTacToeDialogView.class.getName());    /**     * Creates a new instance of TicTacToePanel     */    public TicTacToeDialogView(View view, Dialog dialog, boolean locallyInitiated) {        LOG.setLevel(Level.INFO);        m_isLocallyInitiated = locallyInitiated;        if (Logging.SHOW_INFO && LOG.isLoggable(Level.INFO)) {            LOG.info("Contructor");        }        this.tttDialog = dialog;        this.moveListeners = new ArrayList<MoveListener>();        Resources res = Resources.getInstance();        iconX = res.getIconResource("TicTacToe.X");        iconO = res.getIconResource("TicTacToe.O");        iconBlank = res.getIconResource("TicTacToe.BLANK");        localPlayerName = this.tttDialog.getGroup().getPeerGroup().getPeerName();        UI();        gameControl = new TicTacToeGameControl(this, dialog);        if (Logging.SHOW_INFO && LOG.isLoggable(Level.INFO)) {            LOG.info("End constructor");        }        gameControl.initSession();    }    public Dialog getDialog() {        return this.tttDialog;    }    public void dismiss() {        this.destruct();    }    private void destruct() {        if (getGameControl() != null) {            getGameControl().destruct();        }        if (moveListeners != null) {            moveListeners.clear();        }        gameControl = null;        if (tttDialog != null) {            this.tttDialog.close();        }        //myJxtaView.removeDialog (tttDialog);    }    private void updateMessageLabel(final String message) {        if (messageLabel != null) {            EventQueue.invokeLater(new Runnable() {                public void run() {                    messageLabel.setText(message);                }            });        }    }    private void updateProtocolStateLabel(final String protocolState) {        if (protocolStateLabel != null) {            EventQueue.invokeLater(new Runnable() {                public void run() {                    protocolStateLabel.setText(protocolState);                }            });        }    }    public void protocolStateChanged(int protocolState) {        LOG.info("gameControl " + this.gameControl);        LOG.info("getSessionString " +                this.gameControl.getSessionStateString(protocolState));        this.updateProtocolStateLabel(this.gameControl.getSessionStateString(protocolState));        if (protocolState == TicTacToeGameControl.SESSION_INVITE_REQUEST_RECEIVED) {            this.updateMessageLabel("Remote player Choosing Icon");        } else if (protocolState == TicTacToeGameControl.SESSION_INVITE_ACCEPT_RECEIVED) {            showPanel(CONFIG_PANEL);            this.showConfigPanel(CONFIG_CHOOSE_ICON_PANEL);            this.updateMessageLabel("Choose Your Icon");        } else if (protocolState == TicTacToeGameControl.SESSION_CONFIG_ACCEPT_SENT) {            this.updateMessageLabel("Starting...");        } else if (protocolState == TicTacToeGameControl.SESSION_CONFIG_REQUEST_RECEIVED) {            this.updateMessageLabel("Choose Your Icon");            remoteIconLabel.setIcon(this.getRemotePlayerIcon());            remotePlayerIconChosen();            showPanel(CONFIG_PANEL);            this.showConfigPanel(CONFIG_CHOOSE_ICON_PANEL);        } else if (protocolState == TicTacToeGameControl.SESSION_CONFIG_REQUEST_SENT) {            this.updateMessageLabel("Remote Player Choosing Icon");        } else if (protocolState == TicTacToeGameControl.SESSION_CONFIG_ACCEPT_RECEIVED) {            this.updateMessageLabel("SESSION_CONFIG_ACCEPT_RECEIVED (Remote Player has choosen Icon)");        } else if (protocolState == TicTacToeGameControl.SESSION_START_REQUEST_SENT) {            this.updateMessageLabel("SESSION_START_REQUEST_SENT ");        } else if (protocolState == TicTacToeGameControl.SESSION_START_REQUEST_RECEIVED) {            this.updateMessageLabel("Starting Game (session start request received)");            showPanel(GAME_CONTROL_PANEL);            resetGrid();        } else if (protocolState == TicTacToeGameControl.SESSION_START_ACCEPT_RECEIVED) {            this.updateMessageLabel("Starting Game (session start accepted)");            showPanel(GAME_CONTROL_PANEL);            resetGrid();        } else if (protocolState == TicTacToeGameControl.SESSION_PLAYING) {            updateGameStateView("Playing");        } else if (protocolState == TicTacToeGameControl.SESSION_ENDED) {            this.updateMessageLabel("Game Over");            updatePlayersTurnView("");            if (isLocallyInitiated()) {                playAgainButton.setEnabled(true);                playAgainButton.setVisible(true);            }        } else if (protocolState == TicTacToeGameControl.SESSION_END_REQUEST_RECEIVED) {            this.updateMessageLabel("Game Ending");        } else if (protocolState == TicTacToeGameControl.SESSION_DISCONNECT_REQUEST_RECEIVED) {            this.updateMessageLabel("Disconnecting");        } else if (protocolState == TicTacToeGameControl.SESSION_DISCONNECTED) {            this.updateMessageLabel("Disconnected");        } else {            System.out.println("strange state"+protocolState+ " is local:"+this.getGameControl().isLocallyInitiated());        }    }    private void remotePlayerIconChosen() {    }    private void UI() {        this.setPreferredSize(new Dimension(440, 300));        double sizes[][] = {{TableLayout.FILL}, {TableLayout.PREFERRED, TableLayout.FILL}};        TableLayout tbl = new TableLayout(sizes);        JPanel uiPanel = new JPanel(tbl);        uiPanel.add(buildMessagePanel(), "0,0,l,c");        cardLayout = new CardLayout();        deckPanel = new JPanel(cardLayout);        deckPanel.add(this.buildNoResponsePanel(), NO_RESPONSE_PANEL);        deckPanel.add(this.buildConfigPanel(), CONFIG_PANEL);        deckPanel.add(this.buildGamePanel(), GAME_CONTROL_PANEL);        deckPanel.add(this.buildErrorPanel(), ERROR_PANEL);        uiPanel.add(deckPanel, "0,1,c,c");        showPanel(NO_RESPONSE_PANEL);        this.add(uiPanel);    }    private JPanel buildErrorPanel() {        double sizes[][] = {{TableLayout.PREFERRED},                {TableLayout.PREFERRED, TableLayout.PREFERRED}};        TableLayout tbl = new TableLayout(sizes);        JPanel panel = new JPanel(tbl);        errorMessageLabel = new JLabel("ERROR");        panel.add(errorMessageLabel, "0,0");        return panel;    }    private JPanel buildNoResponsePanel() {        double sizes[][] = {{TableLayout.FILL},                {TableLayout.FILL}};        TableLayout tbl = new TableLayout(sizes);        JPanel panel = new JPanel(tbl);        return panel;    }    private JPanel buildMessagePanel() {        double b = 5;        double sizes[][] = {{b, TableLayout.FILL, b},                {b, TableLayout.PREFERRED, b, TableLayout.PREFERRED, b, TableLayout.PREFERRED, b}};        TableLayout tbl = new TableLayout(sizes);        JPanel panel = new JPanel(tbl);        productLabel = new JLabel("TicTacToe .01");        //productLabel.setFont (new Font ("Arial", Font.BOLD, 14));        productLabel.setForeground(new Color(0.0f, 0.0f, 0.0f, 0.5f));        panel.add(productLabel, "1,1,l,c");        protocolStateLabel = new JLabel("protocolState");        panel.add(protocolStateLabel, "1,3,l,c");        messageLabel = new JLabel("Message");        messageLabel.setFont(new Font("Arial", Font.BOLD, 14));        messageLabel.setForeground(new Color(0.0f, 0.0f, 0.0f));        panel.add(messageLabel, "1,5,c,c");        return panel;    }    private JPanel buildConfigPanel() {        configCardLayout = new CardLayout();        configDeckPanel = new JPanel(configCardLayout);        configDeckPanel.add(buildConfigChooseIconPanel(), CONFIG_CHOOSE_ICON_PANEL);        this.showConfigPanel(CONFIG_CHOOSE_ICON_PANEL);        return configDeckPanel;    }    private JPanel buildGameStatusPanel() {        double sizes[][] = {{TableLayout.FILL, TableLayout.FILL, TableLayout.FILL},                {TableLayout.PREFERRED}};        TableLayout tbl = new TableLayout(sizes);        JPanel panel = new JPanel(tbl);        panel.setBorder(null);        panel.setBackground(Color.WHITE);        //game status label        playAgainButton = new JButton("Play Again");        panel.add(playAgainButton, "0,0, l , c");        playAgainButton.setEnabled(false);        playAgainButton.setVisible(false);        playAgainButton.addActionListener(new ActionListener() {            public void actionPerformed(ActionEvent ae) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩高清欧美激情| 欧美乱熟臀69xxxxxx| 91蝌蚪porny九色| 欧美成va人片在线观看| 亚洲日韩欧美一区二区在线| 免费成人在线视频观看| 色综合中文字幕国产 | 日韩av一区二| 91免费观看视频在线| 国产亚洲精品bt天堂精选| 亚洲二区在线视频| 色综合色综合色综合色综合色综合 | 欧美天天综合网| 国产精品久久久爽爽爽麻豆色哟哟 | 亚洲综合色噜噜狠狠| 国产成人综合在线| 欧美一区二区福利视频| 亚洲福利一区二区三区| 一本色道a无线码一区v| 国产精品久久久久毛片软件| 精品一区二区在线看| 91麻豆精品国产91久久久久久| 亚洲日本va在线观看| 成人av资源网站| 国产日产欧美一区| 国产成人一级电影| 久久久久88色偷偷免费 | 亚洲一级二级三级| 色一情一伦一子一伦一区| 中文在线一区二区| 国产成人av福利| 国产精品日韩精品欧美在线| 久久99精品久久久久久| 亚洲精品一线二线三线无人区| 欧美aaa在线| 日韩欧美综合一区| 免费观看一级欧美片| 精品人在线二区三区| 国内外成人在线视频| 国产亚洲欧美色| 国产成人免费在线观看| 国产精品狼人久久影院观看方式| 成人手机在线视频| 国产精品久久一级| 在线观看欧美黄色| 免费成人深夜小野草| 欧美成人video| 成人免费福利片| 亚洲免费观看高清完整版在线| 91久久精品日日躁夜夜躁欧美| 午夜精品免费在线观看| 欧美一区国产二区| 国产成人av电影在线| 亚洲精品成人精品456| 欧美日本国产一区| 国产精品小仙女| 亚洲黄色在线视频| 日韩欧美中文字幕精品| 国产精品99久久久久久似苏梦涵 | 91小视频免费看| 午夜精品久久久久久| 久久久久久久久免费| 色婷婷综合久久久| 久久99国产精品尤物| 国产精品毛片久久久久久| 欧美在线观看一区| 国产最新精品免费| 一区二区三区精品久久久| 欧美哺乳videos| 91丨porny丨最新| 麻豆精品久久精品色综合| 中文字幕中文字幕一区二区| 欧美三级韩国三级日本一级| 国产一区二三区好的| 亚洲品质自拍视频| 日韩一区二区在线观看视频播放| 成人网在线免费视频| 日本中文在线一区| 亚洲三级在线播放| 久久久不卡网国产精品二区 | 午夜久久久久久电影| 国产精品视频一二| 欧美一区二区三区公司| fc2成人免费人成在线观看播放| 图片区日韩欧美亚洲| 1区2区3区精品视频| 久久亚洲欧美国产精品乐播 | 免费精品视频在线| 亚洲欧美日韩久久精品| 久久精品一区二区三区不卡牛牛| 欧美伊人久久久久久午夜久久久久| 韩国精品在线观看| 免费成人在线视频观看| 一区二区三区久久久| 亚洲欧美一区二区视频| 精品国产电影一区二区| 在线91免费看| 欧美日韩在线免费视频| av电影在线观看不卡 | 日本91福利区| 首页欧美精品中文字幕| 自拍偷自拍亚洲精品播放| 亚洲国产成人在线| 久久精品人人爽人人爽| 久久亚洲欧美国产精品乐播| 日韩午夜精品电影| 日韩亚洲欧美一区二区三区| 884aa四虎影成人精品一区| 欧美日韩免费高清一区色橹橹| av在线免费不卡| 99亚偷拍自图区亚洲| 成人动漫一区二区| 成人综合在线观看| 麻豆精品视频在线| 亚洲成国产人片在线观看| 另类调教123区| 亚洲国产精品国自产拍av| 91精品一区二区三区在线观看| 成人午夜碰碰视频| 日韩一区日韩二区| 亚洲一级二级三级在线免费观看| 日韩欧美资源站| 色88888久久久久久影院野外| 久久国产精品区| 亚洲第一久久影院| 中文字幕不卡在线播放| 欧美一区二区视频观看视频 | 欧美情侣在线播放| 99re这里只有精品视频首页| 精品一区二区三区的国产在线播放| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 制服丝袜日韩国产| 99精品久久只有精品| 国产成人av电影在线播放| 日韩不卡一区二区三区| 亚洲国产中文字幕在线视频综合| 国产欧美一区二区精品性| 欧美mv日韩mv国产网站| 欧美人xxxx| 在线观看网站黄不卡| 99在线精品观看| 成人一道本在线| 高潮精品一区videoshd| 国产精品正在播放| 麻豆91在线看| 美女看a上一区| 麻豆精品一区二区三区| 麻豆精品蜜桃视频网站| 免费成人av资源网| 视频在线观看一区| 日本视频在线一区| 日韩经典一区二区| 免费观看一级欧美片| 日本女人一区二区三区| 免费高清在线一区| 久久99久久精品欧美| 久久99精品一区二区三区三区| 久久国产精品99久久久久久老狼 | 日韩一级高清毛片| 欧美成人a视频| 国产视频亚洲色图| 亚洲国产精品成人综合| 中文字幕一区二区三区四区不卡| 国产精品久久久久永久免费观看 | 亚洲一区二区三区视频在线播放| 亚洲在线一区二区三区| 日韩专区一卡二卡| 国产一区二区福利| 成人福利视频网站| 色天天综合久久久久综合片| 欧美日韩精品三区| 日韩免费在线观看| 国产日产欧美一区二区视频| 18涩涩午夜精品.www| 亚洲国产视频直播| 麻豆精品在线播放| 成人性色生活片免费看爆迷你毛片| 91亚洲永久精品| 在线综合视频播放| 国产欧美日韩久久| 综合欧美亚洲日本| 免费av成人在线| 波多野结衣中文字幕一区| 欧美图片一区二区三区| 337p日本欧洲亚洲大胆精品| 综合分类小说区另类春色亚洲小说欧美| 一区二区三区丝袜| 久久超碰97人人做人人爱| 国产传媒欧美日韩成人| 欧美久久一区二区| 国产精品污网站| 男女激情视频一区| 91色婷婷久久久久合中文| 日韩免费一区二区| 一区二区三区四区不卡视频| 国产一区二区精品久久91| 欧美午夜影院一区| 久久看人人爽人人| 偷窥国产亚洲免费视频| 一本大道久久a久久精品综合|