?? jimmui.java.svn-base
字號:
uiSectName = "work_info"; addToTextList(UI_W_NAME, data, "title", list, true); addToTextList(UI_W_DEP, data, "depart", list, true); addToTextList(UI_W_POS, data, "position", list, true); addToTextList(UI_W_CITY, data, "city", list, true); addToTextList(UI_W_STATE, data, "state", list, true); addToTextList(UI_W_ADDR, data, "addr", list, true); addToTextList(UI_W_PHONE, data, "phone", list, true); addToTextList(UI_W_FAX, data, "fax", list, true); uiSectName = "icq_client"; addToTextList(UI_ICQ_CLIENT, data, "icq_client", list, true); addToTextList(UI_CAPS, data, "cli_caps", list, true); uiSectName = "dc_info"; addToTextList(UI_ONLINE_STATUS, data, "status", list, true); addToTextList(UI_XSTATUS, data, "xstatus", list, true); addToTextList(UI_REG_DATE, data, "li_reg_date", list, true); addToTextList(UI_SIGNON, data, "li_signon_time", list, true); addToTextList(UI_ONLINETIME, data, "li_online_time", list, true); addToTextList(UI_IDLE_TIME, data, "li_idle_time", list, true); addToTextList(UI_ICQ_VERS, data, "ICQ version", list, true); addToTextList(UI_INT_IP, data, "Int IP", list, true); addToTextList(UI_EXT_IP, data, "Ext IP", list, true); addToTextList(UI_PORT, data, "Port", list, true); } /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// static private TextList infoTextList = null; //#sijapp cond.if target!="DEFAULT" & modules_AVATARS="true"#
static public void updateActiveUserInfo(String uin) { if (infoTextList != null) { if (infoTextList.isActive()) { try { ContactItem cItem = ContactList.getItembyUIN(uin); Image image = cItem.getImage(ContactItem.CONTACTITEM_BUDDYICON); if (image != null) { infoTextList.insertImage(image, null, -1, 0).doCRLF(-1); infoTextList.repaint(); } image = null; } catch (Exception ignore) {/* Do nothing */} } } } // #sijapp cond.end# static public void requiestUserInfo(String uin, String name, boolean allowToEdit //#sijapp cond.if target!="DEFAULT" & modules_AVATARS="true"#
, byte[] hash // #sijapp cond.end# ) { infoTextList = getInfoTextList(uin, false); infoTextList.setCommandListener(_this); if (Icq.isConnected()) { if (allowToEdit) infoTextList.addCommandEx(cmdEdit, VirtualList.MENU_TYPE_RIGHT); //#sijapp cond.if target!="DEFAULT" & modules_AVATARS="true"#
if (hash != null) { ContactItem cItem = ContactList.getItembyUIN(uin); if (cItem.iconReady()) { RequestBuddyIconAction act = new RequestBuddyIconAction(uin,hash); try { Icq.requestAction(act); } catch (JimmException e) { System.out.println ("Exception!"); JimmException.handleException(e); if (e.isCritical()) return; } SplashCanvas.addTimerTask(act); } } // #sijapp cond.end# RequestInfoAction act = new RequestInfoAction(uin, name); infoTextList.addCommandEx(cmdCancel, VirtualList.MENU_TYPE_LEFT_BAR); try { Icq.requestAction(act); } catch (JimmException e) { JimmException.handleException(e); if (e.isCritical()) return; } infoTextList.add(ResourceBundle.getString("wait")); showInfoTextList(infoTextList); } else { String[] data = new String[JimmUI.UI_LAST_ID]; data[JimmUI.UI_NICK] = name; data[JimmUI.UI_UIN] = uin; data[JimmUI.UI_UIN_LIST] = uin; showUserInfo(data); showInfoTextList(infoTextList); } } static private String[] last_user_info; static public void showUserInfo(String[] data) { last_user_info = data; if (infoTextList == null) return; infoTextList.clear(); //#sijapp cond.if target!="DEFAULT" & modules_AVATARS="true"#
try { ContactItem cItem = ContactList.getItembyUIN(data[JimmUI.UI_UIN]); Image image = cItem.getImage(ContactItem.CONTACTITEM_BUDDYICON); if (image != null) infoTextList.insertImage(image, null, -1, 0).doCRLF(-1); image = null; } catch (Exception ignore) {/*Do nothing*/} // #sijapp cond.end# JimmUI.fillUserInfo(data, infoTextList); infoTextList.removeCommandEx(cmdCancel); infoTextList.addCommandEx(cmdBack, VirtualList.MENU_TYPE_LEFT_BAR);//#sijapp cond.if target!="RIM"# infoTextList.addCommandEx(cmdMenu, VirtualList.MENU_TYPE_RIGHT_BAR);//#sijapp cond.end# infoTextList.addCommandEx(cmdCopyText, VirtualList.MENU_TYPE_RIGHT); infoTextList.addCommandEx(cmdCopyAll, VirtualList.MENU_TYPE_RIGHT); } static public TextList getInfoTextList(String caption, boolean addCommands) { infoTextList = new TextList(null); //#sijapp cond.if target is "MIDP2" | target is "MOTOROLA"# infoTextList.setFontSize(Font.SIZE_MEDIUM); //#sijapp cond.else# //# infoTextList.setFontSize(Font.SIZE_SMALL); //#sijapp cond.end# infoTextList.setCaption(caption); JimmUI.setColorScheme(infoTextList, false, -1, true); infoTextList.setMode(VirtualList.CURSOR_MODE_DISABLED); if (addCommands) { infoTextList.addCommandEx(cmdBack, VirtualList.MENU_TYPE_LEFT_BAR);//#sijapp cond.if target!="RIM"# infoTextList.addCommandEx(cmdMenu, VirtualList.MENU_TYPE_RIGHT_BAR);//#sijapp cond.end# infoTextList.addCommandEx(cmdCopyText, VirtualList.MENU_TYPE_RIGHT); infoTextList.addCommandEx(cmdCopyAll, VirtualList.MENU_TYPE_RIGHT); infoTextList.setCommandListener(_this); } return infoTextList; } static public void showInfoTextList(TextList list) { list.activate(Jimm.display); } /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// static public String[] stdSelector = Util.explode("currect_contact" + "|" + "all_contact_except_this" + "|" + "all_contacts", '|'); static private TextList lstSelector; static private int lastSelectedItemIndex; static public void showSelector(String caption, String[] elements, CommandListener listener, int tag, boolean translateWords) { curScreenTag = tag; lstSelector = new TextList (ResourceBundle.getString(caption)); JimmUI.setColorScheme(lstSelector, false, -1, true); lstSelector.setCyclingCursor(true); lstSelector.setMode(VirtualList.CURSOR_MODE_DISABLED); lstSelector.setFontSize(Font.SIZE_LARGE); for (int i = 0; i < elements.length; i++) JimmUI.addTextListItem(lstSelector, elements[i], null, i, translateWords, -1, Font.STYLE_PLAIN); lstSelector.addCommandEx(cmdOk, VirtualList.MENU_TYPE_RIGHT_BAR); lstSelector.addCommandEx(cmdCancel, VirtualList.MENU_TYPE_LEFT_BAR); lstSelector.setCommandListener(_this); JimmUI.listener = listener; lstSelector.activate(Jimm.display); } static public int getLastSelIndex() { return lastSelectedItemIndex; } /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// static public void addMessageText(TextList textList, String text, int color, int messTotalCounter) { //#sijapp cond.if modules_SMILES_STD="true" | modules_SMILES_ANI="true" # Emotions.addTextWithEmotions(textList, text, Font.STYLE_PLAIN, color, messTotalCounter); //#sijapp cond.else# //# textList.addBigText(text, textList.getTextColor(), Font.STYLE_PLAIN, messTotalCounter); //#sijapp cond.end# textList.doCRLF(messTotalCounter); }///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// final private static ImageList messImgList = new ImageList(); final private static ImageList statusImgList = new ImageList(); final public static ImageList xStatusImages = new ImageList(); final public static Image statusEvilImg; final public static Image statusDepressionImg; final public static Image statusHomeImg; final public static Image statusWorkImg; final public static Image statusLunchImg; final public static Image statusAwayImg; final public static Image statusChatImg; final public static Image statusDndImg; final public static Image statusInvisibleImg; final public static Image statusNaImg; final public static Image statusOccupiedImg; final public static Image statusOfflineImg; final public static Image statusOnlineImg; final public static Image eventPlainMessageImg; final public static Image eventUrlMessageImg; final public static Image eventSystemNoticeImg; final public static Image eventSysActionImg; final public static Image imgTyping; final public static Image imgMessDeliv; final public static Image imgNoAuth; final public static StatusInfo[] statusInfos; static {//#sijapp cond.if target="MIDP2" | target="SIEMENS2"# int imgScale = Options.getInt(Options.OPTION_IMG_SCALE); statusImgList.setScale(imgScale); xStatusImages.setScale(imgScale); messImgList.setScale(imgScale);//#sijapp cond.end# boolean isNokia = Jimm.getPhoneVendor() == Jimm.PHONE_NOKIA; try { statusImgList.load("/statuses.png", -1, -1, -1, isNokia); } catch (Exception e) {} try { xStatusImages.load("/xstatus.png", -1, -1, -1, isNokia); } catch (Exception e) {} try { messImgList.load("/messages.png", -1, -1, -1, isNokia); } catch (Exception e) {} statusAwayImg = statusImgList.elementAt(0); statusChatImg = statusImgList.elementAt(1); statusDndImg = statusImgList.elementAt(2); statusInvisibleImg = statusImgList.elementAt(3); statusNaImg = statusImgList.elementAt(4); statusOccupiedImg = statusImgList.elementAt(5); statusOfflineImg = statusImgList.elementAt(6); statusOnlineImg = statusImgList.elementAt(7); statusEvilImg = statusImgList.elementAt(8); statusDepressionImg = statusImgList.elementAt(9); statusHomeImg = statusImgList.elementAt(10); statusWorkImg = statusImgList.elementAt(11); statusLunchImg = statusImgList.elementAt(12); imgNoAuth = statusImgList.elementAt(13); eventPlainMessageImg = messImgList.elementAt(0); eventUrlMessageImg = messImgList.elementAt(1); eventSystemNoticeImg = messImgList.elementAt(2); eventSysActionImg = messImgList.elementAt(3); imgTyping = messImgList.elementAt(4); imgMessDeliv = messImgList.elementAt(5); Vector data = new Vector(); /* Normal statuses */ addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_ONLINE, "status_online", statusOnlineImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR|StatusInfo.FLAG_STD); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_CHAT, "status_chat", statusChatImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR|StatusInfo.FLAG_STD); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_AWAY, "status_away", statusAwayImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR|StatusInfo.FLAG_STD); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_NA, "status_na", statusNaImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR|StatusInfo.FLAG_STD); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_OCCUPIED, "status_occupied", statusOccupiedImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR|StatusInfo.FLAG_STD); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_DND, "status_dnd", statusDndImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR|StatusInfo.FLAG_STD); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_INVISIBLE, "status_invisible", statusInvisibleImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_INVIS_ALL, "status_invis_all", statusInvisibleImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_EVIL, "status_evil", statusEvilImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_DEPRESSION, "status_depression", statusDepressionImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_HOME, "status_home", statusHomeImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_WORK, "status_work", statusWorkImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_LUNCH, "status_lunch", statusLunchImg, StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_STATUS, ContactList.STATUS_OFFLINE, "status_offline", statusOfflineImg, 0); /* Extended statuses */ addStatusInfo(data, StatusInfo.TYPE_X_STATUS, -2, "xstatus_none", null, StatusInfo.FLAG_IN_MENU); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x17, "xstatus_angry", xStatusImages.elementAt(0), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x01, "xstatus_duck", xStatusImages.elementAt(1), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x02, "xstatus_tired", xStatusImages.elementAt(2), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x03, "xstatus_party", xStatusImages.elementAt(3), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x04, "xstatus_beer", xStatusImages.elementAt(4), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x05, "xstatus_thinking", xStatusImages.elementAt(5), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x06, "xstatus_eating", xStatusImages.elementAt(6), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x07, "xstatus_tv", xStatusImages.elementAt(7), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x08, "xstatus_friends", xStatusImages.elementAt(8), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x09, "xstatus_coffee", xStatusImages.elementAt(9), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x0A, "xstatus_music", xStatusImages.elementAt(10), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x0B, "xstatus_business", xStatusImages.elementAt(11), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x0C, "xstatus_camera", xStatusImages.elementAt(12), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x0D, "xstatus_funny", xStatusImages.elementAt(13), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x0E, "xstatus_phone", xStatusImages.elementAt(14), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x0F, "xstatus_games", xStatusImages.elementAt(15), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x10, "xstatus_college", xStatusImages.elementAt(16), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x00, "xstatus_shopping", xStatusImages.elementAt(17), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x11, "xstatus_sick", xStatusImages.elementAt(18), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x12, "xstatus_sleeping", xStatusImages.elementAt(19), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x13, "xstatus_surfing", xStatusImages.elementAt(20), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x14, "xstatus_internet", xStatusImages.elementAt(21), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x15, "xstatus_engineering", xStatusImages.elementAt(22), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x16, "xstatus_typing", xStatusImages.elementAt(23), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_STD|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x18, "xstatus_unk", xStatusImages.elementAt(24), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x19, "xstatus_ppc", xStatusImages.elementAt(25), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x1A, "xstatus_mobile", xStatusImages.elementAt(26), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x1B, "xstatus_man", xStatusImages.elementAt(27), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x1C, "xstatus_wc", xStatusImages.elementAt(28), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x1D, "xstatus_question", xStatusImages.elementAt(29), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x1E, "xstatus_way", xStatusImages.elementAt(30), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x1F, "xstatus_heart", xStatusImages.elementAt(31), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x20, "xstatus_cigarette", xStatusImages.elementAt(32), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x21, "xstatus_sex", xStatusImages.elementAt(33), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x22, "xstatus_rambler_search", xStatusImages.elementAt(34), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); addStatusInfo(data, StatusInfo.TYPE_X_STATUS, 0x23, "xstatus_rambler_journal", xStatusImages.elementAt(35), StatusInfo.FLAG_IN_MENU|StatusInfo.FLAG_HAVE_DESCR); statusInfos = new StatusInfo[data.size()]; data.copyInto(statusInfos); } public static StatusInfo findStatus(int type, int value) { for (int i = 0; i < statusInfos.length; i++) { StatusInfo info = statusInfos[i]; if (info.getType() == type && info.getValue() == value) return info; } return null; } private static void addStatusInfo(Vector vct, int type, int value, String text, Image image, int flags) { vct.addElement(new StatusInfo(type, value, ResourceBundle.getString(text), image, flags)); } public static final int SHOW_STATUSES_NAME = 1 << 0; public static final int SHOW_STATUSES_DESCR = 1 << 1;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -