Package smsqmulator

Class ClipboardXfer

java.lang.Object
smsqmulator.ClipboardXfer
All Implemented Interfaces:
ClipboardOwner

public class ClipboardXfer extends Object implements ClipboardOwner
An object accessing the system clipboard for transfer to/from it. This is NOT thread safe. This can work in two different modes : Either the calls to get and set the clipboard contents are initiated under SMSQ/E by the direct "JVA_SGET" and "JVA_SPUT" commands. Or: an SMSQE job constantly monitors the scrap and sets any new content here (and then into the clipboard) and a java thread monitors the clipboard and copies any new content into this object, from where the SMSQE job will read it and put it in the scrap.
  • Constructor Details

    • ClipboardXfer

      public ClipboardXfer()
  • Method Details

    • lostOwnership

      public void lostOwnership(Clipboard clipboard, Transferable contents)
      Not needed here.
      Specified by:
      lostOwnership in interface ClipboardOwner
    • setClipboardContents

      public void setClipboardContents(String toSet)
      Puts a string into the clipboard with me as owner.
      Parameters:
      toSet - the String to put into the clipboard.
    • getClipboardContents

      public final String getClipboardContents()
      Gets the string from the clipboard.
      Returns:
      any string in the Clipboard; empty String (not NULL!!!) if none.
    • transferClipboardContentsToScrap

      public void transferClipboardContentsToScrap(MC68000Cpu cpu)
      Transfers a max of 32000 chars from the clipboard to the area pointed to by A1.
      Parameters:
      cpu - the cpu (memory) to transfer to.
    • transferScrapToClipboard

      public void transferScrapToClipboard(MC68000Cpu cpu)
      Transfers chars from the area pointed to by A1 to the clipboard.
      Parameters:
      cpu - the cpu (memory) to transfer to.
    • setNewContent

      public final void setNewContent(String s)
      Sets the new content and increases the change counter when content has changed.
      Parameters:
      s - the new content.
    • getChangeCounter

      public final void getChangeCounter(MC68000Cpu cpu)
      Checks whether the clipboard content has changed. If yes, D0 is set to the length of the data, else it is set to 0. If length of data were is bigger than 32000, it is limited to 32000.
      Parameters:
      cpu - the cpu used to query this. (on entry here, D1 = smsqe stored clipboard counter).
    • startMonitoring

      public void startMonitoring()
      Syncscrap job is activated, start monitoring the clipbord.
    • stopMonitoring

      public void stopMonitoring()
      Syncscrap job is stopped, stop monitoring the clipboard.
    • isMonitoring

      public boolean isMonitoring()
      Are we still monitoring?
      Returns:
      true if monitor thread is still present and alive, else false.