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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? guiimageserver.java

?? 手機應(yīng)用程序,模擬藍牙技術(shù),代碼經(jīng)典,不可多得.
?? JAVA
字號:
/* * @(#)GUIImageServer.java	1.2 04/05/28 * * Copyright (c) 2000-2004 Sun Microsystems, Inc. All rights reserved. * PROPRIETARY/CONFIDENTIAL * Use is subject to license terms */package example.bluetooth.demo;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;import java.io.IOException;import java.util.Vector;/** * Allows to customize the images list to be published, * creates the corresponding service record to discribe this list * and send the images to clients by request. * * @author Vladimir K. Beliaev * @version 1.2, 05/28/04 */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 download.";    /** 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, offImage;    /** Keeps an information about what images are published. */    private boolean[] published;    /** This object handles the real transmission. */    private BTImageServer bt_server;    /** Constucts 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 buzy            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 inititialize bluetooth", null,                AlertType.ERROR);        al.setTimeout(DemoMIDlet.ALERT_TIMEOUT);        Display.getDisplay(parent).setCurrent(al, parent.getDisplayable());    }    /** Destroys this component. */    void destroy() {        // finilize 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 idicate 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 contol 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 lable 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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩**一区毛片| 91蜜桃在线观看| 一区二区三区免费| 中文字幕不卡的av| 国产亚洲美州欧州综合国| 日韩欧美久久久| 欧美精品一卡二卡| 欧美日本不卡视频| 在线不卡一区二区| 欧美成人a∨高清免费观看| 日韩欧美国产1| 精品久久久久久久久久久久包黑料| 7777精品久久久大香线蕉| 欧美色视频一区| 欧美精品三级日韩久久| 欧美色倩网站大全免费| 欧美巨大另类极品videosbest| 欧美撒尿777hd撒尿| 91精品国产手机| 日韩三级视频在线看| 欧美成人精品高清在线播放| 日韩久久免费av| 2023国产精品自拍| 亚洲欧美在线观看| 亚洲mv在线观看| 久久精品国产久精国产爱| 国内久久婷婷综合| 成人免费看黄yyy456| 99久久免费精品| 欧美日韩高清不卡| 国产日韩v精品一区二区| 国产日韩欧美综合在线| 亚洲精品免费播放| 天天影视色香欲综合网老头| 久久精品72免费观看| 不卡的av网站| 欧美在线免费视屏| 精品理论电影在线| 亚洲激情男女视频| 精品综合久久久久久8888| av在线不卡电影| 日韩欧美亚洲一区二区| 亚洲精品视频免费观看| 看电视剧不卡顿的网站| 9l国产精品久久久久麻豆| 91精品国产综合久久福利| 中文字幕av一区二区三区| 亚洲一卡二卡三卡四卡无卡久久| 激情成人午夜视频| 欧美人xxxx| 亚洲精品国产一区二区精华液 | 欧美片在线播放| 日韩精品在线看片z| 亚洲摸摸操操av| 国产精品1区二区.| 日韩一级片在线播放| 亚洲麻豆国产自偷在线| 国产毛片精品国产一区二区三区| 欧美无砖专区一中文字| 亚洲成人高清在线| 成人av在线资源网| 欧美另类一区二区三区| 亚洲天堂久久久久久久| 国产一区二区看久久| 亚洲免费高清视频在线| 国产成人综合网| 日韩亚洲欧美在线观看| 亚洲成人午夜电影| 成人高清在线视频| 国产亚洲综合av| 国产米奇在线777精品观看| 日韩午夜精品视频| 日本不卡一二三| 欧美美女直播网站| 香蕉影视欧美成人| 一本久久综合亚洲鲁鲁五月天| 中文字幕av在线一区二区三区| 国产伦理精品不卡| 久久精品亚洲精品国产欧美kt∨| 另类的小说在线视频另类成人小视频在线| 欧美亚洲综合在线| 亚洲综合久久av| 欧美日韩精品一区二区三区 | 91免费版pro下载短视频| 国产精品美女久久久久久| 国产美女主播视频一区| 中文字幕高清一区| 成人免费的视频| 亚洲色图丝袜美腿| 欧美亚洲一区二区三区四区| 亚洲自拍偷拍综合| 91精品国产色综合久久不卡电影 | 水野朝阳av一区二区三区| 欧美写真视频网站| 婷婷丁香激情综合| 日韩欧美三级在线| 国产精品小仙女| 亚洲区小说区图片区qvod| 在线观看亚洲a| 美女视频网站久久| 久久精品一区蜜桃臀影院| av午夜一区麻豆| 亚洲一区二区三区视频在线播放| 欧美理论电影在线| 国产精品一线二线三线精华| 国产精品丝袜在线| 欧美综合欧美视频| 免费高清视频精品| 国产精品久久久久久亚洲伦 | 亚洲国产成人av网| 欧美成人乱码一区二区三区| 成人网页在线观看| 亚洲成人一区在线| 久久久亚洲精华液精华液精华液| 国产91富婆露脸刺激对白| 一二三区精品视频| 精品国产乱码久久久久久1区2区| 成人av电影免费在线播放| 亚洲成人av福利| 国产精品天美传媒沈樵| 91精品国产综合久久精品性色| 懂色av一区二区三区蜜臀| 午夜在线成人av| 中文乱码免费一区二区| 制服视频三区第一页精品| 成人av午夜电影| 精品一区二区三区免费播放| 亚洲精品成a人| 久久精品一二三| 欧美xxx久久| 欧美日韩视频在线观看一区二区三区| 国产一区 二区| 青娱乐精品视频在线| 一区二区三区中文免费| 久久精品一区二区| 精品久久久久av影院| 欧美日韩一区在线| 色综合天天综合网天天狠天天| 韩日av一区二区| 五月天欧美精品| 亚洲一区成人在线| 亚洲综合丝袜美腿| 成人欧美一区二区三区小说| 26uuu国产在线精品一区二区| 欧美体内she精高潮| av成人老司机| av在线一区二区三区| 国产sm精品调教视频网站| 麻豆精品在线播放| 日本大胆欧美人术艺术动态| 亚洲成年人影院| 亚洲r级在线视频| 日日夜夜精品视频天天综合网| 一区二区在线观看av| 亚洲精品免费在线播放| 亚洲三级理论片| 亚洲精品中文在线影院| 亚洲黄色录像片| 亚洲免费高清视频在线| 亚洲一区二区三区美女| 亚洲一区av在线| 亚洲mv在线观看| 蜜桃精品视频在线观看| 久久99久久99精品免视看婷婷 | 国产一区二区三区电影在线观看| 开心九九激情九九欧美日韩精美视频电影| 日韩av一区二区三区| 免费高清在线视频一区·| 激情综合色综合久久综合| 激情综合亚洲精品| 国产99久久久久久免费看农村| 国产成人高清在线| 99久久精品国产一区二区三区| 97久久超碰国产精品电影| 色狠狠色狠狠综合| 欧美精品三级日韩久久| 精品动漫一区二区三区在线观看| 久久久国产午夜精品| 成人免费视频在线观看| 亚洲国产裸拍裸体视频在线观看乱了 | 风流少妇一区二区| 国产99久久久国产精品免费看| 99精品视频一区| 欧美午夜精品理论片a级按摩| 在线电影一区二区三区| 欧美韩国日本不卡| 亚洲综合视频网| 国产精品自拍毛片| 在线亚洲一区观看| 精品国产乱码久久久久久牛牛| 欧美极品少妇xxxxⅹ高跟鞋| 亚洲一区二区三区爽爽爽爽爽| 久久国产精品无码网站| 一本大道久久a久久综合婷婷| 欧美一区二区三区免费大片| 国产精品护士白丝一区av| 日韩va欧美va亚洲va久久| 成人网页在线观看| 精品理论电影在线观看| 亚洲国产精品一区二区www在线|