Package smsqmulator
Class ClipboardXfer
java.lang.Object
smsqmulator.ClipboardXfer
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
Checks whether the clipboard content has changed.final String
Gets the string from the clipboard.boolean
Are we still monitoring?void
lostOwnership
(Clipboard clipboard, Transferable contents) Not needed here.void
setClipboardContents
(String toSet) Puts a string into the clipboard with me as owner.final void
Sets the new content and increases the change counter when content has changed.void
Syncscrap job is activated, start monitoring the clipbord.void
Syncscrap job is stopped, stop monitoring the clipboard.void
Transfers a max of 32000 chars from the clipboard to the area pointed to by A1.void
Transfers chars from the area pointed to by A1 to the clipboard.
-
Constructor Details
-
ClipboardXfer
public ClipboardXfer()
-
-
Method Details
-
lostOwnership
Not needed here.- Specified by:
lostOwnership
in interfaceClipboardOwner
-
setClipboardContents
Puts a string into the clipboard with me as owner.- Parameters:
toSet
- the String to put into the clipboard.
-
getClipboardContents
Gets the string from the clipboard.- Returns:
- any string in the Clipboard; empty String (not NULL!!!) if none.
-
transferClipboardContentsToScrap
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
Transfers chars from the area pointed to by A1 to the clipboard.- Parameters:
cpu
- the cpu (memory) to transfer to.
-
setNewContent
Sets the new content and increases the change counter when content has changed.- Parameters:
s
- the new content.
-
getChangeCounter
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.
-