Updated Javadoc for the whole Repository
Aside from the files ChatWindow, Client and SettingsScreen, theirs is already in my commit in f/settings
This commit is contained in:
parent
6f6388f595
commit
ab3a18d4df
@ -10,11 +10,32 @@ public class Chat {
|
|||||||
private User recipient;
|
private User recipient;
|
||||||
private DefaultListModel<Message> model = new DefaultListModel<>();
|
private DefaultListModel<Message> model = new DefaultListModel<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides the list of messages that the recipient receives.<br>
|
||||||
|
* Saves the Messages in the corresponding chat at that Point.
|
||||||
|
*
|
||||||
|
* @param recipient the user who receives the messages
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
|
*/
|
||||||
public Chat(User recipient) { this.recipient = recipient; }
|
public Chat(User recipient) { this.recipient = recipient; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the recipient of a message
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
|
*/
|
||||||
public User getRecipient() { return recipient; }
|
public User getRecipient() { return recipient; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the received message at the current Point in the current chat
|
||||||
|
*
|
||||||
|
* @param message the message to add in said chat
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
|
*/
|
||||||
public void appendMessage(Message message) { model.addElement(message); }
|
public void appendMessage(Message message) { model.addElement(message); }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return all messages in the current chat
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
|
*/
|
||||||
public DefaultListModel<Message> getModel() { return model; }
|
public DefaultListModel<Message> getModel() { return model; }
|
||||||
}
|
}
|
@ -8,7 +8,7 @@ import java.util.Properties;
|
|||||||
* Created: <strong>12 Oct 2019</strong><br>
|
* Created: <strong>12 Oct 2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
* @since Envoy 0.1
|
* @since Envoy v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public class Config {
|
public class Config {
|
||||||
|
|
||||||
@ -19,8 +19,9 @@ public class Config {
|
|||||||
* Defaults to the {@code server.properties} file for information.
|
* Defaults to the {@code server.properties} file for information.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param properties - The two options for internet connection <strong> server</strong> and <strong> port</strong>
|
* @param properties - The two options for internet connection <strong>
|
||||||
* @since Envoy 0.1
|
* server</strong> and <strong> port</strong>
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public void load(Properties properties) {
|
public void load(Properties properties) {
|
||||||
if (properties.containsKey("server")) server = properties.getProperty("server");
|
if (properties.containsKey("server")) server = properties.getProperty("server");
|
||||||
@ -28,11 +29,12 @@ public class Config {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the server and the port via command line properties --server/ -s and --port/ -p.
|
* Sets the server and the port via command line properties --server/ -s and
|
||||||
|
* --port/ -p.
|
||||||
*
|
*
|
||||||
* @param args {@code --server} or {@code -s} followed by the specified URL
|
* @param args {@code --server} or {@code -s} followed by the specified URL
|
||||||
* and {@code --port} or {@code -p} followed by a 4-digit Integer
|
* and {@code --port} or {@code -p} followed by a 4-digit Integer
|
||||||
* @since Envoy 0.1
|
* @since Envoy v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public void load(String[] args) {
|
public void load(String[] args) {
|
||||||
for (int i = 0; i < args.length; i++)
|
for (int i = 0; i < args.length; i++)
|
||||||
@ -48,13 +50,39 @@ public class Config {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if server and port are known.
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
|
*/
|
||||||
public boolean isInitialized() { return server != null && !server.isEmpty() && port > 0; }
|
public boolean isInitialized() { return server != null && !server.isEmpty() && port > 0; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the URL of our website
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
|
*/
|
||||||
public String getServer() { return server; }
|
public String getServer() { return server; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes the default URL.
|
||||||
|
* Exclusively meant for developing reasons. (localhost)
|
||||||
|
*
|
||||||
|
* @param server the URL where wish to host Envoy
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
|
*/
|
||||||
public void setServer(String server) { this.server = server; }
|
public void setServer(String server) { this.server = server; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the port at which Envoy is located in the Server
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
|
*/
|
||||||
public int getPort() { return port; }
|
public int getPort() { return port; }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Changes the default port.
|
||||||
|
* Exclusively meant for developing reasons. (localhost)
|
||||||
|
*
|
||||||
|
* @param port the port where we wish to connect to {@code Envoy}.
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
|
*/
|
||||||
public void setPort(int port) { this.port = port; }
|
public void setPort(int port) { this.port = port; }
|
||||||
}
|
}
|
@ -10,11 +10,15 @@ import javax.swing.ListCellRenderer;
|
|||||||
import envoy.schema.Message;
|
import envoy.schema.Message;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Defines how a message is displayed.<br>
|
||||||
|
* <br>
|
||||||
|
*
|
||||||
* Project: <strong>envoy-client</strong><br>
|
* Project: <strong>envoy-client</strong><br>
|
||||||
* File: <strong>UserListRenderer.java</strong><br>
|
* File: <strong>UserListRenderer.java</strong><br>
|
||||||
* Created: <strong>19 Oct 2019</strong><br>
|
* Created: <strong>19 Oct 2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public class MessageListRenderer extends JLabel implements ListCellRenderer<Message> {
|
public class MessageListRenderer extends JLabel implements ListCellRenderer<Message> {
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ import envoy.client.Config;
|
|||||||
*
|
*
|
||||||
* @author Leon Hofmeister
|
* @author Leon Hofmeister
|
||||||
* @author Maximilian Käfer
|
* @author Maximilian Käfer
|
||||||
* @since Envoy 0.1
|
* @since Envoy v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public class Startup {
|
public class Startup {
|
||||||
|
|
||||||
|
@ -9,11 +9,14 @@ import javax.swing.ListCellRenderer;
|
|||||||
import envoy.schema.User;
|
import envoy.schema.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Defines how the {@code UserList} is displayed.
|
||||||
|
*
|
||||||
* Project: <strong>envoy-client</strong><br>
|
* Project: <strong>envoy-client</strong><br>
|
||||||
* File: <strong>UserListRenderer.java</strong><br>
|
* File: <strong>UserListRenderer.java</strong><br>
|
||||||
* Created: <strong>12 Oct 2019</strong><br>
|
* Created: <strong>12 Oct 2019</strong><br>
|
||||||
*
|
*
|
||||||
* @author Kai S. K. Engelbart
|
* @author Kai S. K. Engelbart
|
||||||
|
* @since Envoy v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public class UserListRenderer extends JLabel implements ListCellRenderer<User> {
|
public class UserListRenderer extends JLabel implements ListCellRenderer<User> {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user