Normalized since tags to fit envoy-common and envoy-server
Envoy vXXX -> Envoy Client vXXX
This commit is contained in:
parent
3dd9884cd9
commit
86d437760d
@ -34,7 +34,7 @@ import envoy.util.EnvoyLog;
|
|||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public class Startup {
|
public class Startup {
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ public class Startup {
|
|||||||
*
|
*
|
||||||
* @param args the command line arguments may contain configuration parameters
|
* @param args the command line arguments may contain configuration parameters
|
||||||
* and are parsed by the {@link Config} class
|
* 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) {
|
public static void main(String[] args) {
|
||||||
ClientConfig config = ClientConfig.getInstance();
|
ClientConfig config = ClientConfig.getInstance();
|
||||||
|
@ -17,7 +17,7 @@ import envoy.util.EnvoyLog;
|
|||||||
*
|
*
|
||||||
* @param <T> the type of cached elements
|
* @param <T> the type of cached elements
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class Cache<T> implements Consumer<T>, Serializable {
|
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.
|
* Adds an element to the cache.
|
||||||
*
|
*
|
||||||
* @param element the element to add
|
* @param element the element to add
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void accept(T element) {
|
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.
|
* Sets the processor to which cached elements are relayed.
|
||||||
*
|
*
|
||||||
* @param processor the processor to set
|
* @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; }
|
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.
|
* Relays all cached elements to the processor.
|
||||||
*
|
*
|
||||||
* @throws IllegalStateException if the processor is not initialized
|
* @throws IllegalStateException if the processor is not initialized
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public void relay() {
|
public void relay() {
|
||||||
if (processor == null) throw new IllegalStateException("Processor is not defined");
|
if (processor == null) throw new IllegalStateException("Processor is not defined");
|
||||||
|
@ -21,7 +21,7 @@ import envoy.event.MessageStatusChangeEvent;
|
|||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public class Chat implements Serializable {
|
public class Chat implements Serializable {
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ public class Chat implements Serializable {
|
|||||||
* Saves the Messages in the corresponding chat at that Point.
|
* Saves the Messages in the corresponding chat at that Point.
|
||||||
*
|
*
|
||||||
* @param recipient the user who receives the messages
|
* @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; }
|
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
|
* Appends a message to the bottom of this chat
|
||||||
*
|
*
|
||||||
* @param message the message to append
|
* @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); }
|
public void appendMessage(Message message) { model.add(message); }
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ public class Chat implements Serializable {
|
|||||||
* the message status changes
|
* the message status changes
|
||||||
* @throws IOException if a {@link MessageStatusChangeEvent} could not be
|
* @throws IOException if a {@link MessageStatusChangeEvent} could not be
|
||||||
* delivered to the server
|
* delivered to the server
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public void read(WriteProxy writeProxy) throws IOException {
|
public void read(WriteProxy writeProxy) throws IOException {
|
||||||
for (int i = model.size() - 1; i >= 0; --i) {
|
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
|
* @return {@code true} if the newest message received in the chat doesn't have
|
||||||
* the status {@code READ}
|
* 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; }
|
public boolean isUnread() { return !model.isEmpty() && model.get(model.size() - 1).getStatus() != MessageStatus.READ; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return all messages in the current chat
|
* @return all messages in the current chat
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public Model<Message> getModel() { return model; }
|
public Model<Message> getModel() { return model; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the recipient of a message
|
* @return the recipient of a message
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public User getRecipient() { return recipient; }
|
public User getRecipient() { return recipient; }
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ import envoy.data.LoginCredentials;
|
|||||||
* Created: <strong>01.03.2020</strong><br>
|
* Created: <strong>01.03.2020</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public class ClientConfig extends Config {
|
public class ClientConfig extends Config {
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ public class ClientConfig extends Config {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the singleton instance of the client config
|
* @return the singleton instance of the client config
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public static ClientConfig getInstance() {
|
public static ClientConfig getInstance() {
|
||||||
if (config == null) config = new ClientConfig();
|
if (config == null) config = new ClientConfig();
|
||||||
@ -47,68 +47,68 @@ public class ClientConfig extends Config {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the host name of the Envoy server
|
* @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(); }
|
public String getServer() { return (String) items.get("server").get(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the port at which the Envoy server is located on the host
|
* @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(); }
|
public Integer getPort() { return (Integer) items.get("port").get(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the local database specific to the client user
|
* @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(); }
|
public File getLocalDB() { return (File) items.get("localDB").get(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {@code true} if the local database is to be ignored
|
* @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(); }
|
public Boolean isIgnoreLocalDB() { return (Boolean) items.get("ignoreLocalDB").get(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the directory in which all local files are saves
|
* @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(); }
|
public File getHomeDirectory() { return (File) items.get("homeDirectory").get(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the minimal {@link Level} to log inside the log file
|
* @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(); }
|
public Level getFileLevelBarrier() { return (Level) items.get("fileLevelBarrier").get(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the minimal {@link Level} to log inside the console
|
* @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(); }
|
public Level getConsoleLevelBarrier() { return (Level) items.get("consoleLevelBarrier").get(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the user name
|
* @return the user name
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public String getUser() { return (String) items.get("user").get(); }
|
public String getUser() { return (String) items.get("user").get(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the password
|
* @return the password
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public char[] getPassword() { return (char[]) items.get("password").get(); }
|
public char[] getPassword() { return (char[]) items.get("password").get(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {@code true} if user name and password are set
|
* @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; }
|
public boolean hasLoginCredentials() { return getUser() != null && getPassword() != null; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return login credentials for the specified user name and password, without
|
* @return login credentials for the specified user name and password, without
|
||||||
* the registration option
|
* the registration option
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public LoginCredentials getLoginCredentials() {
|
public LoginCredentials getLoginCredentials() {
|
||||||
try {
|
try {
|
||||||
|
@ -16,7 +16,7 @@ import envoy.event.MessageStatusChangeEvent;
|
|||||||
* Created: <strong>3 Feb 2020</strong><br>
|
* Created: <strong>3 Feb 2020</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public abstract class LocalDb {
|
public abstract class LocalDb {
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ public abstract class LocalDb {
|
|||||||
/**
|
/**
|
||||||
* Initializes a storage space for a user-specific list of chats.
|
* 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() {}
|
public void initializeUserStorage() {}
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ public abstract class LocalDb {
|
|||||||
* as well. The message id generator will also be saved if present.
|
* as well. The message id generator will also be saved if present.
|
||||||
*
|
*
|
||||||
* @throws Exception if the saving process failed
|
* @throws Exception if the saving process failed
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public void save() throws Exception {}
|
public void save() throws Exception {}
|
||||||
|
|
||||||
@ -47,7 +47,7 @@ public abstract class LocalDb {
|
|||||||
* Loads all user data.
|
* Loads all user data.
|
||||||
*
|
*
|
||||||
* @throws Exception if the loading process failed
|
* @throws Exception if the loading process failed
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public void loadUsers() throws Exception {}
|
public void loadUsers() throws Exception {}
|
||||||
|
|
||||||
@ -55,21 +55,21 @@ public abstract class LocalDb {
|
|||||||
* Loads all data of the client user.
|
* Loads all data of the client user.
|
||||||
*
|
*
|
||||||
* @throws Exception if the loading process failed
|
* @throws Exception if the loading process failed
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public void loadUserData() throws Exception {}
|
public void loadUserData() throws Exception {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loads the ID generator. Any exception thrown during this process is ignored.
|
* 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() {}
|
public void loadIdGenerator() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a {@code Map<String, User>} of all users stored locally with their
|
* @return a {@code Map<String, User>} of all users stored locally with their
|
||||||
* user names as keys
|
* user names as keys
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Map<String, User> getUsers() { return users; }
|
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
|
* @return all saved {@link Chat} objects that list the client user as the
|
||||||
* sender
|
* sender
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
**/
|
**/
|
||||||
public List<Chat> getChats() { return chats; }
|
public List<Chat> getChats() { return chats; }
|
||||||
|
|
||||||
@ -92,55 +92,55 @@ public abstract class LocalDb {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the {@link User} who initialized the local database
|
* @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; }
|
public User getUser() { return user; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param user the user to set
|
* @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; }
|
public void setUser(User user) { this.user = user; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the message ID generator
|
* @return the message ID generator
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public IdGenerator getIdGenerator() { return idGenerator; }
|
public IdGenerator getIdGenerator() { return idGenerator; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param idGenerator the message ID generator to set
|
* @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; }
|
public void setIdGenerator(IdGenerator idGenerator) { this.idGenerator = idGenerator; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {@code true} if an {@link IdGenerator} is present
|
* @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; }
|
public boolean hasIdGenerator() { return idGenerator != null; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the offline message cache
|
* @return the offline message cache
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public Cache<Message> getMessageCache() { return messageCache; }
|
public Cache<Message> getMessageCache() { return messageCache; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param messageCache the offline message cache to set
|
* @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; }
|
public void setMessageCache(Cache<Message> messageCache) { this.messageCache = messageCache; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the offline status cache
|
* @return the offline status cache
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public Cache<MessageStatusChangeEvent> getStatusCache() { return statusCache; }
|
public Cache<MessageStatusChangeEvent> getStatusCache() { return statusCache; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param statusCache the offline status cache to set
|
* @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; }
|
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
|
* @param id the ID of the message to search for
|
||||||
* @return the message with the corresponding ID, or {@code null} if no message
|
* @return the message with the corresponding ID, or {@code null} if no message
|
||||||
* has been found
|
* has been found
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public Message getMessage(long id) {
|
public Message getMessage(long id) {
|
||||||
for (Chat c : chats)
|
for (Chat c : chats)
|
||||||
|
@ -19,7 +19,7 @@ import envoy.util.SerializationUtils;
|
|||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public class PersistentLocalDb extends LocalDb {
|
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}
|
* This constructor shall be used in conjunction with the {@code ignoreLocalDB}
|
||||||
* {@link ConfigItem}.
|
* {@link ConfigItem}.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public PersistentLocalDb() {}
|
public PersistentLocalDb() {}
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ public class PersistentLocalDb extends LocalDb {
|
|||||||
*
|
*
|
||||||
* @param localDbDir the directory in which to store users and chats
|
* @param localDbDir the directory in which to store users and chats
|
||||||
* @throws IOException if the PersistentLocalDb could not be initialized
|
* @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 {
|
public PersistentLocalDb(File localDbDir) throws IOException {
|
||||||
localDBDir = localDbDir;
|
localDBDir = localDbDir;
|
||||||
@ -58,7 +58,7 @@ public class PersistentLocalDb extends LocalDb {
|
|||||||
* Creates a database file for a user-specific list of chats.
|
* Creates a database file for a user-specific list of chats.
|
||||||
*
|
*
|
||||||
* @throws NullPointerException if the client user is not yet specified
|
* @throws NullPointerException if the client user is not yet specified
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void initializeUserStorage() {
|
public void initializeUserStorage() {
|
||||||
|
@ -22,7 +22,7 @@ import envoy.util.SerializationUtils;
|
|||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public class Settings {
|
public class Settings {
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ public class Settings {
|
|||||||
* The way to instantiate the settings.
|
* The way to instantiate the settings.
|
||||||
* Is set to private to deny other instances of that object.
|
* Is set to private to deny other instances of that object.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
private Settings() {
|
private Settings() {
|
||||||
// Load settings from settings file
|
// 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.
|
* This method is used to ensure that there is only one instance of Settings.
|
||||||
*
|
*
|
||||||
* @return the 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; }
|
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
|
* @throws IOException if an error occurs while saving the themes to the theme
|
||||||
* file
|
* file
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public void save() throws IOException {
|
public void save() throws IOException {
|
||||||
// Save settings to settings file
|
// Save settings to settings file
|
||||||
@ -110,19 +110,19 @@ public class Settings {
|
|||||||
* Adds new theme to the theme map.
|
* Adds new theme to the theme map.
|
||||||
*
|
*
|
||||||
* @param theme the {@link Theme} to add
|
* @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); }
|
public void addNewThemeToMap(Theme theme) { getThemes().put(theme.getThemeName(), theme); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the name of the currently active {@link 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(); }
|
public String getCurrentThemeName() { return (String) items.get("currentTheme").get(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the currently active {@link Theme}
|
* @return the currently active {@link Theme}
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public Theme getCurrentTheme() { return getTheme(getCurrentThemeName()); }
|
public Theme getCurrentTheme() { return getTheme(getCurrentThemeName()); }
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ public class Settings {
|
|||||||
* Sets the name of the current {@link Theme}.
|
* Sets the name of the current {@link Theme}.
|
||||||
*
|
*
|
||||||
* @param themeName the name to set
|
* @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); }
|
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
|
* @return {@code true}, if pressing the {@code Enter} key suffices to send a
|
||||||
* message. Otherwise it has to be pressed in conjunction with the
|
* message. Otherwise it has to be pressed in conjunction with the
|
||||||
* {@code Control} key.
|
* {@code Control} key.
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Boolean isEnterToSend() { return (Boolean) items.get("enterToSend").get(); }
|
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
|
* @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
|
* the {@code Enter} key. Otherwise it has to be pressed in
|
||||||
* conjunction with the {@code Control} key.
|
* 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); }
|
public void setEnterToSend(boolean enterToSend) { ((SettingsItem<Boolean>) items.get("enterToSend")).set(enterToSend); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the current on close mode.
|
* @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(); }
|
public Boolean getCurrentOnCloseMode() { return (Boolean) items.get("onCloseMode").get(); }
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ public class Settings {
|
|||||||
* Sets the current on close mode.
|
* Sets the current on close mode.
|
||||||
*
|
*
|
||||||
* @param currentOnCloseMode the on close mode that should be set.
|
* @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); }
|
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
|
* @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; }
|
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
|
* Sets the {@code Map<String, Theme>} of all themes with their names as keys
|
||||||
*
|
*
|
||||||
* @param themes the theme map to set
|
* @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; }
|
public void setThemes(Map<String, Theme> themes) { this.themes = themes; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param themeName the name of the {@link Theme} to get
|
* @param themeName the name of the {@link Theme} to get
|
||||||
* @return the {@link Theme} with the specified name
|
* @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); }
|
public Theme getTheme(String themeName) { return themes.get(themeName); }
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import envoy.client.ui.primary.PrimaryToggleSwitch;
|
|||||||
*
|
*
|
||||||
* @param <T> the type of this {@link SettingsItem}'s value
|
* @param <T> the type of this {@link SettingsItem}'s value
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class SettingsItem<T> implements Serializable {
|
public class SettingsItem<T> implements Serializable {
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ public class SettingsItem<T> implements Serializable {
|
|||||||
* @param value the default value
|
* @param value the default value
|
||||||
* @param userFriendlyName the user friendly name (short)
|
* @param userFriendlyName the user friendly name (short)
|
||||||
* @param description the description (long)
|
* @param description the description (long)
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public SettingsItem(T value, String userFriendlyName, String description) {
|
public SettingsItem(T value, String userFriendlyName, String description) {
|
||||||
this(value, componentClasses.get(value.getClass()));
|
this(value, componentClasses.get(value.getClass()));
|
||||||
@ -61,7 +61,7 @@ public class SettingsItem<T> implements Serializable {
|
|||||||
*
|
*
|
||||||
* @param value the default value
|
* @param value the default value
|
||||||
* @param componentClass the class of the {@link JComponent} to represent this {@link SettingsItem} with
|
* @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) {
|
public SettingsItem(T value, Class<? extends JComponent> componentClass) {
|
||||||
this.value = value;
|
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}
|
* @return an instance of the {@link JComponent} that represents this {@link SettingsItem}
|
||||||
* @throws ReflectiveOperationException if the component initialization failed
|
* @throws ReflectiveOperationException if the component initialization failed
|
||||||
* @throws SecurityException 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 {
|
public JComponent getComponent() throws ReflectiveOperationException, SecurityException {
|
||||||
if (componentClass == null) throw new NullPointerException("Component class is null");
|
if (componentClass == null) throw new NullPointerException("Component class is null");
|
||||||
@ -81,7 +81,7 @@ public class SettingsItem<T> implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the value
|
* @return the value
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public T get() { return value; }
|
public T get() { return value; }
|
||||||
|
|
||||||
@ -90,7 +90,7 @@ public class SettingsItem<T> implements Serializable {
|
|||||||
* defined, it will be invoked with this value.
|
* defined, it will be invoked with this value.
|
||||||
*
|
*
|
||||||
* @param value the value to set
|
* @param value the value to set
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public void set(T value) {
|
public void set(T value) {
|
||||||
if (changeHandler != null && value != this.value) changeHandler.accept(value);
|
if (changeHandler != null && value != this.value) changeHandler.accept(value);
|
||||||
@ -99,37 +99,37 @@ public class SettingsItem<T> implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the componentClass
|
* @return the componentClass
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public Class<? extends JComponent> getComponentClass() { return componentClass; }
|
public Class<? extends JComponent> getComponentClass() { return componentClass; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param componentClass the componentClass to set
|
* @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; }
|
public void setComponentClass(Class<? extends JComponent> componentClass) { this.componentClass = componentClass; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the userFriendlyName
|
* @return the userFriendlyName
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public String getUserFriendlyName() { return userFriendlyName; }
|
public String getUserFriendlyName() { return userFriendlyName; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param userFriendlyName the userFriendlyName to set
|
* @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; }
|
public void setUserFriendlyName(String userFriendlyName) { this.userFriendlyName = userFriendlyName; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the description
|
* @return the description
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public String getDescription() { return description; }
|
public String getDescription() { return description; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param description the description to set
|
* @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; }
|
public void setDescription(String description) { this.description = description; }
|
||||||
|
|
||||||
@ -139,7 +139,7 @@ public class SettingsItem<T> implements Serializable {
|
|||||||
* when the value changes.
|
* when the value changes.
|
||||||
*
|
*
|
||||||
* @param changeHandler the changeHandler to set
|
* @param changeHandler the changeHandler to set
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public void setChangeHandler(Consumer<T> changeHandler) {
|
public void setChangeHandler(Consumer<T> changeHandler) {
|
||||||
this.changeHandler = changeHandler;
|
this.changeHandler = changeHandler;
|
||||||
|
@ -9,7 +9,7 @@ package envoy.client.data;
|
|||||||
* Created: <strong>3 Feb 2020</strong><br>
|
* Created: <strong>3 Feb 2020</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class TransientLocalDb extends LocalDb {
|
public class TransientLocalDb extends LocalDb {
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
package envoy.client.data;
|
package envoy.client.data;
|
||||||
|
@ -10,7 +10,7 @@ import envoy.event.Event;
|
|||||||
* Created: <strong>8 Feb 2020</strong><br>
|
* Created: <strong>8 Feb 2020</strong><br>
|
||||||
*
|
*
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class HandshakeSuccessfulEvent extends Event.Valueless {
|
public class HandshakeSuccessfulEvent extends Event.Valueless {
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import envoy.event.Event;
|
|||||||
* Created: <strong>4 Dec 2019</strong><br>
|
* Created: <strong>4 Dec 2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public class MessageCreationEvent extends Event<Message> {
|
public class MessageCreationEvent extends Event<Message> {
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import envoy.event.Event;
|
|||||||
* Created: <strong>4 Dec 2019</strong><br>
|
* Created: <strong>4 Dec 2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public class MessageModificationEvent extends Event<Message> {
|
public class MessageModificationEvent extends Event<Message> {
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import envoy.event.Event;
|
|||||||
*
|
*
|
||||||
* @author: Maximilian Käfer
|
* @author: Maximilian Käfer
|
||||||
*
|
*
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class SendEvent extends Event<Event<?>> {
|
public class SendEvent extends Event<Event<?>> {
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ import envoy.event.Event;
|
|||||||
* Created: <strong>15 Dec 2019</strong><br>
|
* Created: <strong>15 Dec 2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public class ThemeChangeEvent extends Event<Theme> {
|
public class ThemeChangeEvent extends Event<Theme> {
|
||||||
|
|
||||||
@ -20,7 +20,7 @@ public class ThemeChangeEvent extends Event<Theme> {
|
|||||||
* of the {@link Theme} currently in use
|
* of the {@link Theme} currently in use
|
||||||
*
|
*
|
||||||
* @param theme the new currently used {@link Theme} object
|
* @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); }
|
public ThemeChangeEvent(Theme theme) { super(theme); }
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
package envoy.client.event;
|
package envoy.client.event;
|
||||||
|
@ -30,7 +30,7 @@ import envoy.util.SerializationUtils;
|
|||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public class Client implements Closeable {
|
public class Client implements Closeable {
|
||||||
|
|
||||||
@ -124,7 +124,7 @@ public class Client implements Closeable {
|
|||||||
* initialization
|
* initialization
|
||||||
* @throws IOException if no {@link IdGenerator} is present and none could be
|
* @throws IOException if no {@link IdGenerator} is present and none could be
|
||||||
* requested from the server
|
* 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 {
|
public void initReceiver(LocalDb localDb, Cache<Message> receivedMessageCache) throws IOException {
|
||||||
checkOnline();
|
checkOnline();
|
||||||
@ -181,7 +181,7 @@ public class Client implements Closeable {
|
|||||||
*
|
*
|
||||||
* @param message the message to send
|
* @param message the message to send
|
||||||
* @throws IOException if the message does not reach the server
|
* @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 {
|
public void sendMessage(Message message) throws IOException {
|
||||||
writeObject(message);
|
writeObject(message);
|
||||||
@ -200,7 +200,7 @@ public class Client implements Closeable {
|
|||||||
* Requests a new {@link IdGenerator} from the server.
|
* Requests a new {@link IdGenerator} from the server.
|
||||||
*
|
*
|
||||||
* @throws IOException if the request does not reach 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 {
|
public void requestIdGenerator() throws IOException {
|
||||||
logger.info("Requesting new id generator...");
|
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
|
* @return a {@code Map<String, User>} of all users on the server with their
|
||||||
* user names as keys
|
* user names as keys
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Map<String, User> getUsers() {
|
public Map<String, User> getUsers() {
|
||||||
checkOnline();
|
checkOnline();
|
||||||
@ -232,7 +232,7 @@ public class Client implements Closeable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the sender object that represents this client.
|
* @return the sender object that represents this client.
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public User getSender() { return sender; }
|
public User getSender() { return sender; }
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ public class Client implements Closeable {
|
|||||||
* Sets the client user which is used to send messages.
|
* Sets the client user which is used to send messages.
|
||||||
*
|
*
|
||||||
* @param sender the client user to set
|
* @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; }
|
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
|
* @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; }
|
public boolean isOnline() { return online; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the contacts of this {@link Client}
|
* @return the contacts of this {@link Client}
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public Contacts getContacts() { return contacts; }
|
public Contacts getContacts() { return contacts; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param contacts the contacts to set
|
* @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; }
|
public void setContacts(Contacts contacts) { this.contacts = contacts; }
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ import envoy.util.EnvoyLog;
|
|||||||
* Created: <strong>4 Feb 2020</strong><br>
|
* Created: <strong>4 Feb 2020</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class MessageStatusChangeEventProcessor implements Consumer<MessageStatusChangeEvent> {
|
public class MessageStatusChangeEventProcessor implements Consumer<MessageStatusChangeEvent> {
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ public class MessageStatusChangeEventProcessor implements Consumer<MessageStatus
|
|||||||
* {@code RECEIVED} or {@code READ}.
|
* {@code RECEIVED} or {@code READ}.
|
||||||
*
|
*
|
||||||
* @param evt the status change event
|
* @param evt the status change event
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void accept(MessageStatusChangeEvent evt) {
|
public void accept(MessageStatusChangeEvent evt) {
|
||||||
|
@ -15,7 +15,7 @@ import envoy.util.EnvoyLog;
|
|||||||
* Created: <strong>31.12.2019</strong><br>
|
* Created: <strong>31.12.2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class ReceivedMessageProcessor implements Consumer<Message> {
|
public class ReceivedMessageProcessor implements Consumer<Message> {
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import envoy.util.SerializationUtils;
|
|||||||
* Created: <strong>30.12.2019</strong><br>
|
* Created: <strong>30.12.2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class Receiver extends Thread {
|
public class Receiver extends Thread {
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import envoy.event.UserStatusChangeEvent;
|
|||||||
* Created: <strong>2 Feb 2020</strong><br>
|
* Created: <strong>2 Feb 2020</strong><br>
|
||||||
*
|
*
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class UserStatusChangeProcessor implements Consumer<UserStatusChangeEvent> {
|
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
|
* @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; }
|
public UserStatusChangeProcessor(LocalDb localDb) { this.localDb = localDb; }
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import envoy.util.EnvoyLog;
|
|||||||
* Created: <strong>6 Feb 2020</strong><br>
|
* Created: <strong>6 Feb 2020</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class WriteProxy {
|
public class WriteProxy {
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ public class WriteProxy {
|
|||||||
* events
|
* events
|
||||||
* @param localDb the local database used to cache messages and message status
|
* @param localDb the local database used to cache messages and message status
|
||||||
* change events
|
* change events
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public WriteProxy(Client client, LocalDb localDb) {
|
public WriteProxy(Client client, LocalDb localDb) {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
@ -68,7 +68,7 @@ public class WriteProxy {
|
|||||||
* Sends cached {@link Message}s and {@link MessageStatusChangeEvent}s to the
|
* Sends cached {@link Message}s and {@link MessageStatusChangeEvent}s to the
|
||||||
* server.
|
* server.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public void flushCache() {
|
public void flushCache() {
|
||||||
// Send messages
|
// Send messages
|
||||||
@ -84,7 +84,7 @@ public class WriteProxy {
|
|||||||
*
|
*
|
||||||
* @param message the message to send
|
* @param message the message to send
|
||||||
* @throws IOException if the message could not be sent
|
* @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 {
|
public void writeMessage(Message message) throws IOException {
|
||||||
if (client.isOnline()) client.sendMessage(message);
|
if (client.isOnline()) client.sendMessage(message);
|
||||||
@ -97,7 +97,7 @@ public class WriteProxy {
|
|||||||
*
|
*
|
||||||
* @param evt the event to send
|
* @param evt the event to send
|
||||||
* @throws IOException if the event could not be sent
|
* @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 {
|
public void writeMessageStatusChangeEvent(MessageStatusChangeEvent evt) throws IOException {
|
||||||
if (client.isOnline()) client.sendEvent(evt);
|
if (client.isOnline()) client.sendEvent(evt);
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
package envoy.client.net;
|
package envoy.client.net;
|
||||||
|
@ -11,7 +11,7 @@ import java.awt.color.ColorSpace;
|
|||||||
* Created: <strong>23.12.2019</strong><br>
|
* Created: <strong>23.12.2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("javadoc")
|
@SuppressWarnings("javadoc")
|
||||||
public class Color extends java.awt.Color {
|
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
|
* @return the inversion of this {@link Color} by replacing the red, green and
|
||||||
* blue values by subtracting them form 255
|
* 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()); }
|
public Color invert() { return new Color(255 - getRed(), 255 - getGreen(), 255 - getBlue()); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the hex value of this {@link Color}
|
* @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()); }
|
public String toHex() { return String.format("#%02x%02x%02x", getRed(), getGreen(), getBlue()); }
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ import javax.swing.*;
|
|||||||
* Created: <strong>17 Mar 2020</strong><br>
|
* Created: <strong>17 Mar 2020</strong><br>
|
||||||
*
|
*
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public class ContextMenu extends JPopupMenu {
|
public class ContextMenu extends JPopupMenu {
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ public class ContextMenu extends JPopupMenu {
|
|||||||
/**
|
/**
|
||||||
* @param parent the component which will call this
|
* @param parent the component which will call this
|
||||||
* {@link ContextMenu}
|
* {@link ContextMenu}
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public ContextMenu(Component parent) { setInvoker(parent); }
|
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
|
* @param itemMnemonics the keyboard shortcuts that need to be pressed to
|
||||||
* automatically execute the {@link JMenuItem} with the
|
* automatically execute the {@link JMenuItem} with the
|
||||||
* given text
|
* 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,
|
public ContextMenu(String label, Component parent, Map<String, ActionListener> itemsWithActions, Map<String, Icon> itemIcons,
|
||||||
Map<String, Integer> itemMnemonics) {
|
Map<String, Integer> itemMnemonics) {
|
||||||
@ -89,7 +89,7 @@ public class ContextMenu extends JPopupMenu {
|
|||||||
*
|
*
|
||||||
* @return this instance of {@link ContextMenu} to allow chaining behind the
|
* @return this instance of {@link ContextMenu} to allow chaining behind the
|
||||||
* constructor
|
* constructor
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public ContextMenu build() {
|
public ContextMenu build() {
|
||||||
items.forEach((text, action) -> {
|
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
|
* @param label the string that a UI may use to display as a title for the
|
||||||
* pop-up menu.
|
* pop-up menu.
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public ContextMenu(String label) { super(label); }
|
public ContextMenu(String label) { super(label); }
|
||||||
|
|
||||||
@ -149,7 +149,7 @@ public class ContextMenu extends JPopupMenu {
|
|||||||
/**
|
/**
|
||||||
* Removes all subcomponents of this menu.
|
* Removes all subcomponents of this menu.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public void clear() {
|
public void clear() {
|
||||||
removeAll();
|
removeAll();
|
||||||
@ -160,33 +160,33 @@ public class ContextMenu extends JPopupMenu {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the items
|
* @return the items
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public Map<String, ActionListener> getItems() { return items; }
|
public Map<String, ActionListener> getItems() { return items; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param items the items with the displayed text and the according action to
|
* @param items the items with the displayed text and the according action to
|
||||||
* take once called
|
* take once called
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public void setItems(Map<String, ActionListener> items) { this.items = items; }
|
public void setItems(Map<String, ActionListener> items) { this.items = items; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the icons
|
* @return the icons
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public Map<String, Icon> getIcons() { return icons; }
|
public Map<String, Icon> getIcons() { return icons; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param icons the icons to set
|
* @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; }
|
public void setIcons(Map<String, Icon> icons) { this.icons = icons; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the mnemonics (the keyboard shortcuts that automatically execute the
|
* @return the mnemonics (the keyboard shortcuts that automatically execute the
|
||||||
* command for a {@link JMenuItem} with corresponding text)
|
* 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; }
|
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
|
* @param mnemonics the keyboard shortcuts that need to be pressed to
|
||||||
* automatically execute the {@link JMenuItem} with the given
|
* automatically execute the {@link JMenuItem} with the given
|
||||||
* text
|
* text
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public void setMnemonics(Map<String, Integer> mnemonics) { this.mnemonics = mnemonics; }
|
public void setMnemonics(Map<String, Integer> mnemonics) { this.mnemonics = mnemonics; }
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ import javax.swing.ImageIcon;
|
|||||||
* Created: <strong>16.03.2020</strong>
|
* Created: <strong>16.03.2020</strong>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public class IconUtil {
|
public class IconUtil {
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ public class IconUtil {
|
|||||||
* @param size the size to scale the icon to
|
* @param size the size to scale the icon to
|
||||||
* @return the scaled icon
|
* @return the scaled icon
|
||||||
* @throws IOException if the loading process failed
|
* @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 {
|
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));
|
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
|
* @return a map containing the loaded icons with the corresponding enum
|
||||||
* constants as keys
|
* constants as keys
|
||||||
* @throws IOException if the loading process failed
|
* @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 {
|
public static <T extends Enum<T>> EnumMap<T, ImageIcon> loadByEnum(Class<T> enumClass, int size) throws IOException {
|
||||||
var icons = new EnumMap<T, ImageIcon>(enumClass);
|
var icons = new EnumMap<T, ImageIcon>(enumClass);
|
||||||
|
@ -16,7 +16,7 @@ import envoy.exception.EnvoyException;
|
|||||||
* Created: <strong>3 Dec 2019</strong><br>
|
* Created: <strong>3 Dec 2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public class StatusTrayIcon {
|
public class StatusTrayIcon {
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ public class StatusTrayIcon {
|
|||||||
* notifications are displayed
|
* notifications are displayed
|
||||||
* @throws EnvoyException if the currently used OS does not support the System
|
* @throws EnvoyException if the currently used OS does not support the System
|
||||||
* Tray API
|
* Tray API
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public StatusTrayIcon(Window focusTarget) throws EnvoyException {
|
public StatusTrayIcon(Window focusTarget) throws EnvoyException {
|
||||||
if (!SystemTray.isSupported()) throw new EnvoyException("The Envoy tray icon is not supported.");
|
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
|
* @throws EnvoyException if the status icon could not be attaches to the system
|
||||||
* tray for system-internal reasons
|
* tray for system-internal reasons
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public void show() throws EnvoyException {
|
public void show() throws EnvoyException {
|
||||||
try {
|
try {
|
||||||
|
@ -10,7 +10,7 @@ import java.util.Map;
|
|||||||
* Created: <strong>23 Nov 2019</strong><br>
|
* Created: <strong>23 Nov 2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public class Theme implements Serializable {
|
public class Theme implements Serializable {
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ public class Theme implements Serializable {
|
|||||||
* @param selectionColor the section color
|
* @param selectionColor the section color
|
||||||
* @param typingMessageColor the color of currently typed messages
|
* @param typingMessageColor the color of currently typed messages
|
||||||
* @param userNameColor the color of user names
|
* @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,
|
public Theme(String themeName, Color backgroundColor, Color cellColor, Color interactableForegroundColor, Color interactableBackgroundColor,
|
||||||
Color textColor, Color dateColorChat, Color selectionColor, Color typingMessageColor, Color userNameColor) {
|
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 name the name of the {@link Theme}
|
||||||
* @param other the {@link Theme} to copy
|
* @param other the {@link Theme} to copy
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Theme(String name, Theme other) {
|
public Theme(String name, Theme other) {
|
||||||
themeName = name;
|
themeName = name;
|
||||||
@ -69,69 +69,69 @@ public class Theme implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* @return a {@code Map<String, Color>} of all colors defined for this theme
|
* @return a {@code Map<String, Color>} of all colors defined for this theme
|
||||||
* with their names as keys
|
* with their names as keys
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Map<String, Color> getColors() { return colors; }
|
public Map<String, Color> getColors() { return colors; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return name of the theme
|
* @return name of the theme
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public String getThemeName() { return themeName; }
|
public String getThemeName() { return themeName; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return interactableForegroundColor
|
* @return interactableForegroundColor
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Color getInteractableForegroundColor() { return colors.get("interactableForegroundColor"); }
|
public Color getInteractableForegroundColor() { return colors.get("interactableForegroundColor"); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the {@link Color} in which the text content of a message should be
|
* @return the {@link Color} in which the text content of a message should be
|
||||||
* displayed
|
* displayed
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Color getTextColor() { return colors.get("textColor"); }
|
public Color getTextColor() { return colors.get("textColor"); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the {@link Color} in which the creation date of a message should be
|
* @return the {@link Color} in which the creation date of a message should be
|
||||||
* displayed
|
* displayed
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Color getDateColor() { return colors.get("dateColorChat"); }
|
public Color getDateColor() { return colors.get("dateColorChat"); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return selectionColor
|
* @return selectionColor
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Color getSelectionColor() { return colors.get("selectionColor"); }
|
public Color getSelectionColor() { return colors.get("selectionColor"); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return typingMessageColor
|
* @return typingMessageColor
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Color getTypingMessageColor() { return colors.get("typingMessageColor"); }
|
public Color getTypingMessageColor() { return colors.get("typingMessageColor"); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return backgroundColor
|
* @return backgroundColor
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Color getBackgroundColor() { return colors.get("backgroundColor"); }
|
public Color getBackgroundColor() { return colors.get("backgroundColor"); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return cellColor
|
* @return cellColor
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Color getCellColor() { return colors.get("cellColor"); }
|
public Color getCellColor() { return colors.get("cellColor"); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return interactableBackgroundColor
|
* @return interactableBackgroundColor
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Color getInteractableBackgroundColor() { return colors.get("interactableBackgroundColor"); }
|
public Color getInteractableBackgroundColor() { return colors.get("interactableBackgroundColor"); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return userNameColor
|
* @return userNameColor
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public Color getUserNameColor() { return colors.get("userNameColor"); }
|
public Color getUserNameColor() { return colors.get("userNameColor"); }
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ import envoy.util.EnvoyLog;
|
|||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public class ChatWindow extends JFrame {
|
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
|
* Initializes a {@link JFrame} with UI elements used to send and read messages
|
||||||
* to different users.
|
* to different users.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public ChatWindow() {
|
public ChatWindow() {
|
||||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
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.
|
* Used to immediately reload the {@link ChatWindow} when settings were changed.
|
||||||
*
|
*
|
||||||
* @param theme the theme to change colors into
|
* @param theme the theme to change colors into
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
private void applyTheme(Theme theme) {
|
private void applyTheme(Theme theme) {
|
||||||
// contentPane
|
// 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.
|
* 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() {
|
private void postMessage() {
|
||||||
if (userList.isSelectionEmpty()) {
|
if (userList.isSelectionEmpty()) {
|
||||||
@ -557,7 +557,7 @@ public class ChatWindow extends JFrame {
|
|||||||
*
|
*
|
||||||
* @param message the message to forward
|
* @param message the message to forward
|
||||||
* @param recipient the new recipient of the message
|
* @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) {
|
private void forwardMessage(Message message, User... recipients) {
|
||||||
Arrays.stream(recipients).forEach(recipient -> {
|
Arrays.stream(recipients).forEach(recipient -> {
|
||||||
@ -576,7 +576,7 @@ public class ChatWindow extends JFrame {
|
|||||||
* Sends a {@link Message} to the server.
|
* Sends a {@link Message} to the server.
|
||||||
*
|
*
|
||||||
* @param message the message to send
|
* @param message the message to send
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
private void sendMessage(final Message message) {
|
private void sendMessage(final Message message) {
|
||||||
try {
|
try {
|
||||||
@ -639,7 +639,7 @@ public class ChatWindow extends JFrame {
|
|||||||
* @param writeProxy the write proxy used to send messages and status change
|
* @param writeProxy the write proxy used to send messages and status change
|
||||||
* events to the server or cache them inside the local
|
* events to the server or cache them inside the local
|
||||||
* database
|
* database
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public void initContent(Client client, LocalDb localDb, WriteProxy writeProxy) {
|
public void initContent(Client client, LocalDb localDb, WriteProxy writeProxy) {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
@ -668,7 +668,7 @@ public class ChatWindow extends JFrame {
|
|||||||
* {@link ChatWindow#MAX_MESSAGE_LENGTH}
|
* {@link ChatWindow#MAX_MESSAGE_LENGTH}
|
||||||
* and splits the text into the allowed part, if that is the case.
|
* 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() {
|
private void checkMessageTextLength() {
|
||||||
String input = messageEnterTextArea.getText();
|
String input = messageEnterTextArea.getText();
|
||||||
|
@ -30,7 +30,7 @@ import envoy.data.User;
|
|||||||
* Created: <strong>15 Mar 2020</strong><br>
|
* Created: <strong>15 Mar 2020</strong><br>
|
||||||
*
|
*
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public class ContactsChooserDialog extends JDialog {
|
public class ContactsChooserDialog extends JDialog {
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ public class ContactsChooserDialog extends JDialog {
|
|||||||
* @param users the users that should be displayed
|
* @param users the users that should be displayed
|
||||||
* @return the selected Element (yet has to be casted to the wanted type due to
|
* @return the selected Element (yet has to be casted to the wanted type due to
|
||||||
* the Generics limitations in Java)
|
* 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) {
|
public static List<User> showForwardingDialog(String title, Component parent, Message message, Collection<User> users) {
|
||||||
ContactsChooserDialog dialog = new ContactsChooserDialog(parent);
|
ContactsChooserDialog dialog = new ContactsChooserDialog(parent);
|
||||||
@ -89,7 +89,7 @@ public class ContactsChooserDialog extends JDialog {
|
|||||||
/**
|
/**
|
||||||
* @param parent this @{@link Component} will be parsed to
|
* @param parent this @{@link Component} will be parsed to
|
||||||
* {@link java.awt.Window#setLocationRelativeTo(Component)}
|
* {@link java.awt.Window#setLocationRelativeTo(Component)}
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
private ContactsChooserDialog(Component parent) {
|
private ContactsChooserDialog(Component parent) {
|
||||||
contactList.setSelectionMode(SelectionMode.MULTIPLE);
|
contactList.setSelectionMode(SelectionMode.MULTIPLE);
|
||||||
@ -138,7 +138,7 @@ public class ContactsChooserDialog extends JDialog {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the underlying {@link ComponentList}
|
* @return the underlying {@link ComponentList}
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
private ComponentList<User> getContactList() { return contactList; }
|
private ComponentList<User> getContactList() { return contactList; }
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ import envoy.client.ui.Theme;
|
|||||||
* Created: <strong>17 Mar 2020</strong><br>
|
* Created: <strong>17 Mar 2020</strong><br>
|
||||||
*
|
*
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public class ContextMenu extends JPopupMenu {
|
public class ContextMenu extends JPopupMenu {
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ public class ContextMenu extends JPopupMenu {
|
|||||||
/**
|
/**
|
||||||
* @param parent the component which will call this
|
* @param parent the component which will call this
|
||||||
* {@link ContextMenu}
|
* {@link ContextMenu}
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public ContextMenu(Component parent) {
|
public ContextMenu(Component parent) {
|
||||||
setInvoker(parent);
|
setInvoker(parent);
|
||||||
@ -80,7 +80,7 @@ public class ContextMenu extends JPopupMenu {
|
|||||||
* @param itemMnemonics the keyboard shortcuts that need to be pressed to
|
* @param itemMnemonics the keyboard shortcuts that need to be pressed to
|
||||||
* automatically execute the {@link JMenuItem} with the
|
* automatically execute the {@link JMenuItem} with the
|
||||||
* given text
|
* 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,
|
public ContextMenu(String label, Component parent, Map<String, ActionListener> itemsWithActions, Map<String, Icon> itemIcons,
|
||||||
Map<String, Integer> itemMnemonics) {
|
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
|
* @param label the string that a UI may use to display as a title for the
|
||||||
* pop-up menu.
|
* pop-up menu.
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public ContextMenu(String label) {
|
public ContextMenu(String label) {
|
||||||
super(label);
|
super(label);
|
||||||
@ -107,7 +107,7 @@ public class ContextMenu extends JPopupMenu {
|
|||||||
*
|
*
|
||||||
* @return this instance of {@link ContextMenu} to allow chaining behind the
|
* @return this instance of {@link ContextMenu} to allow chaining behind the
|
||||||
* constructor
|
* constructor
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public ContextMenu build() {
|
public ContextMenu build() {
|
||||||
items.forEach((text, action) -> {
|
items.forEach((text, action) -> {
|
||||||
@ -162,7 +162,7 @@ public class ContextMenu extends JPopupMenu {
|
|||||||
/**
|
/**
|
||||||
* Removes all subcomponents of this menu.
|
* Removes all subcomponents of this menu.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public void clear() {
|
public void clear() {
|
||||||
removeAll();
|
removeAll();
|
||||||
@ -173,33 +173,33 @@ public class ContextMenu extends JPopupMenu {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the items
|
* @return the items
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public Map<String, ActionListener> getItems() { return items; }
|
public Map<String, ActionListener> getItems() { return items; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param items the items with the displayed text and the according action to
|
* @param items the items with the displayed text and the according action to
|
||||||
* take once called
|
* take once called
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public void setItems(Map<String, ActionListener> items) { this.items = items; }
|
public void setItems(Map<String, ActionListener> items) { this.items = items; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the icons
|
* @return the icons
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public Map<String, Icon> getIcons() { return icons; }
|
public Map<String, Icon> getIcons() { return icons; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param icons the icons to set
|
* @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; }
|
public void setIcons(Map<String, Icon> icons) { this.icons = icons; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the mnemonics (the keyboard shortcuts that automatically execute the
|
* @return the mnemonics (the keyboard shortcuts that automatically execute the
|
||||||
* command for a {@link JMenuItem} with corresponding text)
|
* 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; }
|
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
|
* @param mnemonics the keyboard shortcuts that need to be pressed to
|
||||||
* automatically execute the {@link JMenuItem} with the given
|
* automatically execute the {@link JMenuItem} with the given
|
||||||
* text
|
* text
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public void setMnemonics(Map<String, Integer> mnemonics) { this.mnemonics = mnemonics; }
|
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
|
* Additionally sets the foreground of all subcomponents of this
|
||||||
* {@link ContextMenu}.
|
* {@link ContextMenu}.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setForeground(Color color) {
|
public void setForeground(Color color) {
|
||||||
@ -230,7 +230,7 @@ public class ContextMenu extends JPopupMenu {
|
|||||||
* Additionally sets the background of all subcomponents of this
|
* Additionally sets the background of all subcomponents of this
|
||||||
* {@link ContextMenu}.
|
* {@link ContextMenu}.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setBackground(Color color) {
|
public void setBackground(Color color) {
|
||||||
@ -246,7 +246,7 @@ public class ContextMenu extends JPopupMenu {
|
|||||||
* Envoy-exclusive object.
|
* Envoy-exclusive object.
|
||||||
*
|
*
|
||||||
* @param theme the theme to use
|
* @param theme the theme to use
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
protected void applyTheme(Theme theme) {
|
protected void applyTheme(Theme theme) {
|
||||||
setBackground(theme.getCellColor());
|
setBackground(theme.getCellColor());
|
||||||
|
@ -33,7 +33,7 @@ import envoy.util.EnvoyLog;
|
|||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class LoginDialog extends JDialog {
|
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 localDb the local database in which data is persisted
|
||||||
* @param receivedMessageCache the cache that stored messages received during
|
* @param receivedMessageCache the cache that stored messages received during
|
||||||
* the handshake
|
* the handshake
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public LoginDialog(Client client, LocalDb localDb, Cache<Message> receivedMessageCache) {
|
public LoginDialog(Client client, LocalDb localDb, Cache<Message> receivedMessageCache) {
|
||||||
this.client = client;
|
this.client = client;
|
||||||
@ -283,7 +283,7 @@ public class LoginDialog extends JDialog {
|
|||||||
/**
|
/**
|
||||||
* Resets the text stored in the password fields.
|
* Resets the text stored in the password fields.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
private void clearPasswordFields() {
|
private void clearPasswordFields() {
|
||||||
passwordField.setText(null);
|
passwordField.setText(null);
|
||||||
@ -337,7 +337,7 @@ public class LoginDialog extends JDialog {
|
|||||||
/**
|
/**
|
||||||
* Shuts the system down properly if the login was aborted.
|
* Shuts the system down properly if the login was aborted.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
private void abortLogin() {
|
private void abortLogin() {
|
||||||
logger.info("The login process has been cancelled. Exiting...");
|
logger.info("The login process has been cancelled. Exiting...");
|
||||||
|
@ -8,6 +8,6 @@
|
|||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
package envoy.client.ui.container;
|
package envoy.client.ui.container;
|
||||||
|
@ -19,7 +19,7 @@ import javax.swing.*;
|
|||||||
*
|
*
|
||||||
* @param <E> the type of object displayed in this list
|
* @param <E> the type of object displayed in this list
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class ComponentList<E> extends JPanel {
|
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
|
* 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 {
|
public static enum SelectionMode {
|
||||||
/**
|
/**
|
||||||
@ -56,7 +56,7 @@ public class ComponentList<E> extends JPanel {
|
|||||||
/**
|
/**
|
||||||
* Creates an instance of {@link ComponentList}.
|
* 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)); }
|
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
|
* Removes all child components and then adds all components representing the
|
||||||
* elements of the {@link Model}.
|
* elements of the {@link Model}.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public void synchronizeModel() {
|
public void synchronizeModel() {
|
||||||
if (model != null) {
|
if (model != null) {
|
||||||
@ -79,7 +79,7 @@ public class ComponentList<E> extends JPanel {
|
|||||||
* removed from the selection.
|
* removed from the selection.
|
||||||
*
|
*
|
||||||
* @param index the index of the selected component
|
* @param index the index of the selected component
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public void selectElement(int index) {
|
public void selectElement(int index) {
|
||||||
final JComponent element = getComponent(index);
|
final JComponent element = getComponent(index);
|
||||||
@ -112,7 +112,7 @@ public class ComponentList<E> extends JPanel {
|
|||||||
/**
|
/**
|
||||||
* Removes the current selection.
|
* Removes the current selection.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public void clearSelection() {
|
public void clearSelection() {
|
||||||
if (selectionHandler != null) selection.forEach(i -> selectionHandler.selectionChanged(model.get(i), getComponent(i), false));
|
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}.
|
* {@link Renderer}.
|
||||||
*
|
*
|
||||||
* @param elem the element to add
|
* @param elem the element to add
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
void addElement(E elem) {
|
void addElement(E elem) {
|
||||||
if (renderer != null) {
|
if (renderer != null) {
|
||||||
@ -140,7 +140,7 @@ public class ComponentList<E> extends JPanel {
|
|||||||
* @return a mouse listener calling the
|
* @return a mouse listener calling the
|
||||||
* {@link ComponentList#selectElement(int)} method with the
|
* {@link ComponentList#selectElement(int)} method with the
|
||||||
* component's index when a left click is performed by the user
|
* 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) {
|
private MouseListener getSelectionListener(int componentIndex) {
|
||||||
return new MouseAdapter() {
|
return new MouseAdapter() {
|
||||||
@ -155,13 +155,13 @@ public class ComponentList<E> extends JPanel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a set of all selected indices
|
* @return a set of all selected indices
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public Set<Integer> getSelection() { return selection; }
|
public Set<Integer> getSelection() { return selection; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a set of all selected elements
|
* @return a set of all selected elements
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public Set<E> getSelectedElements() {
|
public Set<E> getSelectedElements() {
|
||||||
var selectedElements = new HashSet<E>();
|
var selectedElements = new HashSet<E>();
|
||||||
@ -172,20 +172,20 @@ public class ComponentList<E> extends JPanel {
|
|||||||
/**
|
/**
|
||||||
* @return the index of an arbitrary selected element
|
* @return the index of an arbitrary selected element
|
||||||
* @throws java.util.NoSuchElementException if no selection is present
|
* @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(); }
|
public int getSingleSelection() { return selection.stream().findAny().get(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return an arbitrary selected element
|
* @return an arbitrary selected element
|
||||||
* @throws java.util.NoSuchElementException if no selection is present
|
* @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()); }
|
public E getSingleSelectedElement() { return model.get(getSingleSelection()); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the model
|
* @return the model
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public Model<E> getModel() { return model; }
|
public Model<E> getModel() { return model; }
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ public class ComponentList<E> extends JPanel {
|
|||||||
*
|
*
|
||||||
* @param model the list model to set
|
* @param model the list model to set
|
||||||
* @return this component list
|
* @return this component list
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public ComponentList<E> setModel(Model<E> model) {
|
public ComponentList<E> setModel(Model<E> model) {
|
||||||
|
|
||||||
@ -213,14 +213,14 @@ public class ComponentList<E> extends JPanel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the renderer
|
* @return the renderer
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public Renderer<E> getRenderer() { return renderer; }
|
public Renderer<E> getRenderer() { return renderer; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param renderer the renderer to set
|
* @param renderer the renderer to set
|
||||||
* @return this component list
|
* @return this component list
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public ComponentList<E> setRenderer(Renderer<E> renderer) {
|
public ComponentList<E> setRenderer(Renderer<E> renderer) {
|
||||||
this.renderer = renderer;
|
this.renderer = renderer;
|
||||||
@ -229,7 +229,7 @@ public class ComponentList<E> extends JPanel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the selection mode
|
* @return the selection mode
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public SelectionMode getSelectionMode() { return selectionMode; }
|
public SelectionMode getSelectionMode() { return selectionMode; }
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ public class ComponentList<E> extends JPanel {
|
|||||||
*
|
*
|
||||||
* @param selectionMode the selection mode to set
|
* @param selectionMode the selection mode to set
|
||||||
* @return this component list
|
* @return this component list
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public ComponentList<E> setSelectionMode(SelectionMode selectionMode) {
|
public ComponentList<E> setSelectionMode(SelectionMode selectionMode) {
|
||||||
this.selectionMode = selectionMode;
|
this.selectionMode = selectionMode;
|
||||||
@ -249,13 +249,13 @@ public class ComponentList<E> extends JPanel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the selection handler
|
* @return the selection handler
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public SelectionHandler<E> getSelectionHandler() { return selectionHandler; }
|
public SelectionHandler<E> getSelectionHandler() { return selectionHandler; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param selectionHandler the selection handler to set
|
* @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; }
|
public void setSelectionHandler(SelectionHandler<E> selectionHandler) { this.selectionHandler = selectionHandler; }
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
* @param <E> the type of object displayed in this list
|
* @param <E> the type of object displayed in this list
|
||||||
* @author Kai S. K. Engelbart
|
* @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 {
|
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
|
* @param e the element to add
|
||||||
* @return {@code true}
|
* @return {@code true}
|
||||||
* @see java.util.List#add(java.lang.Object)
|
* @see java.util.List#add(java.lang.Object)
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public boolean add(E e) {
|
public boolean add(E e) {
|
||||||
if (componentList != null) {
|
if (componentList != null) {
|
||||||
@ -45,7 +45,7 @@ public final class Model<E> implements Iterable<E>, Serializable {
|
|||||||
* {@link ComponentList}.
|
* {@link ComponentList}.
|
||||||
*
|
*
|
||||||
* @see java.util.List#clear()
|
* @see java.util.List#clear()
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public void clear() {
|
public void clear() {
|
||||||
elements.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
|
* @param index the index to retrieve the element from
|
||||||
* @return the element located at the index
|
* @return the element located at the index
|
||||||
* @see java.util.List#get(int)
|
* @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); }
|
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
|
* @param index the index of the element to remove
|
||||||
* @return the removed element
|
* @return the removed element
|
||||||
* @see java.util.List#remove(int)
|
* @see java.util.List#remove(int)
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public E remove(int index) {
|
public E remove(int index) {
|
||||||
if (componentList != null) componentList.remove(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
|
* @return the amount of elements in this list model
|
||||||
* @see java.util.List#size()
|
* @see java.util.List#size()
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public int size() { return elements.size(); }
|
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
|
* @return an iterator over the elements of this list model
|
||||||
* @see java.util.List#iterator()
|
* @see java.util.List#iterator()
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Iterator<E> iterator() {
|
public Iterator<E> iterator() {
|
||||||
@ -111,7 +111,7 @@ public final class Model<E> implements Iterable<E>, Serializable {
|
|||||||
* synchronization.
|
* synchronization.
|
||||||
*
|
*
|
||||||
* @param componentList the component list to set
|
* @param componentList the component list to set
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
void setComponentList(ComponentList<E> componentList) {
|
void setComponentList(ComponentList<E> componentList) {
|
||||||
this.componentList = componentList;
|
this.componentList = componentList;
|
||||||
|
@ -12,7 +12,7 @@ import javax.swing.JComponent;
|
|||||||
*
|
*
|
||||||
* @param <E> the type of object displayed in this list
|
* @param <E> the type of object displayed in this list
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface Renderer<E> {
|
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
|
* @param isSelected {@code true} if the user has selected the list cell in
|
||||||
* which the list element is rendered
|
* which the list element is rendered
|
||||||
* @return the component representing the list element
|
* @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);
|
JComponent getListCellComponent(ComponentList<? extends E> list, E value);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import javax.swing.JComponent;
|
|||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @param <E> the type of the underlying {@link ComponentList}
|
* @param <E> the type of the underlying {@link ComponentList}
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
public interface SelectionHandler<E> {
|
public interface SelectionHandler<E> {
|
||||||
@ -22,7 +22,7 @@ public interface SelectionHandler<E> {
|
|||||||
* @param element the selected element
|
* @param element the selected element
|
||||||
* @param component the selected component
|
* @param component the selected component
|
||||||
* @param isSelected contains the selection state
|
* @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);
|
void selectionChanged(E element, JComponent component, boolean isSelected);
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,6 @@
|
|||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
package envoy.client.ui.list;
|
package envoy.client.ui.list;
|
||||||
|
@ -20,7 +20,7 @@ import envoy.event.EventBus;
|
|||||||
* Created: <strong>21.03.2020</strong>
|
* Created: <strong>21.03.2020</strong>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public class ContactSearchComponent extends JComponent {
|
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 list the {@link ComponentList} that is used to display search results
|
||||||
* @param user the {@link User} that appears as a search result
|
* @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) {
|
public ContactSearchComponent(ComponentList<? extends User> list, User user) {
|
||||||
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
|
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
|
||||||
|
@ -22,7 +22,7 @@ import envoy.data.User;
|
|||||||
* Created: <strong>21.03.2020</strong>
|
* Created: <strong>21.03.2020</strong>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public class MessageComponent extends JPanel {
|
public class MessageComponent extends JPanel {
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ public class MessageComponent extends JPanel {
|
|||||||
* @param message the {@link Message} to display
|
* @param message the {@link Message} to display
|
||||||
* @param senderId the id of the {@link User} who sends messages from this
|
* @param senderId the id of the {@link User} who sends messages from this
|
||||||
* account
|
* account
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public MessageComponent(ComponentList<? extends Message> list, Message message, long senderId) {
|
public MessageComponent(ComponentList<? extends Message> list, Message message, long senderId) {
|
||||||
var width = list.getMaximumSize().width;
|
var width = list.getMaximumSize().width;
|
||||||
|
@ -20,7 +20,7 @@ import envoy.data.User.UserStatus;
|
|||||||
* Created: <strong>21.03.2020</strong>
|
* Created: <strong>21.03.2020</strong>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public class UserComponent extends JPanel {
|
public class UserComponent extends JPanel {
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ public class UserComponent extends JPanel {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param user the {@link User} whose information is displayed
|
* @param user the {@link User} whose information is displayed
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
public UserComponent(User user) {
|
public UserComponent(User user) {
|
||||||
final Theme theme = Settings.getInstance().getCurrentTheme();
|
final Theme theme = Settings.getInstance().getCurrentTheme();
|
||||||
|
@ -9,6 +9,6 @@
|
|||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
package envoy.client.ui.list_component;
|
package envoy.client.ui.list_component;
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
package envoy.client.ui;
|
package envoy.client.ui;
|
||||||
|
@ -11,7 +11,7 @@ import javax.swing.JButton;
|
|||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public class PrimaryButton extends JButton {
|
public class PrimaryButton extends JButton {
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ import envoy.client.ui.Theme;
|
|||||||
* Created: <strong>14.12.2019</strong><br>
|
* Created: <strong>14.12.2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public class PrimaryScrollBar extends BasicScrollBarUI {
|
public class PrimaryScrollBar extends BasicScrollBarUI {
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@ public class PrimaryScrollPane extends JScrollPane {
|
|||||||
/**
|
/**
|
||||||
* Initializes a {@link JScrollPane} with the primary Envoy design scheme
|
* 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); }
|
public PrimaryScrollPane() { setBorder(null); }
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ public class PrimaryScrollPane extends JScrollPane {
|
|||||||
* Styles the vertical and horizontal scroll bars.
|
* Styles the vertical and horizontal scroll bars.
|
||||||
*
|
*
|
||||||
* @param theme the color set used to color the component
|
* @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) {
|
public void applyTheme(Theme theme) {
|
||||||
setForeground(theme.getBackgroundColor());
|
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>
|
* When rereading messages, the chat doesn't scroll down if new messages </br>
|
||||||
* are added. (Besides see first point)
|
* are added. (Besides see first point)
|
||||||
*
|
*
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public void autoscroll() {
|
public void autoscroll() {
|
||||||
// Automatic scrolling to the bottom
|
// Automatic scrolling to the bottom
|
||||||
@ -79,7 +79,7 @@ public class PrimaryScrollPane extends JScrollPane {
|
|||||||
* triggering it to automatically scroll down.
|
* triggering it to automatically scroll down.
|
||||||
*
|
*
|
||||||
* @param chatOpened indicates the chat opening status
|
* @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; }
|
public void setChatOpened(boolean chatOpened) { this.chatOpened = chatOpened; }
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ import javax.swing.border.EmptyBorder;
|
|||||||
* Created: <strong>07.12.2019</strong><br>
|
* Created: <strong>07.12.2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public class PrimaryTextArea extends JTextArea {
|
public class PrimaryTextArea extends JTextArea {
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import envoy.client.ui.Color;
|
|||||||
*
|
*
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class PrimaryToggleSwitch extends JButton {
|
public class PrimaryToggleSwitch extends JButton {
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ public class PrimaryToggleSwitch extends JButton {
|
|||||||
*
|
*
|
||||||
* @param settingsItem the {@link SettingsItem} that is controlled by this
|
* @param settingsItem the {@link SettingsItem} that is controlled by this
|
||||||
* {@link PrimaryToggleSwitch}
|
* {@link PrimaryToggleSwitch}
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public PrimaryToggleSwitch(SettingsItem<Boolean> settingsItem) {
|
public PrimaryToggleSwitch(SettingsItem<Boolean> settingsItem) {
|
||||||
setPreferredSize(new Dimension(50, 25));
|
setPreferredSize(new Dimension(50, 25));
|
||||||
|
@ -12,6 +12,6 @@
|
|||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
package envoy.client.ui.primary;
|
package envoy.client.ui.primary;
|
||||||
|
@ -20,7 +20,7 @@ import envoy.data.User.UserStatus;
|
|||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public class UserListRenderer extends JLabel implements ListCellRenderer<User> {
|
public class UserListRenderer extends JLabel implements ListCellRenderer<User> {
|
||||||
|
|
||||||
|
@ -9,6 +9,6 @@
|
|||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
package envoy.client.ui.renderer;
|
package envoy.client.ui.renderer;
|
||||||
|
@ -22,7 +22,7 @@ import envoy.util.EnvoyLog;
|
|||||||
* Created: <strong>21 Dec 2019</strong><br>
|
* Created: <strong>21 Dec 2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class GeneralSettingsPanel extends SettingsPanel {
|
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
|
* @param parent the {@link SettingsScreen} as a part of which this
|
||||||
* {@link SettingsPanel} is displayed
|
* {@link SettingsPanel} is displayed
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public GeneralSettingsPanel(SettingsScreen parent) {
|
public GeneralSettingsPanel(SettingsScreen parent) {
|
||||||
super(parent);
|
super(parent);
|
||||||
|
@ -20,7 +20,7 @@ import envoy.client.ui.primary.PrimaryTextArea;
|
|||||||
* Created: <strong>26 Dec 2019</strong><br>
|
* Created: <strong>26 Dec 2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public class NewThemeScreen extends JDialog {
|
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 newThemeAction is executed when a new theme name is entered
|
||||||
* @param modifyThemeAction is executed when an existing theme name is entered
|
* @param modifyThemeAction is executed when an existing theme name is entered
|
||||||
* and confirmed
|
* and confirmed
|
||||||
* @since Envoy v0.3-alpha
|
* @since Envoy Client v0.3-alpha
|
||||||
*/
|
*/
|
||||||
public NewThemeScreen(SettingsScreen parent, Consumer<String> newThemeAction, Consumer<String> modifyThemeAction) {
|
public NewThemeScreen(SettingsScreen parent, Consumer<String> newThemeAction, Consumer<String> modifyThemeAction) {
|
||||||
this.newThemeAction = newThemeAction;
|
this.newThemeAction = newThemeAction;
|
||||||
|
@ -12,7 +12,7 @@ import javax.swing.JPanel;
|
|||||||
* Created: <strong>20 Dec 2019</strong><br>
|
* Created: <strong>20 Dec 2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public abstract class SettingsPanel extends JPanel {
|
public abstract class SettingsPanel extends JPanel {
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import envoy.util.EnvoyLog;
|
|||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public class SettingsScreen extends JDialog {
|
public class SettingsScreen extends JDialog {
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ public class SettingsScreen extends JDialog {
|
|||||||
/**
|
/**
|
||||||
* Initializes the settings screen.
|
* Initializes the settings screen.
|
||||||
*
|
*
|
||||||
* @since Envoy v0.1-alpha
|
* @since Envoy Client v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public SettingsScreen() {
|
public SettingsScreen() {
|
||||||
// Initialize settings pages
|
// Initialize settings pages
|
||||||
|
@ -24,7 +24,7 @@ import envoy.util.EnvoyLog;
|
|||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public class ThemeCustomizationPanel extends SettingsPanel {
|
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
|
* @param parent the {@link SettingsScreen} as a part of which this
|
||||||
* {@link SettingsPanel} is displayed
|
* {@link SettingsPanel} is displayed
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
public ThemeCustomizationPanel(SettingsScreen parent) {
|
public ThemeCustomizationPanel(SettingsScreen parent) {
|
||||||
super(parent);
|
super(parent);
|
||||||
|
@ -4,6 +4,6 @@
|
|||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.2-alpha
|
* @since Envoy Client v0.2-alpha
|
||||||
*/
|
*/
|
||||||
package envoy.client.ui.settings;
|
package envoy.client.ui.settings;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy v0.1-beta
|
* @since Envoy Client v0.1-beta
|
||||||
*/
|
*/
|
||||||
module envoy {
|
module envoy {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user