/** * Creates a new command panel object * * @param name * * @return A new instance of the class currently registered as status bar. */ public static CommandPanel createCommandPanel() { return instantiate(commandPanelClass); }
/** * Suspends encoding of the stream. * May be helpful if you need to embed a piece of * base640-encoded data in a stream. * * @since 1.5.1 * @throws java.io.IOException ie an error occurs during suspension. */ public void suspendEncoding() throws java.io.IOException { flushBase64(); this.suspendEncoding = true; } // end suspendEncoding
/** * Creates a Tooltop * * @param text * , the Text appearing in the Tooltip * @return HTML-String displaying the Tooltip */ public static String createToolTip(String text) { final String htmlColor = toHTMLColor(TOOLTIP_COLOR); return "<html><table bgColor=" + htmlColor + "><tr><td>" + text + "</td></tr></table></table>"; }
public void mouseExited(MouseEvent mouseEvent) { if (timerTask != null) { TaskEngine.getInstance().cancelScheduledTask(timerTask); } canShowPopup = false; UIComponentRegistry.getContactInfoWindow().dispose(); } });
public void chatRoomOpened(final ChatRoom room) { TimerTask task = new SwingTimerTask() { public void doRun() { addBuzzFeatureToChatRoom(room); } }; TaskEngine.getInstance().schedule(task, 100); }
public TaskNotification() { TimerTask task = new TimerTask() { public void run() { notifyUser(); } }; long twoHours = (60 * 1000) * 120; TaskEngine.getInstance().scheduleAtFixedRate(task, (10 * 1000), twoHours); }
public static URL newFileURL(String filePath) { if (filePath == null) { return null; } final String path = sanitizePath(filePath); return newURL("file", path); }
/** * Return the "distance" between two colors. * * @param color1 First color [r,g,b]. * @param color2 Second color [r,g,b]. * @return Distance bwetween colors. */ public static double colorDistance(double[] color1, double[] color2) { return ColorUtil.colorDistance(color1[0], color1[1], color1[2], color2[0], color2[1], color2[2]); }
/** * Encodes a byte array into Base64 notation. * Does not GZip-compress data. * * @param source The data to convert * @since 1.4 * @return Encoded string. */ public static String encodeBytes(byte[] source) { return encodeBytes(source, 0, source.length, NO_OPTIONS); } // end encodeBytes
/** * Make an even blend between two colors. * * @param color1 First color to blend. * @param color2 Second color to blend. * @return Blended color. */ public static Color blend(Color color1, Color color2) { return ColorUtil.blend(color1, color2, 0.5); }
/** * Puts the focus on the first component in the tree of <code>c</code> that * can accept the focus. * * @see #getFocusableComponentOrChild * @param c * Component to focus on. * @return Component that was focused on. */ public static Component focusComponentOrChild(Component c) { return focusComponentOrChild(c, false); }
/** * Creates an Iterator that is the reverse of a ListIterator. * * @param i Iterator of a list. * @return Reversed iterator. */ public static <T> Iterator<T> reverseListIterator(ListIterator<T> i) { return new ReverseListIterator<>( i ); } }
/** * Returns <CODE>null</CODE> if the specified string is empty or * <CODE>null</CODE>. Otherwise the string itself is returned. * * @param s String to check * @return Returns null string if string is empty, otherwise string itself. */ public static String nullifyIfEmpty(String s) { return ModelUtil.hasLength(s) ? s : null; }
public void windowDeactivated(final WindowEvent windowEvent) { TimerTask task = new SwingTimerTask() { public void doRun() { if (contactField.canClose()) { windowClosing(windowEvent); } } }; TaskEngine.getInstance().schedule(task, 250); } });
/** * Creates a new login dialog panel object * * @param name * * @return */ public static LoginDialog createLoginDialog() { return instantiate(loginDialogClass); }
/** * Creates a new contact list object. * * @return A new instance of the class currently registered as contact list. */ public static ContactList createContactList() { return instantiate(contactListClass); }
/** * Creates a new contact group object * * @param name * * @return A new instance of the class currently registered as status bar. */ public static StatusBar createStatusBar() { return instantiate(statusBarClass); }
/** * Creates a new contact group object. * * @param name * * @return A new instance of the class currently registered as contact * group. */ public static ContactGroup createContactGroup(String name) { return instantiate(contactGroupClass, name); }
/** * Creates a new chat room object. * * @return A new instance of the class currently registered as chat room. */ public static ChatRoom createChatRoom(EntityJid participantJID, Resourcepart participantNickname, CharSequence title) { return instantiate(chatRoomClass, participantJID, participantNickname, title); }
/** * Creates a new chat container object. * * @return A new instance of the class currently registered as chat * container. */ public static ChatContainer createChatContainer() { return instantiate(chatContainerClass); }