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

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

?? guiimageserver.java

?? 有關手機藍牙應用的小例子
?? JAVA
字號:
/* * * Copyright (c) 2007, Sun Microsystems, Inc. * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * *  * Redistributions of source code must retain the above copyright *    notice, this list of conditions and the following disclaimer. *  * Redistributions in binary form must reproduce the above copyright *    notice, this list of conditions and the following disclaimer in the *    documentation and/or other materials provided with the distribution. *  * Neither the name of Sun Microsystems nor the names of its contributors *    may be used to endorse or promote products derived from this software *    without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */package example.bluetooth.demo;import java.io.IOException;import java.util.Vector;import javax.microedition.lcdui.Alert;import javax.microedition.lcdui.AlertType;import javax.microedition.lcdui.Command;import javax.microedition.lcdui.CommandListener;import javax.microedition.lcdui.Display;import javax.microedition.lcdui.Displayable;import javax.microedition.lcdui.Graphics;import javax.microedition.lcdui.Image;import javax.microedition.lcdui.List;import javax.microedition.lcdui.Ticker;/** * Allows to customize the images list to be published, * creates the corresponding service record to describe this list * and send the images to clients by request. * * @version , */final class GUIImageServer implements CommandListener {    /** Keeps the help message of this demo. */    private final String helpText =        "The server is started by default.\n\n" +        "No images are published initially. Change this by corresponding" +        " commands - the changes have an effect immediately.\n\n" +        "If image is removed from the published list, it can't " + "be downloaded.";    /** This command goes to demo main screen. */    private final Command backCommand = new Command("Back", Command.BACK, 2);    /** Adds the selected image to the published list. */    private final Command addCommand = new Command("Publish image", Command.SCREEN, 1);    /** Removes the selected image from the published list. */    private final Command removeCommand = new Command("Remove image", Command.SCREEN, 1);    /** Shows the help message. */    private final Command helpCommand = new Command("Help", Command.HELP, 1);    /** The list control to configure images. */    private final List imagesList = new List("Configure Server", List.IMPLICIT);    /** The help screen for the server. */    private final Alert helpScreen = new Alert("Help");    /** Keeps the parent MIDlet reference to process specific actions. */    private DemoMIDlet parent;    /** The list of images file names. */    private Vector imagesNames;    /** These images are used to indicate the picture is published. */    private Image onImage;    /** These images are used to indicate the picture is published. */    private Image offImage;    /** Keeps an information about what images are published. */    private boolean[] published;    /** This object handles the real transmission. */    private BTImageServer bt_server;    /** Constructs images server GUI. */    GUIImageServer(DemoMIDlet parent) {        this.parent = parent;        bt_server = new BTImageServer(this);        setupIdicatorImage();        setupImageList();        published = new boolean[imagesList.size()];        // prepare main screen        imagesList.addCommand(backCommand);        imagesList.addCommand(addCommand);        imagesList.addCommand(removeCommand);        imagesList.addCommand(helpCommand);        imagesList.setCommandListener(this);        // prepare help screen        helpScreen.addCommand(backCommand);        helpScreen.setTimeout(Alert.FOREVER);        helpScreen.setString(helpText);        helpScreen.setCommandListener(this);    }    /**     * Process the command event.     *     * @param c - the issued command.     * @param d - the screen object the command was issued for.     */    public void commandAction(Command c, Displayable d) {        if ((c == backCommand) && (d == imagesList)) {            destroy();            parent.show();            return;        }        if ((c == backCommand) && (d == helpScreen)) {            Display.getDisplay(parent).setCurrent(imagesList);            return;        }        if (c == helpCommand) {            Display.getDisplay(parent).setCurrent(helpScreen);            return;        }        /*         * Changing the state of base of published images         */        int index = imagesList.getSelectedIndex();        // nothing to do        if ((c == addCommand) == published[index]) {            return;        }        // update information and view        published[index] = c == addCommand;        Image stateImg = (c == addCommand) ? onImage : offImage;        imagesList.set(index, imagesList.getString(index), stateImg);        // update bluetooth service information        if (!bt_server.changeImageInfo(imagesList.getString(index), published[index])) {            // either a bad record or SDDB is busy            Alert al = new Alert("Error", "Can't update base", null, AlertType.ERROR);            al.setTimeout(DemoMIDlet.ALERT_TIMEOUT);            Display.getDisplay(parent).setCurrent(al, imagesList);            // restore internal information            published[index] = !published[index];            stateImg = published[index] ? onImage : offImage;            imagesList.set(index, imagesList.getString(index), stateImg);        }    }    /**     * We have to provide this method due to "do not do network     * operation in command listener method" restriction, which     * is caused by crooked midp design.     *     * This method is called by BTImageServer after it is done     * with bluetooth initialization and next screen is ready     * to appear.     */    void completeInitialization(boolean isBTReady) {        // bluetooth was initialized successfully.        if (isBTReady) {            Ticker t = new Ticker("Choose images you want to publish...");            imagesList.setTicker(t);            Display.getDisplay(parent).setCurrent(imagesList);            return;        }        // something wrong        Alert al = new Alert("Error", "Can't initialize bluetooth", null, AlertType.ERROR);        al.setTimeout(DemoMIDlet.ALERT_TIMEOUT);        Display.getDisplay(parent).setCurrent(al, parent.getDisplayable());    }    /** Destroys this component. */    void destroy() {        // finalize the image server work        bt_server.destroy();    }    /** Gets the image file name from its title (label). */    String getImageFileName(String imgName) {        if (imgName == null) {            return null;        }        // no interface in List to get the index - should find        int index = -1;        for (int i = 0; i < imagesList.size(); i++) {            if (imagesList.getString(i).equals(imgName)) {                index = i;                break;            }        }        // not found or not published        if ((index == -1) || !published[index]) {            return null;        }        return (String)imagesNames.elementAt(index);    }    /**     * Creates the image to indicate the base state.     */    private void setupIdicatorImage() {        // create "on" image        try {            onImage = Image.createImage("/images/st-on.png");        } catch (IOException e) {            // provide off-screen image then            onImage = createIndicatorImage(12, 12, 0, 255, 0);        }        // create "off" image        try {            offImage = Image.createImage("/images/st-off.png");        } catch (IOException e) {            // provide off-screen image then            offImage = createIndicatorImage(12, 12, 255, 0, 0);        }    }    /**     * Gets the description of images from manifest and     * prepares the list to control the configuration.     * <p>     * The attributes are named "ImageTitle-n" and "ImageImage-n".     * The value "n" must start at "1" and be incremented by 1.     */    private void setupImageList() {        imagesNames = new Vector();        imagesList.setCommandListener(this);        for (int n = 1; n < 100; n++) {            String name = parent.getAppProperty("ImageName-" + n);            // no more images available            if ((name == null) || (name.length() == 0)) {                break;            }            String label = parent.getAppProperty("ImageTitle-" + n);            // no label available - use picture name instead            if ((label == null) || (label.length() == 0)) {                label = name;            }            imagesNames.addElement(name);            imagesList.append(label, offImage);        }    }    /**     * Creates the off-screen image with specified size an color.     */    private Image createIndicatorImage(int w, int h, int r, int g, int b) {        Image res = Image.createImage(w, h);        Graphics gc = res.getGraphics();        gc.setColor(r, g, b);        gc.fillRect(0, 0, w, h);        return res;    }} // end of class 'GUIImageServer' definition

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品婷婷伊人一区三区三| 麻豆成人av在线| 91成人在线免费观看| 综合久久国产九一剧情麻豆| 97se狠狠狠综合亚洲狠狠| 亚洲男人的天堂在线aⅴ视频| 成人99免费视频| 亚洲黄色录像片| 欧美老年两性高潮| 久久精品噜噜噜成人88aⅴ| 久久综合九色欧美综合狠狠| 国产99久久久国产精品潘金网站| 中文字幕不卡在线| 99r国产精品| 亚洲一区二区精品视频| 91精品国产91久久久久久一区二区| 蜜臀av亚洲一区中文字幕| 久久综合色鬼综合色| 成人丝袜视频网| 亚洲一二三区在线观看| 精品1区2区在线观看| eeuss鲁片一区二区三区 | 久久精品视频一区二区三区| 成人性生交大片免费看在线播放| 亚洲人成精品久久久久久| 欧美三级视频在线| 久久av资源网| 亚洲女人****多毛耸耸8| 欧美一区二区三区在线电影| 国产成人鲁色资源国产91色综 | 久久综合久久鬼色| 91久久香蕉国产日韩欧美9色| 日韩精品每日更新| 久久久99久久精品欧美| 日本道免费精品一区二区三区| 久久99在线观看| 最好看的中文字幕久久| 91精品国产免费| 成人成人成人在线视频| 日韩电影在线看| 亚洲视频香蕉人妖| 国产亚洲欧洲997久久综合 | 日本中文一区二区三区| 亚洲婷婷综合久久一本伊一区| 日韩免费观看2025年上映的电影| 99久久国产综合色|国产精品| 蜜桃视频在线观看一区| 伊人夜夜躁av伊人久久| 久久久久一区二区三区四区| 在线电影一区二区三区| 成人福利在线看| 九九九久久久精品| 亚洲成av人片在线观看| 亚洲欧美日韩中文字幕一区二区三区 | 亚洲国产综合人成综合网站| 国产亚洲短视频| 日韩手机在线导航| 91丝袜美女网| 国产成人av电影在线播放| 日本特黄久久久高潮| 亚洲韩国精品一区| 一区二区三区日韩精品视频| 中文乱码免费一区二区| 日韩欧美国产麻豆| 日韩一级片网址| 欧美日本在线视频| 欧洲精品在线观看| 99久久久国产精品| 国产精品996| 蜜臀久久99精品久久久画质超高清 | 3atv在线一区二区三区| 日本道在线观看一区二区| jizzjizzjizz欧美| 99视频精品免费视频| 成人性视频免费网站| 成人av在线资源| 99热这里都是精品| 99re热视频精品| 91麻豆.com| 在线观看日韩高清av| 欧美综合色免费| 欧美日韩午夜在线| 欧美日韩国产天堂| 欧美一卡二卡三卡| 日韩一区二区三区免费看| 精品毛片乱码1区2区3区| 久久综合久久综合久久综合| 久久精品欧美日韩| 国产精品久久久久久久久动漫| 国产精品久久久久影院亚瑟| 国产精品白丝在线| 亚洲综合免费观看高清完整版| 一区二区三区四区av| 亚洲1区2区3区4区| 麻豆国产精品官网| 高清不卡一区二区| 91国偷自产一区二区使用方法| 欧美日韩国产首页| 久久午夜老司机| 亚洲婷婷综合久久一本伊一区 | 日韩一区二区在线免费观看| 宅男在线国产精品| 久久综合中文字幕| 亚洲欧美日韩久久精品| 午夜精品久久久久久久| 精品一区二区三区在线播放视频| 福利一区二区在线| 欧美午夜片在线观看| 精品久久久久久亚洲综合网| 国产蜜臀av在线一区二区三区| 亚洲三级久久久| 日韩va欧美va亚洲va久久| 国产91色综合久久免费分享| 欧美无乱码久久久免费午夜一区| 欧美一二三四区在线| 亚洲欧洲一区二区三区| 午夜久久久久久电影| 国产a视频精品免费观看| 欧美三级三级三级爽爽爽| 久久精品夜色噜噜亚洲a∨| 亚洲一区二区三区四区的| 国产在线不卡一区| 欧美日韩久久一区| 国产日韩欧美在线一区| 亚洲国产精品久久久久秋霞影院 | 中文字幕中文字幕在线一区| 婷婷夜色潮精品综合在线| 国产mv日韩mv欧美| 欧美一区二区三区婷婷月色| 国产精品萝li| 美女一区二区视频| 色一区在线观看| 国产午夜精品一区二区三区嫩草 | 美女视频网站黄色亚洲| 99re热这里只有精品视频| 精品国产免费久久| 亚洲成a天堂v人片| 99精品视频在线免费观看| 日韩精品一区二区三区在线 | 99久久久久免费精品国产| 欧美一级xxx| 一区二区三区在线视频观看58| 国产精品综合一区二区三区| 91福利国产精品| 国产精品激情偷乱一区二区∴| 久久精品国产一区二区三 | 94-欧美-setu| 6080国产精品一区二区| 亚洲人亚洲人成电影网站色| 青青草精品视频| 欧美最猛黑人xxxxx猛交| 中文文精品字幕一区二区| 免费视频最近日韩| 欧美区视频在线观看| 亚洲综合一区二区三区| 国产福利一区二区三区视频| 亚洲日本一区二区三区| 粉嫩高潮美女一区二区三区 | 99国产精品视频免费观看| 久久午夜国产精品| 精品制服美女久久| 欧美一区二区二区| 日韩精品1区2区3区| 欧美群妇大交群的观看方式| 亚洲午夜精品网| 欧美三区免费完整视频在线观看| 国产精品成人免费在线| av成人老司机| 国产精品成人一区二区艾草| 99久久综合精品| 国产精品久久久久影院| 成人福利视频网站| 国产精品国产三级国产aⅴ中文| 国产激情精品久久久第一区二区| 久久网站热最新地址| 国产精品99久久久久久宅男| 国产视频一区不卡| 成人精品国产福利| 亚洲欧洲av另类| 色94色欧美sute亚洲线路一ni| 亚洲精品老司机| 欧美日韩你懂的| 日本欧美在线看| 精品国产乱子伦一区| 国产成人av电影在线观看| 国产精品美女一区二区在线观看| av综合在线播放| 夜夜夜精品看看| 欧美一区二区久久久| 久久国产麻豆精品| 久久精子c满五个校花| 99久久精品免费看国产| 一区二区三区欧美| 欧美蜜桃一区二区三区| 国产在线视视频有精品| ...xxx性欧美| 日韩一卡二卡三卡四卡| 国产a视频精品免费观看| 一区二区三区欧美久久| 精品国产麻豆免费人成网站|