📄 jimmui.java.svn-base
字号:
} final public static String CRLFstr = "\n"; //////////////////////// // // // Color scheme // // // //////////////////////// static public final int INDEXED_COLOR_INCOMING = 0x01000000; static public final int INDEXED_COLOR_OUTGOING = 0x02000000; static public void setColorScheme(VirtualList vl, boolean setFullScreen, int theme, boolean changeFont) { if (vl == null) return; int cursorAlpha, menuAlpha; //#sijapp cond.if target="DEFAULT"# cursorAlpha = 255; menuAlpha = 255;//#sijapp cond.else# if (Jimm.display.numAlphaLevels() > 2) { cursorAlpha = 255-Options.getInt(Options.OPTION_CURSOR_ALPHA); menuAlpha = 255-Options.getInt(Options.OPTION_MENU_ALPHA); } else cursorAlpha = menuAlpha = 255; //#sijapp cond.end# vl.setColors ( Options.getSchemeColor(Options.CLRSCHHEME_CAP_TEXT, theme), Options.getSchemeColor(Options.CLRSCHHEME_CAP, theme), Options.getSchemeColor(Options.CLRSCHHEME_BACK, theme), Options.getSchemeColor(Options.CLRSCHHEME_CURS, theme), VirtualList.checkTextColor(Options.getSchemeColor(Options.CLRSCHHEME_TEXT, theme)), Options.getSchemeColor(Options.CLRSCHHEME_CURS_FRAME, theme), cursorAlpha, menuAlpha ); if (vl instanceof TextList) { TextList tl = (TextList)vl; tl.setIndexedColor(INDEXED_COLOR_INCOMING, Options.getSchemeColor(Options.CLRSCHHEME_INCOMING, theme)); tl.setIndexedColor(INDEXED_COLOR_OUTGOING, Options.getSchemeColor(Options.CLRSCHHEME_OUTGOING, theme)); } if (setFullScreen) vl.setFullScreen(Options.getBoolean(Options.OPTION_FULL_SCREEN)); else vl.setFullScreen(false); if (changeFont) vl.setFontSize(Options.getBoolean(Options.OPTION_SMALL_FONT) ? Font.SIZE_SMALL : Font.SIZE_MEDIUM); } /************************************************************************/ /************************************************************************/ /************************************************************************/ /////////////////// // // // Hotkeys // // // /////////////////// static public void execHotKey(ContactItem cItem, int keyCode, int type) { switch (keyCode) { case Canvas.KEY_NUM0: execHotKeyAction(Options.getInt(Options.OPTION_EXT_CLKEY0), cItem, type); break; case Canvas.KEY_NUM4: execHotKeyAction(Options.getInt(Options.OPTION_EXT_CLKEY4), cItem, type); break; case Canvas.KEY_NUM6: execHotKeyAction(Options.getInt(Options.OPTION_EXT_CLKEY6), cItem, type); break; case Canvas.KEY_STAR: execHotKeyAction(Options.getInt(Options.OPTION_EXT_CLKEYSTAR), cItem, type); break; case Canvas.KEY_POUND: execHotKeyAction(Options.getInt(Options.OPTION_EXT_CLKEYPOUND), cItem, type); break; //#sijapp cond.if target is "SIEMENS2"# //# case -11: //# // This means the CALL button was pressed... //# execHotKeyAction(Options.getInt(Options.OPTION_EXT_CLKEYCALL), cItem, type); //# break; //#sijapp cond.end# } } private static long lockPressedTime = -1; static private void execHotKeyAction(int actionNum, ContactItem item, int keyType) { if (keyType == VirtualList.KEY_PRESSED) { lockPressedTime = System.currentTimeMillis(); switch (actionNum) { //#sijapp cond.if modules_HISTORY is "true" # case Options.HOTKEY_HISTORY: if (item != null) item.showHistory(); break; //#sijapp cond.end# case Options.HOTKEY_INFO: if (item != null) { requiestUserInfo ( item.getStringValue(ContactItem.CONTACTITEM_UIN), item.getStringValue(ContactItem.CONTACTITEM_NAME), false //#sijapp cond.if target!="DEFAULT" & modules_AVATARS="true"#
,item.getBytesArray(ContactItem.CONTACTITEM_BUDDYICON_HASH) // #sijapp cond.end# ); } break; case Options.HOTKEY_NEWMSG: if (item != null) writeMessage(item, null); break; case Options.HOTKEY_USER_GROUPS: Options.setBoolean(Options.OPTION_USE_GROUPS, !Options.getBoolean(Options.OPTION_USE_GROUPS)); Options.safeSave(); ContactList.optionsChanged(true, false); ContactList.activateList(); break; case Options.HOTKEY_ONOFF: if (Options.getBoolean(Options.OPTION_CL_HIDE_OFFLINE)) Options.setBoolean(Options.OPTION_CL_HIDE_OFFLINE, false); else Options.setBoolean(Options.OPTION_CL_HIDE_OFFLINE, true); Options.safeSave(); ContactList.optionsChanged(true, false); ContactList.activateList(); break; case Options.HOTKEY_OPTIONS: Options.editOptions(); break; case Options.HOTKEY_MENU: MainMenu.activateMenu(); break; //#sijapp cond.if target is "MIDP2"# case Options.HOTKEY_MINIMIZE: Jimm.setMinimized(true); break; //#sijapp cond.end# case Options.HOTKEY_CLI_INFO: if (item != null) showClientInfo(item); break; //#sijapp cond.if target is "MIDP2" | target is "MOTOROLA" | target is "SIEMENS2"# case Options.HOTKEY_FULLSCR: boolean fsValue = !Options .getBoolean(Options.OPTION_FULL_SCREEN); VirtualList.setFullScreenForCurrent(fsValue); Options.setBoolean(Options.OPTION_FULL_SCREEN, fsValue); Options.safeSave(); //#sijapp cond.if target is "SIEMENS2"# //#sijapp cond.if modules_TRAFFIC is "true" # //# ContactList.updateTitle(Traffic.getSessionTraffic()); //#sijapp cond.else # //# ContactList.updateTitle(0); //#sijapp cond.end# //#sijapp cond.end# break; //#sijapp cond.end# //#sijapp cond.if target isnot "DEFAULT" # case Options.HOTKEY_SOUNDOFF: ContactList.changeSoundMode(false); MainMenu.build(); break; //#sijapp cond.end# case Options.HOTKEY_REQ_SM: requestContactStatusMess(item); break; } } else if ((keyType == VirtualList.KEY_REPEATED) || (keyType == VirtualList.KEY_RELEASED)) { if (lockPressedTime == -1) return; long diff = System.currentTimeMillis() - lockPressedTime; if ((actionNum == Options.HOTKEY_LOCK) && (diff > 900)) { lockPressedTime = -1; SplashCanvas.lock(); } } } /////////////////////////////////////////////////////////////////////////// // // // U S E R A N D C L I E N T I N F O // // // /////////////////////////////////////////////////////////////////////////// // Information about the user final public static int UI_UIN = 0; final public static int UI_NICK = 1; final public static int UI_NAME = 2; final public static int UI_EMAIL = 3; final public static int UI_CITY = 4; final public static int UI_STATE = 5; final public static int UI_PHONE = 6; final public static int UI_FAX = 7; final public static int UI_ADDR = 8; final public static int UI_CPHONE = 9; final public static int UI_AGE = 10; final public static int UI_GENDER = 11; final public static int UI_HOME_PAGE = 12; final public static int UI_BDAY = 13; final public static int UI_W_CITY = 14; final public static int UI_W_STATE = 15; final public static int UI_W_PHONE = 16; final public static int UI_W_FAX = 17; final public static int UI_W_ADDR = 18; final public static int UI_W_NAME = 19; final public static int UI_W_DEP = 20; final public static int UI_W_POS = 21; final public static int UI_ABOUT = 22; final public static int UI_INETRESTS1_T = 23; final public static int UI_INETRESTS1_V = 24; final public static int UI_INETRESTS2_T = 25; final public static int UI_INETRESTS2_V = 26; final public static int UI_INETRESTS3_T = 27; final public static int UI_INETRESTS3_V = 28; final public static int UI_INETRESTS4_T = 29; final public static int UI_INETRESTS4_V = 30; final public static int UI_AUTH = 31; final public static int UI_STATUS = 32; final public static int UI_ICQ_CLIENT = 33; final public static int UI_SIGNON = 34; final public static int UI_ONLINETIME = 35; final public static int UI_IDLE_TIME = 36; final public static int UI_REG_DATE = 37; final public static int UI_ICQ_VERS = 38; final public static int UI_INT_IP = 39; final public static int UI_EXT_IP = 40; final public static int UI_PORT = 41; final public static int UI_UIN_LIST = 42; final public static int UI_FIRST_NAME = 43; final public static int UI_LAST_NAME = 44; final public static int UI_ONLINE_STATUS = 45; final public static int UI_XSTATUS = 46; final public static int UI_CAPS = 47; ////// final public static int UI_LAST_ID = 48; static private int uiBigTextIndex; static private String uiSectName = null; static private void addToTextList(String str, String langStr, TextList list, boolean translate) { if (uiSectName != null) { list.addBigText(ResourceBundle.getString(uiSectName), list.getTextColor(), Font.STYLE_BOLD, -1).doCRLF(-1); uiSectName = null; } list.addBigText( (translate ? ResourceBundle.getString(langStr) : langStr) + ": ", list.getTextColor(), Font.STYLE_PLAIN, uiBigTextIndex) .addBigText(str, Options.getSchemeColor(Options.CLRSCHHEME_OUTGOING, -1), Font.STYLE_PLAIN, uiBigTextIndex) .doCRLF(uiBigTextIndex); uiBigTextIndex++; } static private void addToTextList(int index, String[] data, String langStr, TextList list, boolean translate) { String str = data[index]; if (str == null) return; if (str.length() == 0) return; addToTextList(str, langStr, list, translate); } static private void fillInterests(int type, int value, String[] data, TextList list) { String strType = data[type]; String strValue = data[value]; if (strType == null) return; if (strValue == null) strValue = new String(); String interestName = (String)Icq.interests.get(strType); if (interestName == null) return; addToTextList(strValue, interestName, list, false); } static public void fillUserInfo(String[] data, TextList list) { uiSectName = "main_info"; addToTextList(UI_UIN_LIST, data, "uin", list, true); addToTextList(UI_NICK, data, "nick", list, true); addToTextList(UI_NAME, data, "name", list, true); addToTextList(UI_GENDER, data, "gender", list, true); addToTextList(UI_AGE, data, "age", list, true); addToTextList(UI_EMAIL, data, "email", list, true); if (data[UI_AUTH] != null) addToTextList(data[UI_AUTH].equals("1") ? ResourceBundle .getString("yes") : ResourceBundle.getString("no"), "auth", list, true); addToTextList(UI_BDAY, data, "birth_day", list, true); addToTextList(UI_CPHONE, data, "cell_phone", list, true); addToTextList(UI_HOME_PAGE, data, "home_page", list, true); addToTextList(UI_ABOUT, data, "notes", list, true); if (data[UI_STATUS] != null) { int stat = Integer.parseInt(data[UI_STATUS]); int imgIndex = 0; if (stat == 0) imgIndex = 6; else if (stat == 1) imgIndex = 7; else if (stat == 2) imgIndex = 3; list.addBigText(ResourceBundle.getString("status") + ": ", list.getTextColor(), Font.STYLE_PLAIN, uiBigTextIndex) .addImage(JimmUI.statusImgList.elementAt(imgIndex), null, uiBigTextIndex).doCRLF(uiBigTextIndex); uiBigTextIndex++; } uiSectName = "interests"; fillInterests(UI_INETRESTS1_T, UI_INETRESTS1_V, data, list); fillInterests(UI_INETRESTS2_T, UI_INETRESTS2_V, data, list); fillInterests(UI_INETRESTS3_T, UI_INETRESTS3_V, data, list); fillInterests(UI_INETRESTS4_T, UI_INETRESTS4_V, data, list); uiSectName = "home_info"; addToTextList(UI_CITY, data, "city", list, true); addToTextList(UI_STATE, data, "state", list, true); addToTextList(UI_ADDR, data, "addr", list, true); addToTextList(UI_PHONE, data, "phone", list, true); addToTextList(UI_FAX, data, "fax", list, true);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -