Add more Javadocs

MYC-Refactor
Hammy 3 years ago
parent 3a552cacf2
commit 792eda1c53

@ -5,26 +5,48 @@ import java.awt.Toolkit;
import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.Clipboard;
import java.io.File; import java.io.File;
import java.util.List; import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
abstract class ClipboardListener { abstract class ClipboardListener {
final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); final Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
final Logger logger = LoggerFactory.getLogger(getClass());
private EventManager eventManager = new EventManager(); private EventManager eventManager = new EventManager();
private boolean imageMonitored = true; private boolean imageMonitored = true;
private boolean textMonitored = true; private boolean textMonitored = true;
private boolean fileMonitored = true; private boolean fileMonitored = true;
/** /**
* Main entry point of execution for both {@link MacClipboardListener} and {@link WindowsOrUnixClipboardListener} * Main entry point of execution for the correct {@link ClipboardListener}
* *
* @see MacClipboardListener * @see WindowsOrUnixClipboardListener#execute()
* @see WindowsOrUnixClipboardListener * @see MacClipboardListener#execute()
*/ */
abstract void execute(); abstract void execute();
/**
* Allows the correct {@link ClipboardListener} to start listening for clipboard changes
*
* @see WindowsOrUnixClipboardListener#startListening()
* @see MacClipboardListener#startListening()
*/
abstract void startListening(); abstract void startListening();
/**
* Stops the correct {@link ClipboardListener} to stop listening for clipboard changes
*
* @see WindowsOrUnixClipboardListener#stopListening()
* @see MacClipboardListener#stopListening()
*/
abstract void stopListening(); abstract void stopListening();
/**
* Insert the given {@link String} into the system clipboard
*
* @param stringContent The given {@link String} to insert
* @see WindowsOrUnixClipboardListener#insert(String)
* @see MacClipboardListener#insert(String)
*/
abstract void insert(String stringContent); abstract void insert(String stringContent);
abstract void insert(Image imageContent); abstract void insert(Image imageContent);

@ -46,10 +46,22 @@ public class MyClipboard {
return new MyClipboard(clipboardListener); return new MyClipboard(clipboardListener);
} }
/**
* Allows the correct {@link ClipboardListener} to start listening for clipboard changes
*
* @see WindowsOrUnixClipboardListener#startListening()
* @see MacClipboardListener#startListening()
*/
public void startListening() { public void startListening() {
clipboardListener.startListening(); clipboardListener.startListening();
} }
/**
* Stops the correct {@link ClipboardListener} to stop listening for clipboard changes
*
* @see WindowsOrUnixClipboardListener#stopListening()
* @see MacClipboardListener#stopListening()
*/
public void stopListening() { public void stopListening() {
clipboardListener.stopListening(); clipboardListener.stopListening();
} }

Loading…
Cancel
Save