📄 presence.java
字号:
/* * Copyright 2004 Grzegorz Grasza groz@gryf.info * * This file is part of mobber. Mobber 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 2 of the License, or (at your option) any later version. * Mobber 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 General Public License for more details. * You should have received a copy of the GNU General Public License along with mobber; * if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, MA 02111-1307 USA . */import javax.microedition.lcdui.*;public class Presence extends Form implements CommandListener{ ChoiceGroup choice; TextField text; Gauge gauge; public static final String show[]=new String[]{null, "chat", "dnd", "away", "xa"}; public Presence() { super(Label.presence); choice = new ChoiceGroup (mobber.jabber.myjid, Choice.EXCLUSIVE); text = new TextField(Label.status, mobber.login.status, 64, TextField.ANY); gauge = new Gauge(Label.priority, true, 12, mobber.login.priority); choice.append(Label.available, mobber.roster.images[Contact.online]); choice.append(Label.chat, mobber.roster.images[Contact.chat]); choice.append(Label.dnd, mobber.roster.images[Contact.dnd]); choice.append(Label.away, mobber.roster.images[Contact.away]); choice.append(Label.xa, mobber.roster.images[Contact.xa]); //choice.append(Label.offline, mobber.roster.images[Contact.offline]); choice.setSelectedIndex(mobber.login.show, true); append(choice); append(text); append(gauge); addCommand(Action.ok); addCommand(Action.cancel); setCommandListener(this); } public void commandAction(Command c,Displayable s) { if(c == Action.ok) { mobber.login.status = text.getString(); mobber.login.show = choice.getSelectedIndex(); mobber.login.priority = gauge.getValue(); mobber.jabber.sendPresence(null, "available", show[mobber.login.show], mobber.login.status, mobber.login.priority); } mobber.display.setCurrent(mobber.roster); }};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -