There is a new update to BSF4ooRexx850, dated 850.20230621, which is expected to be complete and stable. So if you encounter any problems or bugs, then please supply an example program to show the problem and register it with the BSF4ooRexx bug tracker at <https://sourceforge.net/p/bsf4oorexx/bugs/>.  Note, there is a new category "JDOR (Java2D for ooRexx)" in case you find a bug in the "Java2D for ooRexx" Rexx command handler.

A few hints regarding this version that you can get from <https://sourceforge.net/projects/bsf4oorexx/files/beta/20221004/>:

 * JDOR (Java2D for ooRexx) is regarded to be completed and can be used in 
headless mode (without a
   GUI, i.e. the JDOR winShow command does not get used). The added support for 
java.awt.geom.Area
   allows for constructive area geometry (CAG) operations. The documentation 
for JDOR can be found
   in "BSF4ooRexx850/information/jdor/ jdor_doc.html" (temporarily you may look 
up that
   documentation directly from 
<https://wi.wu.ac.at/rgf/rexx/misc/jdor_doc.tmp/jdor_doc.html>).

 * There is a new class BSF.Clipboard that allows to exchange strings and 
images with the system
   clipboard using the Java infrastructure for it. As strings may be encoded in 
different codepages
   there is a codepage option in setString() and getString() that indicates the 
codepage encoding.
   Consult the new samples (look-up the brief descritpions by viewing
   BSF4ooRexx850/samples/index.html).

 * There is a new environment entry ".dev.null" which returns a "null device" 
stream object that
   can be used in redirection cases. E.g. using the curl command the result 
will be returned via
   stdin, however curl may write status information to stderr. If you want to 
inhibit the stderr
   output you can use .dev.null as the redirection target, e.g.:

   -- note: curl returns the result as an UTF-8 encoded string to stdout 
command="curl
   https://wttr.in/Vienna?format=%l:+%t+%w"; say "command to run :" pp(command) say 
".dev.null :"
   pp(.dev.null) say "about to run statement:" pp(sourceline(.line+1)) 
outArr=.array~new -- array
   for collecting curl's output to stdout ADDRESS SYSTEM command WITH OUTPUT 
USING (outArr) ERROR
   USING (.dev.null) curlResult=outArr~makeString -- turn array into a string SAY 
"result of curl
   command:" pp(curlResult) SAY "copying curl's returned UTF-8 string to the 
clipboard for others
   to use ..." .bsf.Clipboard~setString(curlResult,"UTF-8") -- string is UTF-8 
encoded ::requires
   "BSF.CLS" -- get bidirectional ooRexx-Java bridge

   Possible output:

   command to run : [curl https://wttr.in/Vienna?format=%l:+%t+%w] .dev.null : 
[The NullDevice]
   about to run statement: [outArr=.array~new -- array for collecting curl's 
output to stdout]
   result of curl command: [Vienna: +23°C ↓17km/h] copying curl's returned 
UTF-8 string to the
   clipboard for others to use ...

 * Ad edited/new samples to check out:

     o all samples that include the string "JDOR" allow for a trailing argument 
? (question mark)
       which will cause to display the processed JDOR commands in canonical 
form on stdout,

     o Clipboard related samples, demonstrating exchange of strings encoded in 
various codepages,
       strings with Unicode characters that do not exist in 8-bit codepages and 
images:
         +

           1-230_show_clipBoard.rxj

         +

           1-240_Clipboard.rxj

         +

           1-250_JDOR_to_clipboard.rxj ... called by the following programs

         +

           1-250_swriter_bsf_clipboard.rxj ... OpenOffice/LibreOffice, all 
platforms

         +

           1-250_windows_swriter_ole_clipboard.rxj ... OpenOffice/LibreOffice: 
Windows only

         +

           1-250_windows_word_ole_clipboard.rxj ... MS Word: Windows only

At this time BSF4ooRexx850 is regarded to be feature complete. There are no known bugs such that this version may be released as "general available" in the near future.

---rony


On 12.06.2023 17:14, Rony G. Flatscher wrote:

There is another mostly JDOR-related update of BSF4ooRexx850 available in form of the installation zip-archive at <https://sourceforge.net/projects/bsf4oorexx/files/beta/20221004/> (... cut ...).

It adds among other things the JDOR commands "clipboardGet", "clipboardSet" and "clipboardSetWithoutAlpha" to copy and paste images to/from the system clipboard. The documentation can be found at "BSF4ooRexx850 -> Information ", go into "jdor" and load "jdor_doc.html".

---

Also, BSF.CLS has a new ooRexx class named "BSF.Clipboard" that allows one to copy/paste images and strings to/from the system clipboard. Here a brief synopsis of its class methods:

  * isEmpty: returns .true if empty, .false else
  * clear: clears the clipboard
  * getDataFlavors: returns an array of DataFlavor objects each representing 
the type of data in
    the clipboard; send it the "toString" message to get a legible 
representation
  * setString: sets the clipboard to the supplied string (note, you can set 
even Unicode from Rexx
    using the Java string object reference returned by the routine
    bsf.utf8stringAsJSO(rexx_string_of_utf8chars))
  * getString: returns the string from the system clipboard rendered to the 
session's codepage; if
    you want to receive a specific encoding then supply as argument the 
codepage name, e.g.
    "UTF-8", "CP-437" (US codepage), "CP-850" (Western Europe) etc.
  * setImage: sets the clipboard to the supplied image (e.g. from JDOR)
  * setImageWithoutAlpha: makes sure that the image has no alpha (translucency) 
that gets set to
    the clipboard
  * getImage: returns the image from the clipboard

---

Here a sample Rexx program that uses OLE to create a Word document, types some text, then defines a Rexx string with UTF-8 encoded characters, types them via OLE, then creates a Java string object from it and uses that to store the string in the system clipboard, then pastes the content via OLE into Word, followed by a sequence of JDOR commands to create an image that is copied to the system clipboard and then gets pasted via OLE into the Word document. A PDF rendering of the generated Word document is enclosed, here is the code for producing that particular Word document with the new version of BSF4ooRexx850:

... cut ...

See the new samples (BSF4ooRexx850/samples/index.html).

Enclosed please find the created Word and its PDF rendering.

---rony


On 08.06.2023 20:19, Rony Flatscher wrote:
Dear fellow members,

since a few minutes there is a new installation zip-archive named "BSF4ooRexx_install_v850-20230608-beta.zip" uploaded to <https://sourceforge.net/projects/bsf4oorexx/files/beta/20221004/> representing a new beta.

The major work in this version was in JDOR ("Java2D for ooRexx") which allows any Rexx programmer to create any kind of Java2D graphics using simple Rexx commands. This version concludes the JDOR work (other than bug fixes) which is regarded to be complete by now. To check out some of the latest features you may want to run the samples located in "BSF4ooRexx850/samples" and named "1-190_JDOR_shapes.rxj", "1-210_JDOR_area_cag.rxj" and "1-220_JDOR_area_cag.rxj" (for further information look-up the comment at the top of each program with links to the respective tutorials on Java2D).

For those unsure whether JDOR is something that you might want to look into, you may want to look up this short video about JDOR that I had to create for a different task lately: <https://zenodo.org/record/8003114>; and of course, all the "BSF4ooRexx850/samples" that contain the name "JDOR" (if you open "BSF4ooRexx850/samples/index.html" then you will get has brief descriptions of all of the BSF4ooRexx samples in that directory).

Also, a brief introduction to JDOR was given at the 2022 International Rexx symposium such that you may want to check out in the printed proceedings for that conference (e.g. via Amazon) or you may want to go to the RexxLA symposium page for 2022 and there into the schedule and look for "JDOR" to get at the slides.

Any feedback on JDOR welcome!

---rony
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to