Class Datagram

  • All Implemented Interfaces:
    java.awt.datatransfer.ClipboardOwner, java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable

    public class Datagram
    extends TypedAtomicActor
    implements java.awt.datatransfer.ClipboardOwner
    This actor copies, to the system clipboard, the contents of any token received at its input port. It pastes, from the system clipboard to the output port, whenever it receives a token at the trigger. If both inputs receive tokens during the same firing, the paste is done before the copy. This ordering insures that the contents of the clipboard are not lost in the event of a simultaneous copy-paste operation.

    NOTE: This actor has been tested only with an 8-bit character set as the Java default character set. Results are not known for systems configured for 16-bit Unicode characters.

    Since:
    Ptolemy II 2.0
    Version:
    $Id$
    Author:
    Winthrop Williams
    Pt.AcceptedRating:
    Red (winthrop)
    Pt.ProposedRating:
    Red (winthrop)
    • Field Detail

      • input

        public TypedIOPort input
        Input port, which has type StringToken.
      • trigger

        public TypedIOPort trigger
        Input port, which has type Token.
      • output

        public TypedIOPort output
        Output port, which has type StringToken.
    • Method Detail

      • lostOwnership

        public void lostOwnership​(java.awt.datatransfer.Clipboard clipboard,
                                  java.awt.datatransfer.Transferable contents)
        Comply with the ClipboardOwner interface. It requires a method exist named lostOwnership. Specifically, when setContents() or getContents() is called, the last argument, known as the "requestor", must be an object which offers this lostOwnership() method.
        Specified by:
        lostOwnership in interface java.awt.datatransfer.ClipboardOwner