📄 auctiondemo_ja.java
字号:
/* * @(#)AuctionDemo_Ja.java 1.23 01/08/21 * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. */package example.auction.i18n;import java.util.*;import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import javax.microedition.lcdui.List;public class AuctionDemo_Ja extends MIDlet implements CommandListener { Display display; public AuctionDemo_Ja() { display = Display.getDisplay(this); } public void destroyApp(boolean unconditional) { } public void pauseApp() { } Band band = new Band(); static final Command BYE_CMD = new Command("\u7d42\u4e86", Command.STOP, 0); static final Command BACK_CMD = new Command("\u623b\u308b", Command.SCREEN, 1); static final Command NEXT_CMD = new Command("\u6b21\u3078", Command.SCREEN, 2); static final Command MENU_CMD = new Command("\uff92\uff72\uff9d", Command.SCREEN, 2); static final Command SAVE_CMD = new Command("\u4fdd\u5b58", Command.SCREEN, 2); static final Command SUBMIT_CMD = new Command("\u5165\u672d", Command.SCREEN, 2); static final Command ABOUY_CMD = new Command("\u60c5\u5831", Command.SCREEN, 30); Ticker ticker; Alert notImpl, savedMsg, alertMsg; Canvas welcome; List mainMenu, cateMenu, aucMenu, bandList, ticketList, setMenu; Form ticketForm, enterForm, bidForm, submitMsg; TextField enterText, bidText; TextBox addBand; Login login = new Login(); SetDate date = new SetDate(); SetTicker setTicker = new SetTicker(); Update updateInt = new Update(); UpdateAlert updateAlert = new UpdateAlert(); Gauge submitGauge; RmBand rmBand = new RmBand(); Timer TimerService; public void startApp() { notImpl = new Alert("\u8aa0\u306b\u7533\u3057\u8a33\u3042" + "\u308a\u307e\u305b\u3093", "\u73fe\u5728\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093", null, null); savedMsg = new Alert(null, "\u3042\u306a\u305f\u306e\u65b0\u3057\u3044\u8a2d\u5b9a" + "\u306f\u4fdd\u5b58\u3055\u308c\u307e\u3057\u305f", null, null); alertMsg = new Alert(null, "\u65b0\u3057\u3044\u901a\u77e5\u5165\u672d\u984d\u304c" + "\u8a2d\u5b9a\u3055\u308c\u307e\u3057\u305f\u3002", null, null); // submitMsg = new Alert(null); // submitMsg.append("Submitting bid..."); submitGauge = new Gauge("", false, 100, 0); submitMsg = new Form("\u5165\u672d\u3092\u63d0\u51fa\u4e2d..."); submitMsg.append(submitGauge); ticker = new Ticker(""); ticker.setString(band.toTickerString(null)); welcome = new Canvas() { Image img = Image.createImage(dukeData, 0, dukeData.length); protected void paint(Graphics g) { int x = (getWidth() - img.getWidth()) / 2; int y = (getHeight() - img.getHeight()) / 2; g.drawImage(img, x, y, Graphics.TOP | Graphics.LEFT); } }; welcome.addCommand(MENU_CMD); welcome.addCommand(BYE_CMD); welcome.setCommandListener(this); display.setCurrent(welcome); mainMenu = new List("\u30e1\u30a4\u30f3", Choice.IMPLICIT); mainMenu.append("\u4f4f\u6240\u9332", null); mainMenu.append("\u30aa\u30d7\u30b7\u30e7\u30f3", null); mainMenu.append("\u30cb\u30e5\u30fc\u30b9", null); mainMenu.append("\u30aa\u30fc\u30af\u30b7\u30e7\u30f3", null); mainMenu.append("\u4ea4\u901a\u60c5\u5831", null); mainMenu.append("\u30d0\u30f3\u30ad\u30f3\u30b0", null); mainMenu.append("\u30b2\u30fc\u30e0", null); mainMenu.addCommand(BACK_CMD); mainMenu.setCommandListener(this); cateMenu = new List("\u30ab\u30c6\u30b4\u30ea", Choice.IMPLICIT); cateMenu.append("\u30a2\u30f3\u30c6\u30a3\u30fc\u30af", null); cateMenu.append("\u66f8\u7c4d\u3001CD", null); cateMenu.append("\u6d0b\u670d\u3001\u30d6\u30e9\u30f3\u30c9", null); cateMenu.append("\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf", null); cateMenu.append("\u8cb4\u91d1\u5c5e", null); cateMenu.append("\u30a4\u30f3\u30c6\u30ea\u30a2", null); cateMenu.append("\u30b3\u30a4\u30f3\uff06\u5207\u624b", null); cateMenu.append("\u30c1\u30b1\u30c3\u30c8", null); cateMenu.append("\u304a\u3082\u3061\u3083", null); cateMenu.addCommand(BACK_CMD); cateMenu.setCommandListener(this); aucMenu = new List("\u30c1\u30b1\u30c3\u30c8", Choice.IMPLICIT); aucMenu.append("\u51fa\u54c1\u30ea\u30b9\u30c8", null); aucMenu.append("\u5165\u672d\u3059\u308b", null); aucMenu.append("\u5165\u672d\u984d\u901a\u77e5\u8a2d\u5b9a", null); aucMenu.append("\u8a2d\u5b9a", null); aucMenu.addCommand(BACK_CMD); aucMenu.setCommandListener(this); aucMenu.setTicker(ticker); bandList = new List("\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8", Choice.IMPLICIT); bandList.addCommand(BACK_CMD); bandList.setCommandListener(this); bandList.setTicker(ticker); String[] list = band.getList(); for (int i = 0; i < list.length; i++) { bandList.append(list[i], null); } ticketList = new List("dummy", Choice.IMPLICIT); ticketList.addCommand(BACK_CMD); ticketList.setCommandListener(this); ticketForm = new Form("dummy"); ticketForm.append("dummy"); ticketForm.addCommand(BACK_CMD); ticketForm.addCommand(MENU_CMD); ticketForm.setCommandListener(this); enterText = new TextField("\u901a\u77e5\u5165\u672d\u984d", "", 10, TextField.NUMERIC); enterForm = new Form("\u8a2d\u5b9a"); enterForm.append("\u5165\u672d\u984d\u304c\u4ee5\u4e0b" + "\u306e\u8a2d\u5b9a" +"\u91d1\u984d\u306a\u308b\u3068\u304a\u77e5\u3089" +"\u305b\u3057\u307e\u3059:"); enterForm.append(enterText); enterForm.addCommand(BACK_CMD); enterForm.addCommand(SAVE_CMD); enterForm.setCommandListener(this); bidText = new TextField("", "", 10, TextField.NUMERIC); bidForm = new Form("dummy"); bidForm.append("dummy"); bidForm.append(bidText); bidForm.addCommand(BACK_CMD); bidForm.addCommand(NEXT_CMD); bidForm.setCommandListener(this); setMenu = new List("\u8a2d\u5b9a", Choice.IMPLICIT); setMenu.append("\u65e5\u4ed8\u8a2d\u5b9a", null); setMenu.append("\u30c6\u30ed\u30c3\u30d7", null); setMenu.append("\u30a2\u30e9\u30fc\u30e0\u9593\u9694", null); setMenu.append("\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8\u8ffd\u52a0", null); setMenu.append("\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8\u524a\u9664", null); setMenu.addCommand(BACK_CMD); setMenu.setCommandListener(this); setMenu.setTicker(ticker); addBand = new TextBox("\u8ffd\u52a0\u3059\u308b\u30a2\u30fc\u30c6\u30a3" + "\u30b9\u30c8\u3092\u30b3\u30f3\u30de(,)\u3067\u533a" + "\u5207\u3063\u3066\u5165\u529b\u3057\u3066\u304f" + "\u3060\u3055\u3044:", "", 100, TextField.ANY); addBand.addCommand(BACK_CMD); addBand.addCommand(SAVE_CMD); addBand.setCommandListener(this); } int chooseBandType = 0; public void commandAction(Command c, Displayable s) { if (s instanceof Canvas) { Canvas obj = (Canvas) s; if (obj == welcome) { if (c == MENU_CMD) { display.setCurrent(mainMenu); } else if (c == BYE_CMD) { notifyDestroyed(); } } } else if (s instanceof List) { List obj = (List) s; if (obj == mainMenu) { if (c == List.SELECT_COMMAND) { int idx = obj.getSelectedIndex(); if (idx == 3) { display.setCurrent(cateMenu); } else { display.setCurrent(notImpl); } } else if (c == BACK_CMD) { display.setCurrent(welcome); } } else if (obj == cateMenu) { if (c == List.SELECT_COMMAND) { int idx = obj.getSelectedIndex(); if (idx == 7) { display.setCurrent(aucMenu); } else { display.setCurrent(notImpl); } } else if (c == BACK_CMD) { display.setCurrent(mainMenu); } } else if (obj == aucMenu) { if (c == List.SELECT_COMMAND) { int idx = obj.getSelectedIndex(); switch (idx) { case 0: chooseBandType = 0; display.setCurrent(bandList); break; case 1: chooseBandType = 1; display.setCurrent(bandList); break; case 2: chooseBandType = 2; display.setCurrent(bandList); break; case 3: display.setCurrent(setMenu); break; case 4: example.About.showAbout(display); break; } } else if (c == BACK_CMD) { display.setCurrent(cateMenu);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -