/*
 * @(#)Clipboard.java 5.1
 *
 */

package CH.ifa.draw.util;


/**
 * A temporary replacement for a global clipboard.
 * It is a singleton that can be used to store and
 * get the contents of the clipboard.
 *
 */
public class Clipboard {
    static Clipboard _clipboard = new Clipboard();
    private Object _contents;

    private Clipboard() {}

    /**
     * Gets the clipboard.
     *
     * @return the current clipboard instance
     */
    static public Clipboard getClipboard() {
        return _clipboard;
    }

    /**
     * Sets the contents of the clipboard.
     *
     * @param contents the <code>object</code>, which will be saved in the clipboard
     */
    public void setContents(Object contents) {
        _contents = contents;
    }

    /**
     * Gets the contents of the clipboard.
     *
     * @return the current object saved in the clipboard
     */
    public Object getContents() {
        return _contents;
    }
}