Normalized since tags to fit envoy-common and envoy-server

Envoy vXXX -> Envoy Client vXXX
This commit is contained in:
Kai S. K. Engelbart 2020-03-23 21:52:33 +01:00
parent 3dd9884cd9
commit 86d437760d
58 changed files with 238 additions and 238 deletions

View File

@ -34,7 +34,7 @@ import envoy.util.EnvoyLog;
* @author Leon Hofmeister
* @author Maximilian Käfer
* @author Kai S. K. Engelbart
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public class Startup {
@ -51,7 +51,7 @@ public class Startup {
*
* @param args the command line arguments may contain configuration parameters
* and are parsed by the {@link Config} class
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public static void main(String[] args) {
ClientConfig config = ClientConfig.getInstance();

View File

@ -17,7 +17,7 @@ import envoy.util.EnvoyLog;
*
* @param <T> the type of cached elements
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class Cache<T> implements Consumer<T>, Serializable {
@ -31,7 +31,7 @@ public class Cache<T> implements Consumer<T>, Serializable {
* Adds an element to the cache.
*
* @param element the element to add
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
@Override
public void accept(T element) {
@ -43,7 +43,7 @@ public class Cache<T> implements Consumer<T>, Serializable {
* Sets the processor to which cached elements are relayed.
*
* @param processor the processor to set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void setProcessor(Consumer<T> processor) { this.processor = processor; }
@ -51,7 +51,7 @@ public class Cache<T> implements Consumer<T>, Serializable {
* Relays all cached elements to the processor.
*
* @throws IllegalStateException if the processor is not initialized
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void relay() {
if (processor == null) throw new IllegalStateException("Processor is not defined");

View File

@ -21,7 +21,7 @@ import envoy.event.MessageStatusChangeEvent;
* @author Maximilian K&auml;fer
* @author Leon Hofmeister
* @author Kai S. K. Engelbart
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public class Chat implements Serializable {
@ -35,7 +35,7 @@ public class Chat implements Serializable {
* Saves the Messages in the corresponding chat at that Point.
*
* @param recipient the user who receives the messages
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public Chat(User recipient) { this.recipient = recipient; }
@ -43,7 +43,7 @@ public class Chat implements Serializable {
* Appends a message to the bottom of this chat
*
* @param message the message to append
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public void appendMessage(Message message) { model.add(message); }
@ -56,7 +56,7 @@ public class Chat implements Serializable {
* the message status changes
* @throws IOException if a {@link MessageStatusChangeEvent} could not be
* delivered to the server
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void read(WriteProxy writeProxy) throws IOException {
for (int i = model.size() - 1; i >= 0; --i) {
@ -72,19 +72,19 @@ public class Chat implements Serializable {
/**
* @return {@code true} if the newest message received in the chat doesn't have
* the status {@code READ}
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public boolean isUnread() { return !model.isEmpty() && model.get(model.size() - 1).getStatus() != MessageStatus.READ; }
/**
* @return all messages in the current chat
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public Model<Message> getModel() { return model; }
/**
* @return the recipient of a message
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public User getRecipient() { return recipient; }
}

View File

@ -18,7 +18,7 @@ import envoy.data.LoginCredentials;
* Created: <strong>01.03.2020</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public class ClientConfig extends Config {
@ -26,7 +26,7 @@ public class ClientConfig extends Config {
/**
* @return the singleton instance of the client config
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public static ClientConfig getInstance() {
if (config == null) config = new ClientConfig();
@ -47,68 +47,68 @@ public class ClientConfig extends Config {
/**
* @return the host name of the Envoy server
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public String getServer() { return (String) items.get("server").get(); }
/**
* @return the port at which the Envoy server is located on the host
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public Integer getPort() { return (Integer) items.get("port").get(); }
/**
* @return the local database specific to the client user
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public File getLocalDB() { return (File) items.get("localDB").get(); }
/**
* @return {@code true} if the local database is to be ignored
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public Boolean isIgnoreLocalDB() { return (Boolean) items.get("ignoreLocalDB").get(); }
/**
* @return the directory in which all local files are saves
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public File getHomeDirectory() { return (File) items.get("homeDirectory").get(); }
/**
* @return the minimal {@link Level} to log inside the log file
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Level getFileLevelBarrier() { return (Level) items.get("fileLevelBarrier").get(); }
/**
* @return the minimal {@link Level} to log inside the console
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Level getConsoleLevelBarrier() { return (Level) items.get("consoleLevelBarrier").get(); }
/**
* @return the user name
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public String getUser() { return (String) items.get("user").get(); }
/**
* @return the password
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public char[] getPassword() { return (char[]) items.get("password").get(); }
/**
* @return {@code true} if user name and password are set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public boolean hasLoginCredentials() { return getUser() != null && getPassword() != null; }
/**
* @return login credentials for the specified user name and password, without
* the registration option
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public LoginCredentials getLoginCredentials() {
try {

View File

@ -16,7 +16,7 @@ import envoy.event.MessageStatusChangeEvent;
* Created: <strong>3 Feb 2020</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public abstract class LocalDb {
@ -30,7 +30,7 @@ public abstract class LocalDb {
/**
* Initializes a storage space for a user-specific list of chats.
*
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void initializeUserStorage() {}
@ -39,7 +39,7 @@ public abstract class LocalDb {
* as well. The message id generator will also be saved if present.
*
* @throws Exception if the saving process failed
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void save() throws Exception {}
@ -47,7 +47,7 @@ public abstract class LocalDb {
* Loads all user data.
*
* @throws Exception if the loading process failed
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void loadUsers() throws Exception {}
@ -55,21 +55,21 @@ public abstract class LocalDb {
* Loads all data of the client user.
*
* @throws Exception if the loading process failed
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void loadUserData() throws Exception {}
/**
* Loads the ID generator. Any exception thrown during this process is ignored.
*
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void loadIdGenerator() {}
/**
* @return a {@code Map<String, User>} of all users stored locally with their
* user names as keys
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Map<String, User> getUsers() { return users; }
@ -81,7 +81,7 @@ public abstract class LocalDb {
/**
* @return all saved {@link Chat} objects that list the client user as the
* sender
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
**/
public List<Chat> getChats() { return chats; }
@ -92,55 +92,55 @@ public abstract class LocalDb {
/**
* @return the {@link User} who initialized the local database
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public User getUser() { return user; }
/**
* @param user the user to set
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void setUser(User user) { this.user = user; }
/**
* @return the message ID generator
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public IdGenerator getIdGenerator() { return idGenerator; }
/**
* @param idGenerator the message ID generator to set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void setIdGenerator(IdGenerator idGenerator) { this.idGenerator = idGenerator; }
/**
* @return {@code true} if an {@link IdGenerator} is present
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public boolean hasIdGenerator() { return idGenerator != null; }
/**
* @return the offline message cache
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public Cache<Message> getMessageCache() { return messageCache; }
/**
* @param messageCache the offline message cache to set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void setMessageCache(Cache<Message> messageCache) { this.messageCache = messageCache; }
/**
* @return the offline status cache
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public Cache<MessageStatusChangeEvent> getStatusCache() { return statusCache; }
/**
* @param statusCache the offline status cache to set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void setStatusCache(Cache<MessageStatusChangeEvent> statusCache) { this.statusCache = statusCache; }
@ -150,7 +150,7 @@ public abstract class LocalDb {
* @param id the ID of the message to search for
* @return the message with the corresponding ID, or {@code null} if no message
* has been found
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Message getMessage(long id) {
for (Chat c : chats)

View File

@ -19,7 +19,7 @@ import envoy.util.SerializationUtils;
*
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public class PersistentLocalDb extends LocalDb {
@ -32,7 +32,7 @@ public class PersistentLocalDb extends LocalDb {
* This constructor shall be used in conjunction with the {@code ignoreLocalDB}
* {@link ConfigItem}.
*
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public PersistentLocalDb() {}
@ -42,7 +42,7 @@ public class PersistentLocalDb extends LocalDb {
*
* @param localDbDir the directory in which to store users and chats
* @throws IOException if the PersistentLocalDb could not be initialized
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public PersistentLocalDb(File localDbDir) throws IOException {
localDBDir = localDbDir;
@ -58,7 +58,7 @@ public class PersistentLocalDb extends LocalDb {
* Creates a database file for a user-specific list of chats.
*
* @throws NullPointerException if the client user is not yet specified
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
@Override
public void initializeUserStorage() {

View File

@ -22,7 +22,7 @@ import envoy.util.SerializationUtils;
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @author Kai S. K. Engelbart
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public class Settings {
@ -49,7 +49,7 @@ public class Settings {
* The way to instantiate the settings.
* Is set to private to deny other instances of that object.
*
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
private Settings() {
// Load settings from settings file
@ -81,7 +81,7 @@ public class Settings {
* This method is used to ensure that there is only one instance of Settings.
*
* @return the instance of Settings
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public static Settings getInstance() { return settings; }
@ -90,7 +90,7 @@ public class Settings {
*
* @throws IOException if an error occurs while saving the themes to the theme
* file
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void save() throws IOException {
// Save settings to settings file
@ -110,19 +110,19 @@ public class Settings {
* Adds new theme to the theme map.
*
* @param theme the {@link Theme} to add
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void addNewThemeToMap(Theme theme) { getThemes().put(theme.getThemeName(), theme); }
/**
* @return the name of the currently active {@link Theme}
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public String getCurrentThemeName() { return (String) items.get("currentTheme").get(); }
/**
* @return the currently active {@link Theme}
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Theme getCurrentTheme() { return getTheme(getCurrentThemeName()); }
@ -130,7 +130,7 @@ public class Settings {
* Sets the name of the current {@link Theme}.
*
* @param themeName the name to set
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void setCurrentTheme(String themeName) { ((SettingsItem<String>) items.get("currentTheme")).set(themeName); }
@ -138,7 +138,7 @@ public class Settings {
* @return {@code true}, if pressing the {@code Enter} key suffices to send a
* message. Otherwise it has to be pressed in conjunction with the
* {@code Control} key.
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Boolean isEnterToSend() { return (Boolean) items.get("enterToSend").get(); }
@ -148,13 +148,13 @@ public class Settings {
* @param enterToSend If set to {@code true} a message can be sent by pressing
* the {@code Enter} key. Otherwise it has to be pressed in
* conjunction with the {@code Control} key.
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void setEnterToSend(boolean enterToSend) { ((SettingsItem<Boolean>) items.get("enterToSend")).set(enterToSend); }
/**
* @return the current on close mode.
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public Boolean getCurrentOnCloseMode() { return (Boolean) items.get("onCloseMode").get(); }
@ -162,7 +162,7 @@ public class Settings {
* Sets the current on close mode.
*
* @param currentOnCloseMode the on close mode that should be set.
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void setCurrentOnCloseMode(boolean currentOnCloseMode) { ((SettingsItem<Boolean>) items.get("onCloseMode")).set(currentOnCloseMode); }
@ -178,7 +178,7 @@ public class Settings {
/**
* @return a {@code Map<String, Theme>} of all themes with their names as keys
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Map<String, Theme> getThemes() { return themes; }
@ -186,14 +186,14 @@ public class Settings {
* Sets the {@code Map<String, Theme>} of all themes with their names as keys
*
* @param themes the theme map to set
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void setThemes(Map<String, Theme> themes) { this.themes = themes; }
/**
* @param themeName the name of the {@link Theme} to get
* @return the {@link Theme} with the specified name
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public Theme getTheme(String themeName) { return themes.get(themeName); }
}

View File

@ -19,7 +19,7 @@ import envoy.client.ui.primary.PrimaryToggleSwitch;
*
* @param <T> the type of this {@link SettingsItem}'s value
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class SettingsItem<T> implements Serializable {
@ -45,7 +45,7 @@ public class SettingsItem<T> implements Serializable {
* @param value the default value
* @param userFriendlyName the user friendly name (short)
* @param description the description (long)
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public SettingsItem(T value, String userFriendlyName, String description) {
this(value, componentClasses.get(value.getClass()));
@ -61,7 +61,7 @@ public class SettingsItem<T> implements Serializable {
*
* @param value the default value
* @param componentClass the class of the {@link JComponent} to represent this {@link SettingsItem} with
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public SettingsItem(T value, Class<? extends JComponent> componentClass) {
this.value = value;
@ -72,7 +72,7 @@ public class SettingsItem<T> implements Serializable {
* @return an instance of the {@link JComponent} that represents this {@link SettingsItem}
* @throws ReflectiveOperationException if the component initialization failed
* @throws SecurityException if the component initialization failed
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public JComponent getComponent() throws ReflectiveOperationException, SecurityException {
if (componentClass == null) throw new NullPointerException("Component class is null");
@ -81,7 +81,7 @@ public class SettingsItem<T> implements Serializable {
/**
* @return the value
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public T get() { return value; }
@ -90,7 +90,7 @@ public class SettingsItem<T> implements Serializable {
* defined, it will be invoked with this value.
*
* @param value the value to set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void set(T value) {
if (changeHandler != null && value != this.value) changeHandler.accept(value);
@ -99,37 +99,37 @@ public class SettingsItem<T> implements Serializable {
/**
* @return the componentClass
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public Class<? extends JComponent> getComponentClass() { return componentClass; }
/**
* @param componentClass the componentClass to set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void setComponentClass(Class<? extends JComponent> componentClass) { this.componentClass = componentClass; }
/**
* @return the userFriendlyName
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public String getUserFriendlyName() { return userFriendlyName; }
/**
* @param userFriendlyName the userFriendlyName to set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void setUserFriendlyName(String userFriendlyName) { this.userFriendlyName = userFriendlyName; }
/**
* @return the description
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public String getDescription() { return description; }
/**
* @param description the description to set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void setDescription(String description) { this.description = description; }
@ -139,7 +139,7 @@ public class SettingsItem<T> implements Serializable {
* when the value changes.
*
* @param changeHandler the changeHandler to set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void setChangeHandler(Consumer<T> changeHandler) {
this.changeHandler = changeHandler;

View File

@ -9,7 +9,7 @@ package envoy.client.data;
* Created: <strong>3 Feb 2020</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class TransientLocalDb extends LocalDb {
}

View File

@ -4,6 +4,6 @@
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
package envoy.client.data;

View File

@ -10,7 +10,7 @@ import envoy.event.Event;
* Created: <strong>8 Feb 2020</strong><br>
*
* @author Leon Hofmeister
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class HandshakeSuccessfulEvent extends Event.Valueless {

View File

@ -9,7 +9,7 @@ import envoy.event.Event;
* Created: <strong>4 Dec 2019</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public class MessageCreationEvent extends Event<Message> {

View File

@ -9,7 +9,7 @@ import envoy.event.Event;
* Created: <strong>4 Dec 2019</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public class MessageModificationEvent extends Event<Message> {

View File

@ -9,7 +9,7 @@ import envoy.event.Event;
*
* @author: Maximilian K&aumlfer
*
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class SendEvent extends Event<Event<?>> {

View File

@ -9,7 +9,7 @@ import envoy.event.Event;
* Created: <strong>15 Dec 2019</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public class ThemeChangeEvent extends Event<Theme> {
@ -20,7 +20,7 @@ public class ThemeChangeEvent extends Event<Theme> {
* of the {@link Theme} currently in use
*
* @param theme the new currently used {@link Theme} object
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public ThemeChangeEvent(Theme theme) { super(theme); }
}

View File

@ -4,6 +4,6 @@
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
package envoy.client.event;

View File

@ -30,7 +30,7 @@ import envoy.util.SerializationUtils;
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @author Leon Hofmeister
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public class Client implements Closeable {
@ -124,7 +124,7 @@ public class Client implements Closeable {
* initialization
* @throws IOException if no {@link IdGenerator} is present and none could be
* requested from the server
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void initReceiver(LocalDb localDb, Cache<Message> receivedMessageCache) throws IOException {
checkOnline();
@ -181,7 +181,7 @@ public class Client implements Closeable {
*
* @param message the message to send
* @throws IOException if the message does not reach the server
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void sendMessage(Message message) throws IOException {
writeObject(message);
@ -200,7 +200,7 @@ public class Client implements Closeable {
* Requests a new {@link IdGenerator} from the server.
*
* @throws IOException if the request does not reach the server
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void requestIdGenerator() throws IOException {
logger.info("Requesting new id generator...");
@ -210,7 +210,7 @@ public class Client implements Closeable {
/**
* @return a {@code Map<String, User>} of all users on the server with their
* user names as keys
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Map<String, User> getUsers() {
checkOnline();
@ -232,7 +232,7 @@ public class Client implements Closeable {
/**
* @return the sender object that represents this client.
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public User getSender() { return sender; }
@ -240,7 +240,7 @@ public class Client implements Closeable {
* Sets the client user which is used to send messages.
*
* @param sender the client user to set
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void setSender(User sender) { this.sender = sender; }
@ -251,19 +251,19 @@ public class Client implements Closeable {
/**
* @return {@code true} if a connection to the server could be established
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public boolean isOnline() { return online; }
/**
* @return the contacts of this {@link Client}
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public Contacts getContacts() { return contacts; }
/**
* @param contacts the contacts to set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void setContacts(Contacts contacts) { this.contacts = contacts; }
}

View File

@ -14,7 +14,7 @@ import envoy.util.EnvoyLog;
* Created: <strong>4 Feb 2020</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class MessageStatusChangeEventProcessor implements Consumer<MessageStatusChangeEvent> {
@ -25,7 +25,7 @@ public class MessageStatusChangeEventProcessor implements Consumer<MessageStatus
* {@code RECEIVED} or {@code READ}.
*
* @param evt the status change event
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
@Override
public void accept(MessageStatusChangeEvent evt) {

View File

@ -15,7 +15,7 @@ import envoy.util.EnvoyLog;
* Created: <strong>31.12.2019</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class ReceivedMessageProcessor implements Consumer<Message> {

View File

@ -19,7 +19,7 @@ import envoy.util.SerializationUtils;
* Created: <strong>30.12.2019</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class Receiver extends Thread {

View File

@ -12,7 +12,7 @@ import envoy.event.UserStatusChangeEvent;
* Created: <strong>2 Feb 2020</strong><br>
*
* @author Leon Hofmeister
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class UserStatusChangeProcessor implements Consumer<UserStatusChangeEvent> {
@ -20,7 +20,7 @@ public class UserStatusChangeProcessor implements Consumer<UserStatusChangeEvent
/**
* @param localDb the local database in which status updates will by applied
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public UserStatusChangeProcessor(LocalDb localDb) { this.localDb = localDb; }

View File

@ -19,7 +19,7 @@ import envoy.util.EnvoyLog;
* Created: <strong>6 Feb 2020</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class WriteProxy {
@ -36,7 +36,7 @@ public class WriteProxy {
* events
* @param localDb the local database used to cache messages and message status
* change events
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public WriteProxy(Client client, LocalDb localDb) {
this.client = client;
@ -68,7 +68,7 @@ public class WriteProxy {
* Sends cached {@link Message}s and {@link MessageStatusChangeEvent}s to the
* server.
*
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void flushCache() {
// Send messages
@ -84,7 +84,7 @@ public class WriteProxy {
*
* @param message the message to send
* @throws IOException if the message could not be sent
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void writeMessage(Message message) throws IOException {
if (client.isOnline()) client.sendMessage(message);
@ -97,7 +97,7 @@ public class WriteProxy {
*
* @param evt the event to send
* @throws IOException if the event could not be sent
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void writeMessageStatusChangeEvent(MessageStatusChangeEvent evt) throws IOException {
if (client.isOnline()) client.sendEvent(evt);

View File

@ -4,6 +4,6 @@
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
package envoy.client.net;

View File

@ -11,7 +11,7 @@ import java.awt.color.ColorSpace;
* Created: <strong>23.12.2019</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
@SuppressWarnings("javadoc")
public class Color extends java.awt.Color {
@ -102,13 +102,13 @@ public class Color extends java.awt.Color {
/**
* @return the inversion of this {@link Color} by replacing the red, green and
* blue values by subtracting them form 255
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public Color invert() { return new Color(255 - getRed(), 255 - getGreen(), 255 - getBlue()); }
/**
* @return the hex value of this {@link Color}
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public String toHex() { return String.format("#%02x%02x%02x", getRed(), getGreen(), getBlue()); }
}

View File

@ -24,7 +24,7 @@ import javax.swing.*;
* Created: <strong>17 Mar 2020</strong><br>
*
* @author Leon Hofmeister
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public class ContextMenu extends JPopupMenu {
@ -54,7 +54,7 @@ public class ContextMenu extends JPopupMenu {
/**
* @param parent the component which will call this
* {@link ContextMenu}
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public ContextMenu(Component parent) { setInvoker(parent); }
@ -72,7 +72,7 @@ public class ContextMenu extends JPopupMenu {
* @param itemMnemonics the keyboard shortcuts that need to be pressed to
* automatically execute the {@link JMenuItem} with the
* given text
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public ContextMenu(String label, Component parent, Map<String, ActionListener> itemsWithActions, Map<String, Icon> itemIcons,
Map<String, Integer> itemMnemonics) {
@ -89,7 +89,7 @@ public class ContextMenu extends JPopupMenu {
*
* @return this instance of {@link ContextMenu} to allow chaining behind the
* constructor
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public ContextMenu build() {
items.forEach((text, action) -> {
@ -119,7 +119,7 @@ public class ContextMenu extends JPopupMenu {
/**
* @param label the string that a UI may use to display as a title for the
* pop-up menu.
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public ContextMenu(String label) { super(label); }
@ -149,7 +149,7 @@ public class ContextMenu extends JPopupMenu {
/**
* Removes all subcomponents of this menu.
*
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public void clear() {
removeAll();
@ -160,33 +160,33 @@ public class ContextMenu extends JPopupMenu {
/**
* @return the items
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Map<String, ActionListener> getItems() { return items; }
/**
* @param items the items with the displayed text and the according action to
* take once called
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public void setItems(Map<String, ActionListener> items) { this.items = items; }
/**
* @return the icons
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Map<String, Icon> getIcons() { return icons; }
/**
* @param icons the icons to set
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public void setIcons(Map<String, Icon> icons) { this.icons = icons; }
/**
* @return the mnemonics (the keyboard shortcuts that automatically execute the
* command for a {@link JMenuItem} with corresponding text)
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Map<String, Integer> getMnemonics() { return mnemonics; }
@ -194,7 +194,7 @@ public class ContextMenu extends JPopupMenu {
* @param mnemonics the keyboard shortcuts that need to be pressed to
* automatically execute the {@link JMenuItem} with the given
* text
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public void setMnemonics(Map<String, Integer> mnemonics) { this.mnemonics = mnemonics; }
}

View File

@ -17,7 +17,7 @@ import javax.swing.ImageIcon;
* Created: <strong>16.03.2020</strong>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public class IconUtil {
@ -30,7 +30,7 @@ public class IconUtil {
* @param size the size to scale the icon to
* @return the scaled icon
* @throws IOException if the loading process failed
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public static ImageIcon load(String path, int size) throws IOException {
return new ImageIcon(ImageIO.read(IconUtil.class.getResourceAsStream(path)).getScaledInstance(size, size, Image.SCALE_SMOOTH));
@ -49,7 +49,7 @@ public class IconUtil {
* @return a map containing the loaded icons with the corresponding enum
* constants as keys
* @throws IOException if the loading process failed
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public static <T extends Enum<T>> EnumMap<T, ImageIcon> loadByEnum(Class<T> enumClass, int size) throws IOException {
var icons = new EnumMap<T, ImageIcon>(enumClass);

View File

@ -16,7 +16,7 @@ import envoy.exception.EnvoyException;
* Created: <strong>3 Dec 2019</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public class StatusTrayIcon {
@ -41,7 +41,7 @@ public class StatusTrayIcon {
* notifications are displayed
* @throws EnvoyException if the currently used OS does not support the System
* Tray API
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public StatusTrayIcon(Window focusTarget) throws EnvoyException {
if (!SystemTray.isSupported()) throw new EnvoyException("The Envoy tray icon is not supported.");
@ -85,7 +85,7 @@ public class StatusTrayIcon {
*
* @throws EnvoyException if the status icon could not be attaches to the system
* tray for system-internal reasons
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void show() throws EnvoyException {
try {

View File

@ -10,7 +10,7 @@ import java.util.Map;
* Created: <strong>23 Nov 2019</strong><br>
*
* @author Maximilian K&auml;fer
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public class Theme implements Serializable {
@ -35,7 +35,7 @@ public class Theme implements Serializable {
* @param selectionColor the section color
* @param typingMessageColor the color of currently typed messages
* @param userNameColor the color of user names
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Theme(String themeName, Color backgroundColor, Color cellColor, Color interactableForegroundColor, Color interactableBackgroundColor,
Color textColor, Color dateColorChat, Color selectionColor, Color typingMessageColor, Color userNameColor) {
@ -59,7 +59,7 @@ public class Theme implements Serializable {
*
* @param name the name of the {@link Theme}
* @param other the {@link Theme} to copy
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Theme(String name, Theme other) {
themeName = name;
@ -69,69 +69,69 @@ public class Theme implements Serializable {
/**
* @return a {@code Map<String, Color>} of all colors defined for this theme
* with their names as keys
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Map<String, Color> getColors() { return colors; }
/**
* @return name of the theme
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public String getThemeName() { return themeName; }
/**
* @return interactableForegroundColor
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Color getInteractableForegroundColor() { return colors.get("interactableForegroundColor"); }
/**
* @return the {@link Color} in which the text content of a message should be
* displayed
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Color getTextColor() { return colors.get("textColor"); }
/**
* @return the {@link Color} in which the creation date of a message should be
* displayed
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Color getDateColor() { return colors.get("dateColorChat"); }
/**
* @return selectionColor
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Color getSelectionColor() { return colors.get("selectionColor"); }
/**
* @return typingMessageColor
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Color getTypingMessageColor() { return colors.get("typingMessageColor"); }
/**
* @return backgroundColor
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Color getBackgroundColor() { return colors.get("backgroundColor"); }
/**
* @return cellColor
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Color getCellColor() { return colors.get("cellColor"); }
/**
* @return interactableBackgroundColor
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Color getInteractableBackgroundColor() { return colors.get("interactableBackgroundColor"); }
/**
* @return userNameColor
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public Color getUserNameColor() { return colors.get("userNameColor"); }

View File

@ -49,7 +49,7 @@ import envoy.util.EnvoyLog;
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @author Leon Hofmeister
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public class ChatWindow extends JFrame {
@ -103,7 +103,7 @@ public class ChatWindow extends JFrame {
* Initializes a {@link JFrame} with UI elements used to send and read messages
* to different users.
*
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public ChatWindow() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
@ -481,7 +481,7 @@ public class ChatWindow extends JFrame {
* Used to immediately reload the {@link ChatWindow} when settings were changed.
*
* @param theme the theme to change colors into
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
private void applyTheme(Theme theme) {
// contentPane
@ -532,7 +532,7 @@ public class ChatWindow extends JFrame {
/**
* Sends a new message to the server based on the text entered in the textArea.
*
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
private void postMessage() {
if (userList.isSelectionEmpty()) {
@ -557,7 +557,7 @@ public class ChatWindow extends JFrame {
*
* @param message the message to forward
* @param recipient the new recipient of the message
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
private void forwardMessage(Message message, User... recipients) {
Arrays.stream(recipients).forEach(recipient -> {
@ -576,7 +576,7 @@ public class ChatWindow extends JFrame {
* Sends a {@link Message} to the server.
*
* @param message the message to send
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
private void sendMessage(final Message message) {
try {
@ -639,7 +639,7 @@ public class ChatWindow extends JFrame {
* @param writeProxy the write proxy used to send messages and status change
* events to the server or cache them inside the local
* database
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void initContent(Client client, LocalDb localDb, WriteProxy writeProxy) {
this.client = client;
@ -668,7 +668,7 @@ public class ChatWindow extends JFrame {
* {@link ChatWindow#MAX_MESSAGE_LENGTH}
* and splits the text into the allowed part, if that is the case.
*
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
private void checkMessageTextLength() {
String input = messageEnterTextArea.getText();

View File

@ -30,7 +30,7 @@ import envoy.data.User;
* Created: <strong>15 Mar 2020</strong><br>
*
* @author Leon Hofmeister
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public class ContactsChooserDialog extends JDialog {
@ -64,7 +64,7 @@ public class ContactsChooserDialog extends JDialog {
* @param users the users that should be displayed
* @return the selected Element (yet has to be casted to the wanted type due to
* the Generics limitations in Java)
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public static List<User> showForwardingDialog(String title, Component parent, Message message, Collection<User> users) {
ContactsChooserDialog dialog = new ContactsChooserDialog(parent);
@ -89,7 +89,7 @@ public class ContactsChooserDialog extends JDialog {
/**
* @param parent this @{@link Component} will be parsed to
* {@link java.awt.Window#setLocationRelativeTo(Component)}
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
private ContactsChooserDialog(Component parent) {
contactList.setSelectionMode(SelectionMode.MULTIPLE);
@ -138,7 +138,7 @@ public class ContactsChooserDialog extends JDialog {
/**
* @return the underlying {@link ComponentList}
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
private ComponentList<User> getContactList() { return contactList; }

View File

@ -28,7 +28,7 @@ import envoy.client.ui.Theme;
* Created: <strong>17 Mar 2020</strong><br>
*
* @author Leon Hofmeister
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public class ContextMenu extends JPopupMenu {
@ -59,7 +59,7 @@ public class ContextMenu extends JPopupMenu {
/**
* @param parent the component which will call this
* {@link ContextMenu}
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public ContextMenu(Component parent) {
setInvoker(parent);
@ -80,7 +80,7 @@ public class ContextMenu extends JPopupMenu {
* @param itemMnemonics the keyboard shortcuts that need to be pressed to
* automatically execute the {@link JMenuItem} with the
* given text
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public ContextMenu(String label, Component parent, Map<String, ActionListener> itemsWithActions, Map<String, Icon> itemIcons,
Map<String, Integer> itemMnemonics) {
@ -94,7 +94,7 @@ public class ContextMenu extends JPopupMenu {
/**
* @param label the string that a UI may use to display as a title for the
* pop-up menu.
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public ContextMenu(String label) {
super(label);
@ -107,7 +107,7 @@ public class ContextMenu extends JPopupMenu {
*
* @return this instance of {@link ContextMenu} to allow chaining behind the
* constructor
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public ContextMenu build() {
items.forEach((text, action) -> {
@ -162,7 +162,7 @@ public class ContextMenu extends JPopupMenu {
/**
* Removes all subcomponents of this menu.
*
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public void clear() {
removeAll();
@ -173,33 +173,33 @@ public class ContextMenu extends JPopupMenu {
/**
* @return the items
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Map<String, ActionListener> getItems() { return items; }
/**
* @param items the items with the displayed text and the according action to
* take once called
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public void setItems(Map<String, ActionListener> items) { this.items = items; }
/**
* @return the icons
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Map<String, Icon> getIcons() { return icons; }
/**
* @param icons the icons to set
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public void setIcons(Map<String, Icon> icons) { this.icons = icons; }
/**
* @return the mnemonics (the keyboard shortcuts that automatically execute the
* command for a {@link JMenuItem} with corresponding text)
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Map<String, Integer> getMnemonics() { return mnemonics; }
@ -207,7 +207,7 @@ public class ContextMenu extends JPopupMenu {
* @param mnemonics the keyboard shortcuts that need to be pressed to
* automatically execute the {@link JMenuItem} with the given
* text
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public void setMnemonics(Map<String, Integer> mnemonics) { this.mnemonics = mnemonics; }
@ -216,7 +216,7 @@ public class ContextMenu extends JPopupMenu {
* Additionally sets the foreground of all subcomponents of this
* {@link ContextMenu}.
*
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
@Override
public void setForeground(Color color) {
@ -230,7 +230,7 @@ public class ContextMenu extends JPopupMenu {
* Additionally sets the background of all subcomponents of this
* {@link ContextMenu}.
*
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
@Override
public void setBackground(Color color) {
@ -246,7 +246,7 @@ public class ContextMenu extends JPopupMenu {
* Envoy-exclusive object.
*
* @param theme the theme to use
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
protected void applyTheme(Theme theme) {
setBackground(theme.getCellColor());

View File

@ -33,7 +33,7 @@ import envoy.util.EnvoyLog;
*
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class LoginDialog extends JDialog {
@ -74,7 +74,7 @@ public class LoginDialog extends JDialog {
* @param localDb the local database in which data is persisted
* @param receivedMessageCache the cache that stored messages received during
* the handshake
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public LoginDialog(Client client, LocalDb localDb, Cache<Message> receivedMessageCache) {
this.client = client;
@ -283,7 +283,7 @@ public class LoginDialog extends JDialog {
/**
* Resets the text stored in the password fields.
*
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
private void clearPasswordFields() {
passwordField.setText(null);
@ -337,7 +337,7 @@ public class LoginDialog extends JDialog {
/**
* Shuts the system down properly if the login was aborted.
*
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
private void abortLogin() {
logger.info("The login process has been cancelled. Exiting...");

View File

@ -8,6 +8,6 @@
* @author Leon Hofmeister
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
package envoy.client.ui.container;

View File

@ -19,7 +19,7 @@ import javax.swing.*;
*
* @param <E> the type of object displayed in this list
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class ComponentList<E> extends JPanel {
@ -34,7 +34,7 @@ public class ComponentList<E> extends JPanel {
/**
* Defines the possible modes of selection that can be performed by the user
*
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public static enum SelectionMode {
/**
@ -56,7 +56,7 @@ public class ComponentList<E> extends JPanel {
/**
* Creates an instance of {@link ComponentList}.
*
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public ComponentList() { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); }
@ -64,7 +64,7 @@ public class ComponentList<E> extends JPanel {
* Removes all child components and then adds all components representing the
* elements of the {@link Model}.
*
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void synchronizeModel() {
if (model != null) {
@ -79,7 +79,7 @@ public class ComponentList<E> extends JPanel {
* removed from the selection.
*
* @param index the index of the selected component
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public void selectElement(int index) {
final JComponent element = getComponent(index);
@ -112,7 +112,7 @@ public class ComponentList<E> extends JPanel {
/**
* Removes the current selection.
*
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public void clearSelection() {
if (selectionHandler != null) selection.forEach(i -> selectionHandler.selectionChanged(model.get(i), getComponent(i), false));
@ -124,7 +124,7 @@ public class ComponentList<E> extends JPanel {
* {@link Renderer}.
*
* @param elem the element to add
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
void addElement(E elem) {
if (renderer != null) {
@ -140,7 +140,7 @@ public class ComponentList<E> extends JPanel {
* @return a mouse listener calling the
* {@link ComponentList#selectElement(int)} method with the
* component's index when a left click is performed by the user
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
private MouseListener getSelectionListener(int componentIndex) {
return new MouseAdapter() {
@ -155,13 +155,13 @@ public class ComponentList<E> extends JPanel {
/**
* @return a set of all selected indices
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Set<Integer> getSelection() { return selection; }
/**
* @return a set of all selected elements
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Set<E> getSelectedElements() {
var selectedElements = new HashSet<E>();
@ -172,20 +172,20 @@ public class ComponentList<E> extends JPanel {
/**
* @return the index of an arbitrary selected element
* @throws java.util.NoSuchElementException if no selection is present
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public int getSingleSelection() { return selection.stream().findAny().get(); }
/**
* @return an arbitrary selected element
* @throws java.util.NoSuchElementException if no selection is present
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public E getSingleSelectedElement() { return model.get(getSingleSelection()); }
/**
* @return the model
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Model<E> getModel() { return model; }
@ -196,7 +196,7 @@ public class ComponentList<E> extends JPanel {
*
* @param model the list model to set
* @return this component list
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public ComponentList<E> setModel(Model<E> model) {
@ -213,14 +213,14 @@ public class ComponentList<E> extends JPanel {
/**
* @return the renderer
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public Renderer<E> getRenderer() { return renderer; }
/**
* @param renderer the renderer to set
* @return this component list
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public ComponentList<E> setRenderer(Renderer<E> renderer) {
this.renderer = renderer;
@ -229,7 +229,7 @@ public class ComponentList<E> extends JPanel {
/**
* @return the selection mode
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public SelectionMode getSelectionMode() { return selectionMode; }
@ -239,7 +239,7 @@ public class ComponentList<E> extends JPanel {
*
* @param selectionMode the selection mode to set
* @return this component list
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public ComponentList<E> setSelectionMode(SelectionMode selectionMode) {
this.selectionMode = selectionMode;
@ -249,13 +249,13 @@ public class ComponentList<E> extends JPanel {
/**
* @return the selection handler
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public SelectionHandler<E> getSelectionHandler() { return selectionHandler; }
/**
* @param selectionHandler the selection handler to set
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public void setSelectionHandler(SelectionHandler<E> selectionHandler) { this.selectionHandler = selectionHandler; }
}

View File

@ -14,7 +14,7 @@ import java.util.List;
*
* @param <E> the type of object displayed in this list
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public final class Model<E> implements Iterable<E>, Serializable {
@ -30,7 +30,7 @@ public final class Model<E> implements Iterable<E>, Serializable {
* @param e the element to add
* @return {@code true}
* @see java.util.List#add(java.lang.Object)
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public boolean add(E e) {
if (componentList != null) {
@ -45,7 +45,7 @@ public final class Model<E> implements Iterable<E>, Serializable {
* {@link ComponentList}.
*
* @see java.util.List#clear()
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public void clear() {
elements.clear();
@ -56,7 +56,7 @@ public final class Model<E> implements Iterable<E>, Serializable {
* @param index the index to retrieve the element from
* @return the element located at the index
* @see java.util.List#get(int)
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public E get(int index) { return elements.get(index); }
@ -67,7 +67,7 @@ public final class Model<E> implements Iterable<E>, Serializable {
* @param index the index of the element to remove
* @return the removed element
* @see java.util.List#remove(int)
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public E remove(int index) {
if (componentList != null) componentList.remove(index);
@ -77,7 +77,7 @@ public final class Model<E> implements Iterable<E>, Serializable {
/**
* @return the amount of elements in this list model
* @see java.util.List#size()
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public int size() { return elements.size(); }
@ -90,7 +90,7 @@ public final class Model<E> implements Iterable<E>, Serializable {
/**
* @return an iterator over the elements of this list model
* @see java.util.List#iterator()
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
@Override
public Iterator<E> iterator() {
@ -111,7 +111,7 @@ public final class Model<E> implements Iterable<E>, Serializable {
* synchronization.
*
* @param componentList the component list to set
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
void setComponentList(ComponentList<E> componentList) {
this.componentList = componentList;

View File

@ -12,7 +12,7 @@ import javax.swing.JComponent;
*
* @param <E> the type of object displayed in this list
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
@FunctionalInterface
public interface Renderer<E> {
@ -25,7 +25,7 @@ public interface Renderer<E> {
* @param isSelected {@code true} if the user has selected the list cell in
* which the list element is rendered
* @return the component representing the list element
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
JComponent getListCellComponent(ComponentList<? extends E> list, E value);
}

View File

@ -11,7 +11,7 @@ import javax.swing.JComponent;
*
* @author Kai S. K. Engelbart
* @param <E> the type of the underlying {@link ComponentList}
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
@FunctionalInterface
public interface SelectionHandler<E> {
@ -22,7 +22,7 @@ public interface SelectionHandler<E> {
* @param element the selected element
* @param component the selected component
* @param isSelected contains the selection state
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
void selectionChanged(E element, JComponent component, boolean isSelected);
}

View File

@ -5,6 +5,6 @@
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
package envoy.client.ui.list;

View File

@ -20,7 +20,7 @@ import envoy.event.EventBus;
* Created: <strong>21.03.2020</strong>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public class ContactSearchComponent extends JComponent {
@ -29,7 +29,7 @@ public class ContactSearchComponent extends JComponent {
/**
* @param list the {@link ComponentList} that is used to display search results
* @param user the {@link User} that appears as a search result
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public ContactSearchComponent(ComponentList<? extends User> list, User user) {
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));

View File

@ -22,7 +22,7 @@ import envoy.data.User;
* Created: <strong>21.03.2020</strong>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public class MessageComponent extends JPanel {
@ -45,7 +45,7 @@ public class MessageComponent extends JPanel {
* @param message the {@link Message} to display
* @param senderId the id of the {@link User} who sends messages from this
* account
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public MessageComponent(ComponentList<? extends Message> list, Message message, long senderId) {
var width = list.getMaximumSize().width;

View File

@ -20,7 +20,7 @@ import envoy.data.User.UserStatus;
* Created: <strong>21.03.2020</strong>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public class UserComponent extends JPanel {
@ -28,7 +28,7 @@ public class UserComponent extends JPanel {
/**
* @param user the {@link User} whose information is displayed
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
public UserComponent(User user) {
final Theme theme = Settings.getInstance().getCurrentTheme();

View File

@ -9,6 +9,6 @@
* @author Leon Hofmeister
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
package envoy.client.ui.list_component;

View File

@ -4,6 +4,6 @@
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
package envoy.client.ui;

View File

@ -11,7 +11,7 @@ import javax.swing.JButton;
*
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public class PrimaryButton extends JButton {

View File

@ -16,7 +16,7 @@ import envoy.client.ui.Theme;
* Created: <strong>14.12.2019</strong><br>
*
* @author Maximilian K&auml;fer
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public class PrimaryScrollBar extends BasicScrollBarUI {

View File

@ -22,7 +22,7 @@ public class PrimaryScrollPane extends JScrollPane {
/**
* Initializes a {@link JScrollPane} with the primary Envoy design scheme
*
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public PrimaryScrollPane() { setBorder(null); }
@ -30,7 +30,7 @@ public class PrimaryScrollPane extends JScrollPane {
* Styles the vertical and horizontal scroll bars.
*
* @param theme the color set used to color the component
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void applyTheme(Theme theme) {
setForeground(theme.getBackgroundColor());
@ -54,7 +54,7 @@ public class PrimaryScrollPane extends JScrollPane {
* When rereading messages, the chat doesn't scroll down if new messages </br>
* are added. (Besides see first point)
*
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void autoscroll() {
// Automatic scrolling to the bottom
@ -79,7 +79,7 @@ public class PrimaryScrollPane extends JScrollPane {
* triggering it to automatically scroll down.
*
* @param chatOpened indicates the chat opening status
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public void setChatOpened(boolean chatOpened) { this.chatOpened = chatOpened; }
}

View File

@ -12,7 +12,7 @@ import javax.swing.border.EmptyBorder;
* Created: <strong>07.12.2019</strong><br>
*
* @author Maximilian K&auml;fer
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public class PrimaryTextArea extends JTextArea {

View File

@ -19,7 +19,7 @@ import envoy.client.ui.Color;
*
* @author Maximilian K&auml;fer
* @author Kai S. K. Engelbart
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class PrimaryToggleSwitch extends JButton {
@ -32,7 +32,7 @@ public class PrimaryToggleSwitch extends JButton {
*
* @param settingsItem the {@link SettingsItem} that is controlled by this
* {@link PrimaryToggleSwitch}
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public PrimaryToggleSwitch(SettingsItem<Boolean> settingsItem) {
setPreferredSize(new Dimension(50, 25));

View File

@ -12,6 +12,6 @@
* @author Leon Hofmeister
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
package envoy.client.ui.primary;

View File

@ -20,7 +20,7 @@ import envoy.data.User.UserStatus;
*
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public class UserListRenderer extends JLabel implements ListCellRenderer<User> {

View File

@ -9,6 +9,6 @@
* @author Leon Hofmeister
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
package envoy.client.ui.renderer;

View File

@ -22,7 +22,7 @@ import envoy.util.EnvoyLog;
* Created: <strong>21 Dec 2019</strong><br>
*
* @author Maximilian K&auml;fer
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class GeneralSettingsPanel extends SettingsPanel {
@ -38,7 +38,7 @@ public class GeneralSettingsPanel extends SettingsPanel {
*
* @param parent the {@link SettingsScreen} as a part of which this
* {@link SettingsPanel} is displayed
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public GeneralSettingsPanel(SettingsScreen parent) {
super(parent);

View File

@ -20,7 +20,7 @@ import envoy.client.ui.primary.PrimaryTextArea;
* Created: <strong>26 Dec 2019</strong><br>
*
* @author Maximilian K&auml;fer
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public class NewThemeScreen extends JDialog {
@ -48,7 +48,7 @@ public class NewThemeScreen extends JDialog {
* @param newThemeAction is executed when a new theme name is entered
* @param modifyThemeAction is executed when an existing theme name is entered
* and confirmed
* @since Envoy v0.3-alpha
* @since Envoy Client v0.3-alpha
*/
public NewThemeScreen(SettingsScreen parent, Consumer<String> newThemeAction, Consumer<String> modifyThemeAction) {
this.newThemeAction = newThemeAction;

View File

@ -12,7 +12,7 @@ import javax.swing.JPanel;
* Created: <strong>20 Dec 2019</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public abstract class SettingsPanel extends JPanel {

View File

@ -26,7 +26,7 @@ import envoy.util.EnvoyLog;
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @author Kai S. K. Engelbart
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public class SettingsScreen extends JDialog {
@ -51,7 +51,7 @@ public class SettingsScreen extends JDialog {
/**
* Initializes the settings screen.
*
* @since Envoy v0.1-alpha
* @since Envoy Client v0.1-alpha
*/
public SettingsScreen() {
// Initialize settings pages

View File

@ -24,7 +24,7 @@ import envoy.util.EnvoyLog;
*
* @author Kai S. K. Engelbart
* @author Maximilian K&auml;fer
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public class ThemeCustomizationPanel extends SettingsPanel {
@ -48,7 +48,7 @@ public class ThemeCustomizationPanel extends SettingsPanel {
*
* @param parent the {@link SettingsScreen} as a part of which this
* {@link SettingsPanel} is displayed
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
public ThemeCustomizationPanel(SettingsScreen parent) {
super(parent);

View File

@ -4,6 +4,6 @@
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.2-alpha
* @since Envoy Client v0.2-alpha
*/
package envoy.client.ui.settings;

View File

@ -5,7 +5,7 @@
* @author Kai S. K. Engelbart
* @author Leon Hofmeister
* @author Maximilian K&auml;fer
* @since Envoy v0.1-beta
* @since Envoy Client v0.1-beta
*/
module envoy {