Javadoc fixes and using superclass when injecting WindowFocusListener
This commit is contained in:
parent
6cf8c462b9
commit
8247e18fce
@ -49,7 +49,7 @@ public class LocalDB {
|
||||
/**
|
||||
* Constructs an empty local database.
|
||||
*
|
||||
* @param client the user that is logged in with this client
|
||||
* @param sender the user that is logged in with this client
|
||||
* @since Envoy v0.1-alpha
|
||||
*/
|
||||
public LocalDB(User sender) {
|
||||
@ -118,7 +118,9 @@ public class LocalDB {
|
||||
* Creates a {@link Message} object serializable to XML.
|
||||
*
|
||||
* @param textContent The content (text) of the message
|
||||
* @param recipient The recipient of the message
|
||||
* @return prepared {@link Message} object
|
||||
* @since Envoy v0.1-alpha
|
||||
*/
|
||||
public Message createMessage(String textContent, User recipient) {
|
||||
Message.Metadata metaData = objectFactory.createMessageMetadata();
|
||||
|
@ -8,6 +8,7 @@ import java.awt.SystemTray;
|
||||
import java.awt.Toolkit;
|
||||
import java.awt.TrayIcon;
|
||||
import java.awt.TrayIcon.MessageType;
|
||||
import java.awt.Window;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.util.HashSet;
|
||||
@ -46,11 +47,14 @@ public class StatusTrayIcon implements EventHandler {
|
||||
/**
|
||||
* Creates a {@link StatusTrayIcon} with the Envoy logo, a tool tip and a pop-up
|
||||
* menu.
|
||||
*
|
||||
*
|
||||
* @param focusTarget the {@link Window} which focus determines if message
|
||||
* notifications are displayed
|
||||
* @throws EnvoyException if the currently used OS does not support the System
|
||||
* Tray API
|
||||
* @since Envoy v0.2-alpha
|
||||
*/
|
||||
public StatusTrayIcon(ChatWindow chatWindow) throws EnvoyException {
|
||||
public StatusTrayIcon(Window focusTarget) throws EnvoyException {
|
||||
if (!SystemTray.isSupported()) throw new EnvoyException("The Envoy tray icon is not supported.");
|
||||
|
||||
ClassLoader loader = Thread.currentThread().getContextClassLoader();
|
||||
@ -68,7 +72,7 @@ public class StatusTrayIcon implements EventHandler {
|
||||
trayIcon.setPopupMenu(popup);
|
||||
|
||||
// Only display messages if the chat window is not focused
|
||||
chatWindow.addWindowFocusListener(new WindowAdapter() {
|
||||
focusTarget.addWindowFocusListener(new WindowAdapter() {
|
||||
|
||||
@Override
|
||||
public void windowGainedFocus(WindowEvent e) {
|
||||
@ -103,7 +107,7 @@ public class StatusTrayIcon implements EventHandler {
|
||||
/**
|
||||
* Notifies the user of a message by displaying a pop-up every time a new
|
||||
* message is received.
|
||||
*
|
||||
*
|
||||
* @since Envoy v0.2-alpha
|
||||
*/
|
||||
@Override
|
||||
@ -116,7 +120,7 @@ public class StatusTrayIcon implements EventHandler {
|
||||
/**
|
||||
* The {@link StatusTrayIcon} only reacts to {@link MessageCreationEvent}
|
||||
* instances which signify newly received messages.
|
||||
*
|
||||
*
|
||||
* @return A set with the single element {@code MessageCreationEvent.class}
|
||||
* @since Envoy v0.2-alpha
|
||||
*/
|
||||
|
Reference in New Issue
Block a user