trayIcon.setImage(updatedImage);
public synchronized void blink() { if (state == 0) { synchronized (MageTray.class) { if (state == 0) { state = 1; new Thread(() -> { try { int i = 0; while (state != 3) { trayIcon.setImage(i == 0 ? mainImage : flashedImage); TimeUnit.MILLISECONDS.sleep(600); i = i == 0 ? 1 : 0; } trayIcon.setImage(mainImage); state = 0; } catch (InterruptedException e) { e.printStackTrace(); } }).start(); } } } }
private void showTomatoIcon() { Image image = icons.tomato(); trayIcon.setImage(image); }
@Override public void receive(TimerTick tick) { if(options.ui().showTimeOnTray()) { Time time = tick.getTime(); Image image = icons.time(time); trayIcon.setImage(image); } } }
@Override public void connectionClosedOnError(Exception arg0) { trayIcon.setImage(offlineIcon.getImage()); } });
@Override public void connected( XMPPConnection xmppConnection ) { trayIcon.setImage( availableIcon.getImage() ); }
@Override public void connectionClosed() { trayIcon.setImage(offlineIcon.getImage()); }
@Override public void authenticated( XMPPConnection xmppConnection, boolean b ) { trayIcon.setImage( availableIcon.getImage() ); }
private void changeSysTrayIcon() { if (pref.isTypingNotificationShown()) { trayIcon.setImage(typingIcon.getImage()); } }
/** * Sets the system tray icon if it's different from the icon already in use. * * @param icon The tray icon to use. */ public void setTrayIcon(final Image icon) { if (trayIcon.getImage() != icon) { trayIcon.setImage(icon); } }
@EventListener(IgnoreUserEventsEvent.class) public void ignoreUserEvents() { if (paused) { return; } Optional<TrayIcon> optionalSystemTrayIcon = getSystemTrayIcon(); if (!optionalSystemTrayIcon.isPresent()) { LOG.error("Failed to set icon to ignored, tray icon was not found"); return; } TrayIcon trayIcon = optionalSystemTrayIcon.get(); trayIcon.setImage(imageUtils.createImage(Images.TRAY_ICON_IGNORED)); }
@EventListener(ConsiderUserEventsEvent.class) public void considerUserEventsEvent() { if (paused) { return; } Optional<TrayIcon> optionalSystemTrayIcon = getSystemTrayIcon(); if (!optionalSystemTrayIcon.isPresent()) { LOG.error("Failed to set icon to active, tray icon was not found"); return; } TrayIcon trayIcon = optionalSystemTrayIcon.get(); trayIcon.setImage(imageUtils.createImage(Images.TRAY_ICON)); }
public void toggleButton(boolean startEnabled) { startItem.setEnabled(startEnabled); stopItem.setEnabled(!startEnabled); icon.setImage(NORMAL_ICON); }
@Override public void flashWindow(Window window) { if (pref.isSystemTrayNotificationEnabled()) { trayIcon.setImage(newMessageIcon.getImage()); if (window instanceof JFrame) { ((JFrame) window).setTitle(getCounteredTitle( ((JFrame) window).getTitle(), chatMessageHandler.getUnreadMessages())); } newMessage = true; } }
@Override public void send(Notification notification) { if (!skipNotifications) { icon.setImage(createImage(notification.icon().toByteArray())); icon.displayMessage(notification.title(), notification.message(), toMessageType(notification.level())); } }
@Override public void send(Notification notification) { if (!skipNotifications) { icon.setImage(createImage(notification.icon().toByteArray())); icon.displayMessage(notification.title(), notification.message(), toMessageType(notification.level())); } }