Purpose of JDORFX (JavaFX Drawing for ooRexx)

JDORFX (JavaFX drawing for ooRexx) is a Rexx command handler implemented in Java using BSF4ooRexx850. It makes JavaFX immediate-mode 2D drawing and retained scene-graph functionality, including 3D shapes, cameras, lights, materials, images, and animation, available through Rexx commands.

Example "jdorfx_synopsis_sample.rxj":

#!/usr/bin/env rexx

call addJdorFXHandler

useRedirection? = .false
if useRedirection? then
    address jdorfx with output using (.stdout) error using (.stderr)
else
    address jdorfx

width = 640
height = 360
newImage width height
winTitle "JDORFX Synopsis"

-- Draw two lines forming a big X
drawLine (width - 1) (height - 1)
color red
moveTo (width - 1) 0
position
say "--> rc="pp(rc)
drawLine 0 (height - 1)

len = 50
moveTo (width - len) / 2 (height - len) / 2
color green
fillRect len len
stroke str3 3
color blue
drawRect len len

color somePurple 0.498 0.180 0.435 1.0
color
say "--> rc="pp(rc)
say "    rc~toString:" pp(rc~toString)
moveTo 218 320
drawString "Hello, Rexx world ... from JDORFX"

-- Static JavaFX 3D scene-graph objects
shape3d ball sphere 130 110 0 45
shape3d cube box 320 105 0 80 80 80
shape3d column cylinder 510 110 0 35 100
rotate3dshape cube 25 320 105 0 0 1 0
rotate3dshape cube (-15) 320 105 0 1 0 0
fill3dshape ball
fill3dshape cube
fill3dshape column
material ballMaterial orange
material cubeMaterial mediumseagreen
material columnMaterial cornflowerblue
setMaterial ball ballMaterial
setMaterial cube cubeMaterial
setMaterial column columnMaterial

winShow
say "Press Enter to close."
if useRedirection? then
    sleep 5
else
    pull .
winClose

::requires "../bin/jdorfx.cls"

The program prints output like the following (the Java object identity may vary):

--> rc=[639 0]
--> rc=[javafx.scene.paint.Color@4501b7af]
    rc~toString: [0x7f2e6fff]

It displays this JavaFX window:

JDORFX synopsis window with immediate-mode 2D drawing and retained 3D shapes


Brief Overview

The JDORFX Rexx command handler exposes two complementary JavaFX drawing models:

JDORFX preserves much of the command interface of JDOR, but implements it with JavaFX rather than Java AWT/Java2D. One compatibility convention is the current position: moveTo x y stores a position in the handler, and immediate-mode commands such as drawRect width height and drawString text draw from that stored position. Their command signatures therefore omit the leading x and y parameters found in the corresponding JavaFX GraphicsContext methods.

The principal differences from JDOR are the JavaFX object types and rendering model. JDOR draws through Java2D and uses AWT objects such as Graphics2D, Color, and BufferedImage. JDORFX draws its immediate-mode content through JavaFX Canvas and GraphicsContext, and adds retained nodes, 3D, cameras, lights, Phong materials, and JavaFX animation. Image-query and clipboard commands convert results to BufferedImage only where JDOR compatibility requires Java interoperation.

Hint: using the redirection option of the Rexx ADDRESS keyword instruction (i.e., its WITH subkeyword with the redirection definitions) has the following effects:

The ADDRESS keyword instruction is documented in the ooRexx reference book (rexxref.pdf) in "Chapter 2. Keyword Instructions", section "2.1 ADDRESS").

The following related material may be helpful:


Some Terms and their Informal Definition
 
Affine (JavaFX)
A JavaFX Affine combines movements, resizing, slanting, and rotation into one transform. The current transform changes where and how later Canvas drawing appears.
The commands translate, scale, shear append the respective operations to the current transform.
The transform command can query, set, register, retrieve, or reset the six values that describe the transform.
Animation cycle count and auto-reverse (JDORFX)
The cycle count says how many times an animation repeats; -1 means indefinitely. Auto-reverse makes every alternate cycle run from the end back toward the start.
Camera (JavaFX)
A JavaFX scene-graph Node that determines how 3D content is projected into the two-dimensional window. A ParallelCamera uses parallel projection; a PerspectiveCamera makes distant objects appear smaller. Creating a camera does not activate it; setCamera selects the active camera.
Canvas (JavaFX)
A JavaFX pixel-oriented drawing surface. JDORFX sends ordinary 2D drawing commands to the Canvas through its GraphicsContext. Once such a command is drawn, it is represented by pixels rather than by a separately addressable object.
Canvas/immediate-mode 2D coordinate system (JDORFX)
The two-dimensional coordinate system used by drawing commands operating on the JavaFX Canvas. Before transforms are applied, its origin (x=0, y=0) is at the upper-left corner. Increasing x moves to the right along the x-axis, and increasing y moves downward along the y-axis. Coordinates are JavaFX drawing-space values and need not denote integer pixel positions.
clip
The JDOR-compatible user clip shared by immediate Canvas operations and retained 2D rendering. The implemented clip command intersects a rectangle, clipShape intersects a named Shape, and clipRemove removes the complete user clip.
"comment command"
Sometimes it is desired to turn a command (maybe temporarily) into a comment, such that it does not get executed. JDORFX treats all commands as comments that start with any of the following characters: - (dash), ; (semi colon), / (slash), " (double quote), ' (single quote), . (dot), : (colon), ! (exclamation mark), ? (question mark), _ (underscore). Therefore it is sufficient to prefix a command with one of these characters in order to turn it into "comment command".
If the output is redirected comment commands will be passed on to it.
Culling / CullFace (JavaFX)
Culling avoids rendering selected faces of a JavaFX 3D shape. A CullFace value of NONE, BACK, or FRONT selects no culling, back-face culling, or front-face culling. Back-face culling is the JavaFX default.
currX, currY
currX and currY denote the current position of the starting (upper left hand) point used when clearing, drawing or filling. It can be set with the goto x y command (alias names for this command are location x y, moveTo x y, pos x y and position x y). JDORFX supplies currX and currY to immediate-mode JavaFX GraphicsContext operations whose command interface omits x and y.
dashArray
The command stroke allows for an argument dashArray that represents an array of float values. There are two possibilities to supply this array to the command:
Depth buffer (JavaFX)
Per-pixel depth information used to hide parts of 3D objects that lie behind nearer content. JDORFX enables it with the fourth newImage argument.
DrawMode (JavaFX)
The JavaFX Shape3D display choice: LINE draws a wireframe and FILL draws filled surfaces.
Effect (JavaFX)
A visual filter, such as a blur or shadow, applied while JavaFX renders content. A Canvas GraphicsContext can hold a current Effect that affects subsequent immediate-mode drawing.
GC
The JavaFX GraphicsContext that performs drawing on the current Canvas. It remembers settings such as the transform, fill, stroke, font, and line style for later drawing commands. The command GC allows for retrieving the current GC.
Group (JavaFX)
A JavaFX scene-graph Node used to contain other Nodes. JDORFX uses Groups to organize the Canvas, retained 2D renderings, 3D shapes, and lights.
image type
An image type is JDOR's setting for how a BufferedImage stores its pixels, including whether it supports transparency. A JavaFX Canvas does not offer this choice. JDORFX therefore remembers the requested JDOR type and uses it when it returns or saves a BufferedImage; the setting does not change how the Canvas itself draws.
Immediate-mode drawing (JDORFX)
Drawing that changes Canvas pixels immediately and does not retain a separate object for each command. To alter an immediate-mode drawing, a program normally clears or redraws pixels. This differs from the retained objects in the Scene Graph.
Interpolator (JavaFX)
The rule that determines how an animation progresses between its start and end values, for example LINEAR, DISCRETE, or an easing curve.
JavaFX Application Thread (JavaFX)
The part of JavaFX responsible for changing windows and Scene Graph objects. JDORFX arranges for affected commands to run there, so Rexx programs do not need to manage this thread themselves.
Light / AmbientLight / PointLight (JavaFX)
A JavaFX scene-graph Node that illuminates 3D shapes. An AmbientLight applies light uniformly and therefore has no meaningful source position. A PointLight radiates from a position and can be translated.
Map / texture map (JDORFX)
An image used by a Phong material to control surface appearance, such as diffuse colour, highlights, apparent bumps, or self-illumination. It is not a geographic map.
Material / PhongMaterial (JavaFX)
A JavaFX PhongMaterial describes the visible surface of a 3D Shape using diffuse and specular colours and optional texture maps. Creating a material does not assign it to a shape; setMaterial performs that selection.
Node (JavaFX)
The common base type for an addressable item in the JavaFX Scene Graph. Shapes, Groups, cameras, and lights are Nodes and can therefore carry transforms and many animation properties. Canvas drawing operations themselves do not create Nodes.
Paint, fill, and stroke
A JavaFX Paint supplies a colour or gradient. A Shape's fill paints its interior and its stroke paints its outline. Canvas keeps corresponding current fill and stroke state for later immediate-mode commands.
PathElement (JavaFX)
One retained segment of a JavaFX Path, such as a move, line, curve, or close operation. Together, a Path's elements describe its geometry.
pixel
A picture element in the Canvas raster. Its physical size depends on output scaling and display density; JDORFX does not assign it a fixed inch size.
Query, create, select, assign, and set
A query reads an existing current or registered value; it does not create a new object. A create form constructs and usually registers an object under a nickname. A select or setter form makes an existing object current, active, or associated with another object. These operations do not assign a Rexx variable merely because their command name begins with set. Rexx-variable assignment occurs through ordinary Rexx syntax, the optional variable argument of commands such as getState, or assignRC.
RC
The Rexx result variable that receives the value returned by the most recent command-handler call. Object-returning commands place the Java object in RC; .nil denotes the absence of an object. assignRC name copies the current RC value to a valid named Rexx variable and returns that identical value; consequently RC retains the same value.
Registry / nickname
JDORFX stores created objects in command-specific, case-insensitive registries. A nickname is the program-supplied name used to retrieve or select that object later; it is not itself a Rexx variable.
Retained-mode drawing / Scene Graph (JavaFX)
A JavaFX Scene holds a Scene Graph: a hierarchy of retained Nodes displayed by a window. Unlike Canvas pixels, a retained shape remains an object that JDORFX can later transform, animate, assign a material to, or otherwise modify. JDORFX combines this retained model with immediate-mode Canvas drawing.
RGB color
A color mix of the colors red, green, and blue, each defined as an intensity between the integer values 0 and 255 or alternatively as a float value between 0.0 (0.0%) and 1.0 (100.0%) representing the percentage of the intensity (e.g. 0.5 represents 50.0% intensity).
Note: if any of the supplied numbers includes the decimal dot then all the numbers are taken as float values.
RGBA color
A color mix of the colors red, green, blue, and alpha each defined as an intensity between the integer values 0 and 255 or alternatively as a float value between 0.0 (0.0%) and 1.0 (100.0%) representing the percentage of the intensity (e.g. 0.5 represents 50.0% intensity).
Note: if any of the supplied numbers includes the decimal dot then all the numbers are taken as float values.
Note: an alpha intensity of 0 means "complete transparency", and an intensity of 255 (or expressed as a float value of exactly 1.0) means "no transparency".
rotate
A positive or negative angle in degrees used by the rotate command. JDORFX appends the rotation to the current JavaFX GraphicsContext transform, around either the origin or the optionally supplied pivot point. JavaFX rotation expects the angle in degrees, so JDORFX performs no degree-to-radian conversion.
scale
A positive or negative value used to multiply the width and height values, cf. the command scale.
Shape / Shape3D (JavaFX)
A JavaFX Shape is a retained two-dimensional Node with fill and stroke properties. A JavaFX Shape3D is a retained three-dimensional Node with draw mode, culling, and material properties. The JDOR-compatible Area exception is an AWT geometry object rather than a Node; JDORFX converts it when a retained rendering is needed.
shear
A positive or negative value used to slant a drawing, also known as skewing, cf. the command shear.
Snapshot (JavaFX)
A pixel image captured from currently rendered JavaFX content. Taking a snapshot does not replace or modify the live Canvas or scene-graph objects from which it was captured.
Stage (JavaFX)
The JavaFX top-level window that displays a Scene. JDORFX window commands show, hide, size, position, or recreate this Stage without treating the Stage itself as drawing content.
Transition, Timeline, KeyFrame, and KeyValue (JavaFX)
A JavaFX Transition animates a predefined kind of change. A Timeline schedules KeyFrames at specified times, and each KeyFrame contains one or more KeyValues describing target property values.
translate
Moving the origin to a different position, such that the effective x and y coordinates get calculated relative to the new origin, cf. the command translate.
xPoints-array, yPoints-array
The commands drawPolygon, drawPolyline or fillPolygon expect two arrays for the x and y coordinates of the points, respectively. There are two possibilities to supply these arrays to the JDORFX command handler:


Synopsis of the JDORFX Rexx Commands

In general the arguments to a command are blank delimited. If supplying a Rexx variable, its referred to value will be supplied, if using a Rexx expression it will be evaluated and the resulting value will be supplied to the Rexx command handler.

If you wish to supply the name of a Rexx variable to a command (e.g. for the commands drawPolygon, drawPolyline, fillPolygon or getState) then make sure to enquote that variable name as otherwise its value gets supplied instead.

Commands need not be enquoted, unless their names collide with Rexx keyword names (which at the time of writing does not happen) or are used as Rexx variable names in your program.

Unquoted literals will be uppercased according to the Rexx rules and then supplied to the command handler. If commands or arguments are unquoted then they get uppercased as well and blanks between them will be reduced to a single blank according to the Rexx rules before supplying the resulting command with arguments to the Rexx command handler.

Hint: in general any command that allows for querying and setting a value will return the current value and in the case of setting it to a new value will return the old (previously current) value.

Compatibility classification: JDORFX implements all 100 canonical JDOR commands. Of these, 92 are classified as implemented, three as implemented with a documented platform limitation, and five as partial. No canonical JDOR command is missing.

XOR compatibility: setXorMode colorNickName and setPaintMode work for supported Canvas drawing. Drawing the same object twice in XOR mode restores the original pixels. An XOR drawShape or fillShape becomes Canvas pixels and cannot then be animated as a separate object. Results involving translucent pixels can differ from JDOR.

Command groups

The detailed entries below cover inherited JDOR commands, followed by JavaFX Shape and Path commands, 3D commands, and animation commands.

Inherited JDOR commands and JDORFX compatibility notes:

Each command entry below is based on its JDOR Synopsis definition and is adapted where JDORFX behavior differs. A following JDORFX Note: identifies verified JavaFX-specific behavior or a return-value clarification. Throughout this Synopsis, when several names are listed on separate lines in one Command cell, they are equally accepted synonyms for the same operation.

CommandArgument(s)Description
"areaAdd"
"areaUnion"
The constructive area geometry (CAG) "add" operation, cf. Constructing Complex Shapes from Geometry Primitives. The shapeNickName argument gets uppercased and used to look it up in the shape registry or if not found from a Rexx variable of the same name and uses that shape instead.
areaNickName shapeNickName areaNickName the registered area shape that will be changed by adding the area of the shapeNickName as the argument. If shapeNickName is not yet of type java.awt.geom.Area then an Area gets created from it and used as the argument.
"areaExclusiveOr"
"areaXor"
The constructive area geometry (CAG) "exclusiveOr" operation, cf. Constructing Complex Shapes from Geometry Primitives. The shapeNickName argument gets uppercased and used to look it up in the shape registry or if not found from a Rexx variable of the same name and uses that shape instead.
areaNickName shapeNickName areaNickName the registered area shape that will be changed by applying the exclusiveOr operation using the area of the shapeNickName as the argument. If shapeNickName is not yet of type java.awt.geom.Area then an Area gets created from it and used as the argument.
"areaIntersect" The constructive area geometry (CAG) "intersect" operation, cf. Constructing Complex Shapes from Geometry Primitives. The shapeNickName argument gets uppercased and used to look it up in the shape registry or if not found from a Rexx variable of the same name and uses that shape instead.
areaNickName shapeNickName areaNickName the registered area shape that will be changed by applying the intersect operation using the area of the shapeNickName as argument. If shapeNickName is not yet of type java.awt.geom.Area then an Area gets created from it and used as the argument.
"areaSubtract" The constructive area geometry (CAG) "subtract" operation, cf. Constructing Complex Shapes from Geometry Primitives. The shapeNickName argument gets uppercased and used to look it up in the shape registry or if not found from a Rexx variable of the same name and uses that shape instead.
areaNickName shapeNickName areaNickName the registered area shape that will be changed by applying the subtract operation using the area of the shapeNickName as argument. If shapeNickName is not yet of type java.awt.geom.Area then an Area gets created from it and used as the argument.
"areaTransform" Transforms the area shape. The transformNickName argument gets uppercased and used to look it up in the transform registry or if not found from a Rexx variable of the same name and uses that transform (an AffinityTransform) instead.
areaNickName transformNickName Transforms the area shape stored under the areaNickName and applies the transform stored under the transformNickName to it.
"assignRC" Allows to assign the current value of the Rexx variable RC (set when a command returns a value) to a Rexx variable with the supplied name.
This allows for creating self contained macros (redirecting the output will protocol the commands which can later be used for replaying those commands) that need to refer to returned values later.
Note: supplying Rexx variable names to commands will supply the value the Rexx variable points to. Therefore it is advised to enquote such commands, at least the Rexx variable name argument.
JDORFX Note: Copies the current RC value to a valid named Rexx variable and returns that identical value; consequently RC retains the same value.
rexxVariableName The name of a Rexx variable which gets the current value of the Rexx variable RC assigned to for later use.
"background" Queries and optionally sets the background color to a registered color.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new color value will return the old (previously set) value via the Rexx variable RC.
Cf. the Java documentation for the Java class Graphics[2D] and the methods: getBackground(), setBackground(...).
JDORFX Note: A query returns the current clearing background; a setter returns the previous one. The setter also changes the visible Scene background behind 2D and 3D content, but does not repaint pixels already drawn on the Canvas. Registered colours, AWT or JavaFX Color objects in Rexx variables, and JavaFX/CSS colour names are accepted. newImage starts with a black clearing background and a white Scene background; reset preserves both.
colorNickName The name of a registered color (cf. color command) or the name of a Rexx variable referring to a color to which the background color should be set to.
"clearRect" Clears a rectangle of the supplied width and height at the current x and y position (cf. goto command), using the background (cf. background command) color.
Cf. the Java documentation for the Java class Graphics[2D] and the method clearRect(...).
JDORFX Note: Clears the requested area with the current background and returns no result in RC. The current transform and clip apply. Existing retained 2D Shapes are first merged into the Canvas; when retained Shapes and Canvas drawing have been mixed, their earlier drawing order cannot always be reproduced exactly.
width height width and height in pixels of the rectangle.
"clip" Queries and optionally sets a clipping area of an image. Returns a blank delimited string with the x, y, width and height values of the previously defined clipping rectangle (area) or .nil if no such area was defined via the Rexx variable RC. If a clipping area exists already, then the intersection with it will be the new clipping area.
Cf. the Java documentation for the Java class Graphics[2D] and the methods getClipBounds(), clipRect(...).
x y width height x position on the x-axis, the y position on the y-axis, the width and the height in pixels of the rectangle.
"clipRemove" Removes clip from image, if any defined.
Cf. the Java documentation for the Java class Graphics[2D] and the method setClip(null).
(no arguments)No arguments.
"color"
"colour"
Query, get and set, define and set the color.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
Supplying only the colorNickName argument will load the color from the internal register or from a Rexx variable by that name referring to a color and assign it to the GC to be used for drawing from now on.
Supplying in addition intensity (cf. RGB color or RGBA color) for the colors red, green, blue, and optionally alpha, a java.awt.Color of that type gets created, registered with the supplied colorNickName and then used for setting the new color.
The command name colour is an alias, a synonym for this command.
Cf. the Java documentation for the Java class Graphics[2D] and the methods getColor(), setColor(...), as well as the Java class java.awt.Color.
JDORFX Note: This is the common fill and stroke colour. A query returns the current JavaFX Color; selecting or defining a colour returns the previous one. Decimal RGB/RGBA values use the range 0.0 to 1.0; integer values use 0 to 255. In addition to registered colours and JavaFX Color objects in Rexx variables, JDORFX accepts case-insensitive JavaFX/HTML/CSS names such as ALICEBLUE, hexadecimal colours, and JavaFX web-colour functions. The inherited names GREEN, ORANGE, PINK, DARK_GRAY, and LIGHT_GRAY retain their JDOR/AWT colours; JavaFX spellings such as DARKGRAY remain available.
colorNickName colorNickName gets uppercased and is used to look up the internal color registry for the denoted color or the name of a Rexx variable referring to a color which should be used from now on. The previously defined color gets returned via the Rexx variable RC. The following color names get predefined and can be directly used (cf. the constants defined for javafx.scene.paint.Color which show the color they represent, in addition cf. W3schools HTML color names):
AliceBlue, AntiqueWhite, Aqua, Aquamarine, Azure, Beige, Bisque, Black, BlanchedAlmond, Blue, BlueViolet, Brown, BurlyWood, CadetBlue, Chartreuse, Chocolate, Coral, CornflowerBlue, Cornsilk, Crimson, Cyan, DarkBlue, DarkCyan, DarkGoldenRod, Dark_Gray, DarkGray, DarkGrey, DarkGreen, DarkKhaki, DarkMagenta, DarkOliveGreen, DarkOrange, DarkOrchid, DarkRed, DarkSalmon, DarkSeaGreen, DarkSlateBlue, DarkSlateGray, DarkSlateGrey, DarkTurquoise, DarkViolet, DeepPink, DeepSkyBlue, DimGray, DimGrey, DodgerBlue, FireBrick, FloralWhite, ForestGreen, Fuchsia, Gainsboro, GhostWhite, Gold, GoldenRod, Gray, Grey, Green, GreenYellow, HoneyDew, HotPink, IndianRed, Indigo, Ivory, Khaki, Lavender, LavenderBlush, LawnGreen, LemonChiffon, LightBlue, LightCoral, LightCyan, LightGoldenRodYellow, Light_Gray, LightGray, LightGrey, LightGreen, LightPink, LightSalmon, LightSeaGreen, LightSkyBlue, LightSlateGray, LightSlateGrey, LightSteelBlue, LightYellow, Lime, LimeGreen, Linen, Magenta, Maroon, MediumAquaMarine, MediumBlue, MediumOrchid, MediumPurple, MediumSeaGreen, MediumSlateBlue, MediumSpringGreen, MediumTurquoise, MediumVioletRed, MidnightBlue, MintCream, MistyRose, Moccasin, NavajoWhite, Navy, OldLace, Olive, OliveDrab, Orange, OrangeRed, Orchid, PaleGoldenRod, PaleGreen, PaleTurquoise, PaleVioletRed, PapayaWhip, PeachPuff, Peru, Pink, Plum, PowderBlue, Purple, RebeccaPurple, Red, RosyBrown, RoyalBlue, SaddleBrown, Salmon, SandyBrown, SeaGreen, SeaShell, Sienna, Silver, SkyBlue, SlateBlue, SlateGray, SlateGrey, Snow, SpringGreen, SteelBlue, Tan, Teal, Thistle, Tomato, Transparent, Turquoise, Violet, Wheat, White, WhiteSmoke, Yellow, YellowGreen
colorNickName r g b [alpha] This command creates a color using the supplied intensities (cf. RGB color or RGBA color) for each of the colors red, green, blue and optionally for alpha. This color will be used from now on and gets stored in the color registry using the supplied colorNickName in uppercase. The previously defined color gets returned via the Rexx variable RC.
"composite" Queries and optionally sets or creates the composite value (an instance of the Java class java.awt.AlphaComposite).
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
Cf. the Java documentation for the Java class Graphics[2D] and the methods getComposite(), setComposite(...), and the Java class java.awt.AlphaComposite with its constant fields and the method getInstance(...).
JDORFX Note: A query returns the current JDOR-compatible java.awt.AlphaComposite; a setter returns the previous one. All rules listed below work for Canvas drawing. With SRC_OVER or SRC_ATOP, drawShape and fillShape remain separate objects that can be animated. Other rules turn that particular rendering into Canvas pixels, so it cannot be animated separately.
rule [alpha] rule: is a number or a constant name, i.e. one of CLEAR (1), DST (9), DST_ATOP (11), DST_IN (6), DST_OUT (8), DST_OVER (4), SRC (2), SRC_ATOP (10), SRC_IN (5), SRC_OUT (7), SRC_OVER (3), XOR (12).
alpha: is an optional value between 0.0 and 1.0.
"copyArea" Copies an area of the image to the given distance.
Cf. the Java documentation for the Java class Graphics and the method copyArea(...).
JDORFX Note: Copies the area at the current position by dX and dY and returns no result in RC. Translation and positive scaling are supported. Rotation, shear, negative scaling, or another general transform fails with RC=-102, as it does in JDOR's Java2D implementation. Retained 2D Shapes are merged into the Canvas first, so an earlier mixture of Shape and Canvas drawing may not retain its exact drawing order.
width height dX dY width and height in pixels of the image area to copy, dX (can be negative) and dY (can be negative) the distance in pixels where to copy to.
"draw3DRect" Draws a rectangle with 3D appearance (raised or sunken).
Cf. the Java documentation for the Java class Graphics[2D] and the method draw3DRect(...).
width height raised width and height in pixels of the rectangle, raised needs to be either set to .true for raised or to .false for sunken appearance.
"drawArc" Draws an arc which is part of the oval inscribed in a rectangle.
Cf. the Java documentation for the Java class Graphics[2D] and the method drawArc(...).
JDORFX Note: Strokes a JavaFX OPEN arc at the current position.
width height startAngle arcAngle width and height in pixels of the rectangle, startAngle in degrees (0 is the 3 o'clock position), arcAngle angular extend in degrees relative to startAngle (angles increase counterclockwise).
"drawImage" Draws an image which got previously loaded from the filesystem with the command loadImage and stored internally with an imageNickName in the internal image registry, or an image that got pushed with a imageNickName in the command pushImage, or stored in a Rexx variable.
Cf. the Java documentation for the Java class Graphics[2D] and the method drawImage(...).
JDORFX Note: Draws a registered or Rexx-variable image at the current position. Successful execution has no result in RC.
imageNickName [bkgColor] imageNickName denotes the name of an image stored in the internal image registry or the name of a Rexx variable referring to an image. Draws as much of the image as possible.
Optional bkgColor is the colorNickName of a previously stored color.
imageNickName width height [bkgColor] imageNickName denotes the name of an image stored in the internal image registry or the name of a Rexx variable referring to an image. Draws as much of the image as possible scaled to the width and height in pixels.
Optional bkgColor is the colorNickName of a previously stored color.
imageNickName width height srcX1 srcY1 srcX2 srcY2 [bkgColor] imageNickName denotes the name of an image stored in the internal image registry or the name of a Rexx variable referring to an image. Draws as much of the image as possible scaled to the width and height in pixels, using from the image the rectangle with the first corner with the coordinate srcX1 and srcY1 and the second corner with the coordinate srcX2 and srcY2.
Optional bkgColor is the colorNickName of a previously stored color.
"drawLine" Draws a line.
Cf. the Java documentation for the Java class Graphics[2D] and the method drawLine(...).
JDORFX Note: Strokes from the current position to the target without changing the current position. RC has no result.
toX toY toX and toY, denoting the endpoint of the line (starting from currX and currY).
"drawOval" Draws an oval.
Cf. the Java documentation for the Java class Graphics[2D] and the method drawOval().
JDORFX Note: Strokes an oval in the current-position bounding box.
width height Draws an oval in a rectangle of width and height pixels. If width and height are of the same length the oval will be a circle.
"drawPolygon" Draws a polygon using nPoints coordinates from xPoints-array and yPoints-array. The polygon gets closed by drawing a line from the first and last point.
Cf. the Java documentation for the Java class Graphics[2D] and the method drawPolygon(...).
JDORFX Note: Strokes a closed polygon using exactly the first nPoints pairs. Trailing array elements are ignored. Arrays use the representations described for drawPolyline.
xPoints-array yPoints-array nPoints Draws a polygon consisting of nPoints taken from the xPoints-array and yPoints-array. If the endpoint is not the same coordinate as the first point, the polygon gets closed by drawing a line from the first to the last point.
"drawPolyline" Draws a polyline using nPoints coordinates from xPoints-array and yPoints-array.
Cf. the Java documentation for the Java class Graphics[2D] and the method drawPolyline(...).
JDORFX Note: Strokes the first nPoints connected segments without closing the final point to the first. Point lists may be inline parenthesized integer arrays such as (1,2,3) or named Rexx Java int[] variables.
xPoints-array yPoints-array nPoints Draws a polyline consisting of nPoints taken from xPoints-array and yPoints-array.
"drawRect" Draws a rectangle of width and height.
Cf. the Java documentation for the Java class Graphics[2D] and the method drawRect(...).
JDORFX Note: Strokes a rectangle at the current position.
width height Draws a rectangle of width and height pixels. If width and height are of the same length the rectangle will be a square.
"drawRoundRect" Draws a round rectangle of width and height pixels. The corners get rounded according to arcWidth and arcHeight pixels.
Cf. the Java documentation for the Java class Graphics[2D] and the method drawRoundRect(...).
JDORFX Note: Strokes a rounded rectangle at the current position.
width height arcWidth arcHeight Draws an oval in a rectangle of width and height pixels where the corners are rounded using arcWidth and arcHeight pixels. If width, height, arcWidth and arcHeight are of the same length the round rectangle will be in effect a circle.
"drawString" Draws a string (text).
Note: In order to preserve leading blanks in a string, only the first (delimiting) blank after the command drawString will be consumed, all following characters - including leading whitespace - are regarded to constitute the string to be drawn.
Hint: if you have a need to know the bounds (a rectangle) of the string using the current font and the current graphics context you may want to use the command stringBounds.
Cf. the Java documentation for the Java class Graphics[2D] and the method drawString(...).
JDORFX Note: Draws the complete remaining text at the current position. RC has no result.
string string (text) that gets drawn.
"fill3DRect" Fills a rectangle with 3D appearance (raised or sunken).
Cf. the Java documentation for the Java class Graphics[2D] and the method fill3DRect(...).
width height raised width and height in pixels of the rectangle, raised is either set to .true for raised or to .false for sunken appearance.
"fillArc" Fills an arc which is part of the oval inscribed in a rectangle.
Cf. the Java documentation for the Java class Graphics[2D] and the method fillArc(...).
JDORFX Note: Fills a JavaFX ROUND arc at the current position.
width height startAngle arcAngle width and height in pixels of the rectangle, startAngle in degrees (0 is the 3 o'clock position), arcAngle angular extent in degrees relative to startAngle (angles increase counterclockwise).
"fillOval" Fills an oval.
Cf. the Java documentation for the Java class Graphics[2D] and the method fillOval().
JDORFX Note: Fills an oval in the current-position bounding box.
width height Fills an oval in a rectangle of width and height pixels. If width and height are of the same length the oval will be a circle.
"fillPolygon" Fills a polygon using nPoints coordinates from xPoints-array and yPoints-array.
Note: The definition list above documents how these arrays can be supplied to the command handler.
Cf. the Java documentation for the Java class Graphics[2D] and the method fillPolygon(...).
JDORFX Note: Fills a closed polygon using exactly the first nPoints pairs. Trailing array elements are ignored. Arrays use the representations described for drawPolyline.
xPoints-array yPoints-array nPoints Fills a polygon consisting of nPoints taken from the xPoints-array and yPoints-array. If the endpoint is not the same coordinate as the first point, the polygon gets closed by filling a line from the first to the last point.
"fillRect" Fills a rectangle of width and height.
Cf. the Java documentation for the Java class Graphics[2D] and the method fillRect(...).
JDORFX Note: Fills a rectangle at the current position.
width height Fills a rectangle of width and height pixels. If width and height are of the same length the rectangle will be a square.
"fillRoundRect" Fills a round rectangle of width and height pixels. The corners get rounded according to arcWidth and arcHeight pixels.
Cf. the Java documentation for the Java class Graphics[2D] and the method fillRoundRect(...).
JDORFX Note: Fills a rounded rectangle at the current position.
width height arcWidth arcHeight Fills an oval in a rectangle of width and height pixels where the corners are rounded using arcWidth and arcHeight pixels. If width, height, arcWidth and arcHeight are of the same length the round rectangle will be in effect a circle.
"font" Query, get and set, define and set the GC's font.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
Supplying only the fontNickName argument will load the font from the internal register or from a Rexx variable of that name which refers to a font and use it for drawing strings until it gets changed again.
Supplying in addition the fontName, a java.awt.Font gets loaded from the system, registered with the supplied fontNickName and then used for setting the new font. The font size is taken from fontSize and the style from fontStyle unless the font name includes a trailing dash or blank, optionally a style (one of PLAIN, ITALIC, BOLD, BOLDITALIC) and/or a trailing dash or blank and size information (e.g. "Arial BOLD 18" or "Arial-BOLD-18", "Arial 18" or "Arial-BOLD").
Cf. the Java documentation for the Java class Graphics[2D] and the methods getFont(), setFont(...), as well as the Java class java.awt.Font and the method decode(fontName).
JDORFX Note: A query returns the current JavaFX Font; selecting or defining a Font returns the previous one. A complete Font description can contain a family, style, and size, for example Serif BOLD 18 or Serif-BOLD-18. An AWT Font in a Rexx variable is converted to an equivalent JavaFX Font. This command does not change the separate fontSize and fontStyle values used when another Font is created.
fontNickName fontNickName gets uppercased and is used to look up the internal font registry for the denoted font which should be used from now on or taken as the name of a Rexx variable which refers to an font.
fontNickName fontName This command loads a font with the given fontName from the system using the current fontSize and fontStyle, stores it in the font registry using the supplied fontNickName in uppercase and returns it via the Rexx variable RC.
The following logical font names are always available on all operating systems and can be used to set the fontName argument: "Dialog", "DialogInput", "Monospaced", "SansSerif" and "Serif".
"fontSize" Queries and optionally sets the font size to be used when loading a new font.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
Cf. the Java documentation for the Java class Font and the constructors as well as the method getSize().
JDORFX Note: Queries or sets the positive integer font size and returns the previous size. The new size is used when a font is next created.
size size (an integer value) that gets used when loading a new font, defaults to 12.
"fontStyle" Queries and optionally sets the font style to be used when loading a new font.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
Cf. the Java documentation for the Java class Font and the constructors as well as the method getStyle().
JDORFX Note: A query returns the style value that will be used when a Font is next created; a setter returns the previous value. Numeric values 0 through 3 are also accepted. Changing this value does not alter the current Font. popGC restores the current Font, but not this creation setting.
style style a number or symbolic name that gets used when loading a new font, defaults to 0 (PLAIN). Additional font style values are: 1 (BOLD), 2 (ITALIC) and 3 (BOLDITALIC).
"GC" Queries the GC (graphical context) object (an instance of the class Graphics[2D]) and returns it via the Rexx variable RC upon return from this command. One can then use all Graphics[2D] methods from an ooRexx program directly.
Cf. the Java documentation for the Java class Graphics[2D].
JDORFX Note: Returns the current JavaFX GraphicsContext.
(no arguments)No arguments.
"clipboardGet"
"getClipboard" (alias)
Gets the image from the system clipboard, stores it in the internal image registry with a default imageNickName of "CLIPBOARD" and returns the image via the Rexx variable RC.
JDORFX Note: Fetches the system Clipboard image, registers it, and returns it as a BufferedImage in RC.
imageNickName optional imageNickName gets uppercased and is used to store the clipboard image in the internal image registry; if omitted JDOR will use "CLIPBOARD" as the default imageNickName
"getState" Creates an ooRexx StringTable object, inserts state information and returns it via the Rexx variable RC. The following entries are available:
  • colors (a java.util.HashMap)
  • currAntiAliasing
  • currFontSize
  • currFontStyle
  • currTextAntiAliasing
  • currVisible
  • currWinUpdate
  • currX
  • currY
  • fonts (a java.util.HashMap)
  • gc (a java.awt.Graphics2D)
  • gc.background
  • gc.color
  • gc.composite
  • gc.font
  • gc.paint
  • gc.stroke
  • gc.transform (a java.awt.geom.AffineTransform)
  • gcStack (a java.util.ArrayDeque)
  • gradiantPaints (a java.util.HashMap)
  • image
  • imageHeight
  • imageStack (a java.util.ArrayDeque)
  • imageType
  • imageWidth
  • images (a java.util.HashMap)
  • prefImageType
  • printPosX
  • printPosY
  • printScaleToPage
  • printScaleX
  • printScaleY
  • shapes (a java.util.HashMap)
  • strokes (a java.util.HashMap)
  • transforms (a java.util.HashMap)

JDORFX Note: RC receives the same ooRexx StringTable described above. If rexxVariableName is supplied, that variable receives the same table as well. JDORFX adds canvas for the current Canvas and scene.fill for the visible Scene background; image also refers to the current Canvas. The JDOR compatibility entries gc.background, gc.composite, and gc.stroke contain their corresponding AWT objects.
rexxVariableName optional rexxVariableName the Rexx variable name to store the ooRexx StringTable object in the command context in addition.
"moveTo"
"goto"
"location"
"pos"
"position"
Queries and optionally sets currX and currY in the current image.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
Note: The canonical command name is moveTo, which is used when output gets redirected. The names goto, location, pos and position are accepted aliases.
JDORFX Note: Queries or sets the current position. A query returns currX currY; setting returns the previous position.
x [y] x gets used to set currX and y to set currY. If the argument y is omitted, x is used to set currY as well.
"gradientPaint" Get and set, define and set a gradientPaint (used for filling). This command returns the old (previously set) paint value via the Rexx variable RC.
Supplying only the gradientPaintNickName argument will load the gradientPaint from the internal register and use it.
Supplying additional arguments will cause a new gradient paint to be created, registered with the supplied gradientPaintNickName and then used for setting the current paint value to the new gradientPaint.
Cf. the Java documentation for the Java class Graphics[2D] and the methods getPaint(), setPaint(...), as well as the Java class java.awt.GradientPaint.
gradientPaintNickName gradientPaintNickName gets uppercased and is used to look up the internal gradientPaint registry for the denoted gradient paint which should be used from now on and gets returned via the Rexx variable RC.
gradientPaintNickName x1 y1 colorName1 x2 y2 colorName2 [cyclic] This command creates a gradient paint from point x1,y1 with color colorName1 to x2,y2 with color colorName2. The optional cyclic arguments determines whether the gradient patterns should cycle repeatedly between the two colors. This gradientPaint will be used from now on and gets stored in the gradientPaint registry using the supplied gradientPaintNickName in uppercase and returned via the Rexx variable RC.
"image" Queries an image object (an instance of the class java.awt.image.BufferedImage) and returns it via the Rexx variable RC upon return from this command. With no argument returns the current image which can be referred to via the Rexx variable RC upon return from this command. Supplying the optional imageNickName argument will load and return the image from the internal image register.
One can then use all BufferedImage methods from an ooRexx program directly. Cf. the Java documentation for the Java class BufferedImage.
JDORFX Note: Returns the current or a registered image as a JDOR-compatible BufferedImage in RC.
imageNickName optional imageNickName gets uppercased and is used to look up the internal image registry for the denoted image and gets returned via the Rexx variable RC.
"imageCopy" Creates and returns a copy of an image which got previously loaded from the filesystem with the command loadImage and stored internally with an imageNickName in the internal image registry, or an image that got pushed with a imageNickName in the command pushImage, or stored in a Rexx variable.
JDORFX Note: Creates and returns an independent JDOR-compatible BufferedImage copy in RC.
imageNickName [bkgColor] imageNickName denotes the name of an image stored in the internal image registry or the name of a Rexx variable referring to a BufferedImage.
"imageSize" Query the image size (dimension). With no arguments returns the current image's width and height which can be referred to via the Rexx variable RC upon return from this command.
Supplying the optional imageNickName argument will return the size of the image from the internal register, or from a Rexx variable referring to an image.
JDORFX Note: Returns the blank-delimited width height of the selected image in RC.
imageNickName optional imageNickName gets uppercased and is used to look up the internal image registry or the name of a Rexx variable referring to an image, get its size which is returned via the Rexx variable RC.
"imageType" Query the image type. With no arguments returns the current image's type which can be referred to via the Rexx variable RC upon return from this command.
Supplying the optional imageNickName argument will return the type of the image from the internal register, or from a Rexx variable referring to an image.
JDORFX Note: Returns the JDOR-compatible numeric image type in RC.
imageNickName optional imageNickName gets uppercased and is used to look up the internal image registry or the name of a Rexx variable referring to an image, get its type which is returned via the Rexx variable RC.
"loadImage" Loads an image from fileName, stores it with the uppercased imageNickName in the internal image registry and returns the image's size (dimension), i.e. width and height via the Rexx variable RC.
Cf. the Java documentation for the Java class javax.imageio.ImageIO and the method read(...).
JDORFX Note: Loads an image from the filesystem and registers it under imageName. Successful execution returns the blank-delimited image width height in RC.
imageNickName fileName The fileName to load the image from, storing it with the uppercased imageNickName in the internal image registry.
"newImage"
"new"
Creates a new image. By default the width and the height are set to 500 and the type to the current value of preferredImageType.
Cf. the Java documentation for the Java class java.awt.image.BufferedImage and its constants.
JDORFX Note: Creates a new JavaFX Canvas and Scene. Defaults are 500 by 500 pixels, the current preferred image type, and no depth buffer. The optional fourth argument enables depth buffering for 3D content. JavaFX Canvas cannot change its own pixel-storage format, so JDORFX remembers type and uses it when producing a BufferedImage. PREFERRED means the current preferred type. Type 0 cannot create an image and returns RC=-102. On success, RC has no result.
width height [type] The size is given in width and height pixels. The optional type allows to override the image type. If type is omitted the current value of preferredImageType (defaults to 2 a.k.a. BufferedImage.TYPE_INT_ARGB) gets used.
width height [type [depthBuffer]]JDORFX Extension: Set the optional Boolean depthBuffer to TRUE when 3D objects should hide surfaces that are behind nearer surfaces. PREFERRED may be used for type.
"paint" Queries and optionally sets current paint (used for filling).
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
Cf. the Java documentation for the Java class Graphics[2D] and the methods getPaint(), setPaint(...).
nickName nickName in uppercase will be used to look up a gradientPaint and if not found a color in the respective internal registries or stored in a Rexx variable by that name in this order.
"popGC" Disposes the current GC (Graphics[2D]) object and replaces it by popping a GC from the stack, thereby resetting all changes to that state and returns the popped (now current) GC via the Rexx variable RC.
(no arguments)No arguments.
"popImage" Pops the image from the stack and uses it to draw on to the current image. Returns the popped image via the Rexx variable RC upon return from this command.
JDORFX Note: Pops the most recently pushed image, composites it at 0 0 without replacing or resizing the Canvas, and returns the popped BufferedImage in RC.
(no arguments)No arguments.
"preferredImageType" Queries and optionally sets the preferred image type used for creating new images (cf. new command). Returns the image type via the Rexx variable RC upon return from this command.
Cf. the Java documentation for the Java class java.awt.image.BufferedImage and its constants.
JDORFX Note: Queries or sets the preferred JDOR-compatible image type used by later newImage commands. RC receives the current value for a query and the previous value for a setter.
type denotes the new preferred image type and may have one of the following values: TYPE_3BYTE_BGR (5), TYPE_4BYTE_ABGR (6), TYPE_4BYTE_ABGR_PRE (7), TYPE_BYTE_BINARY (12), TYPE_BYTE_GRAY (10), TYPE_BYTE_INDEXED (13), TYPE_CUSTOM (0), TYPE_INT_ARGB (2), TYPE_INT_ARGB_PRE (3), TYPE_INT_BGR (4), TYPE_INT_RGB (1), TYPE_USHORT_555_RGB (9), TYPE_USHORT_565_RGB (8) and TYPE_USHORT_GRAY (11).
"printImage" Uses the default printer to print the image. If the imageNickName is supplied, it gets uppercased and used to look it up in the image registry or if not found from a Rexx variable of the same name and prints it.
JDORFX Note: Prints the current or selected image using JavaFX PrinterJob. Successful execution has no result in RC.
imageNickName optional imageNickName is uppercased and used to look up the image from the internal registry or the name of a Rexx variable referring to an image of type BufferedImage that should get printed.
"printPos" Queries and optionally sets the left upper hand corner on the page where the image should be drawn to. This command has no effect if printScaleToPage was set to .true (1).
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
JDORFX Note: Queries or sets the manual print position. RC receives the current or previous blank-delimited x y.
x [y] x and y to define the left upperhand corner. If the argument y is omitted, then x gets used instead.
"printScale" Sets the scale factor for the print page x and y axis.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
JDORFX Note: Queries or sets manual print scaling. RC receives the current or previous blank-delimited scaleX scaleY.
scaleX [scaleY] scaleX and scaleY to define the scale factors. If the argument scaleY is omitted, then scaleX gets used instead.
"printScaleToPage" Queries and optionally sets the value.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC. If set to .true, the image will be scaled to the printable image area such, that the entire image gets printed proportionally. Returns the setting via the Rexx variable RC.
JDORFX Note: Queries or sets proportional scale-to-page printing. RC receives the current value for a query and the previous value for a setter, as 1 or 0.
booleanValue optional booleanValue can be one of 1, ".true", "true", 0, ".false" or "false".
"pushGC" Push the current GC (Graphics[2D]) object on the stack, thereby saving its current state (settings and transformations). This command will then create a copy of the current GC which will get used from then on. The pushed GC (a Graphics[2D] object) will get returned via the Rexx variable RC.
Cf. the Java documentation for the Java class Graphics[2D] and the method create().
(no arguments)No arguments.
"pushImage" Pushes a copy of the current image to the stack and optionally stores it with an imageNickName in the internal registry for later references by imageNickName. The image copy gets returned via the Rexx variable RC.
JDORFX Note: Pushes a detached snapshot of the complete current 2D rendering onto the image stack and returns that BufferedImage in RC.
imageNickName optional imageNickName will be uppercased and used to store the image in the internal image registry.
"render" Queries and optionally allows to change general and text antialiasing rendering hints.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC. The blank delimited string consists of two values, the first representing the setting of RenderingHints.KEY_ANTIALIASING (controls general antialiasing, JDOR default set to ALIASON) and the second the setting of RenderingHints.KEY_TEXT_ANTIALIASING (controls text antialising, JDOR default set to TEXTALIASON). By default these two keys are set to ALIASON TEXTALIASON to get the best rendering on high resolution screens and print devices.
Cf. the Java documentation for the Java class Graphics[2D] and the methods getRenderingHint(), setRenderingHint(...) and the Java class java.awt.RenderingHints.
JDORFX Note: A query returns the recorded general and text antialias settings; a setter returns the previous pair. JavaFX Canvas does not let a program force either setting on or off, so these values preserve JDOR-compatible state but do not change Canvas rendering. The state is saved by pushGC, restored by popGC, and preserved by reset.
rendering1 [rendering2] rendering1 and optionally rendering2 are values for either RenderingHints.KEY_ANTIALIASING (one of the values ALIASON, ALIASOFF, ALIASDEFAULT) or RenderingHints.KEY_TEXT_ANTIALIASING (TEXTALIASON, TEXTALIASOFF, TEXTALIASDEFAULT).
"reset"
"clear"
Resets the following values:
  • colors: the java.util.HashMap gets emptied except for the constant colors defined in the java.awt.Color class
  • currFontSize: 12
  • currFontStyle: 0
  • currX: 0
  • currY: 0
  • transform: resets translate to 0,0, scale to 1,1 and shear to 0,0
  • fonts: the java.util.HashMap gets emptied
  • gcStack: the java.util.ArrayDeque gets emptied
  • gradiantPaints: the java.util.HashMap gets emptied
  • imageStack: the java.util.ArrayDeque gets emptied
  • images: the java.util.HashMap gets emptied
  • printPosX: 0
  • printPosY: 0
  • printScaleToPage: .false
  • printScaleX: 1
  • printScaleY: 1
  • strokes: the java.util.HashMap gets emptied
The command name clear is an alias, a synonym for this command.
JDORFX Note: Applies the reset values listed above and returns 0 in RC. The current Canvas and its pixels are preserved, as are image types, the clip, both backgrounds, and the active Color, Paint, Stroke, Composite, XOR, render, and Font settings. Registries and the image and graphics-context stacks are cleared. An object removed from a registry can remain active until another object is selected.
(no arguments)No arguments.
"rotate" Rotates the image such that new drawings are appear rotated in effect.
Cf. the Java documentation for the Java class Graphics[2D] and the method rotate(...).
Note: this command converts the supplied degrees (0 to 360) to radians and supplies it to the Java method.
JDORFX Note: Adds a clockwise JavaFX rotation. Exactly one or three arguments are accepted; RC has no transform result. Use transform to query the current transform values.
theta [x y] theta is the amount of degrees the image should be rotated. If the optional arguments x and y are supplied then a "translate x y" will be invoked before rotating, followed by "translate -x -y".
"saveImage" Saves the current image to a file. If the saving of the image was successful 1 (.true) gets returned via the Rexx variable RC, otherwise -16 gets returned indicating an error has occurred (use output or error redirection to get further information in case of an error).
Cf. the Java documentation for the Java class javax.imageio.ImageIO and the method write(...).
JDORFX Note: Saves the complete current 2D rendering to a file. Successful execution returns 1 in RC.
fileName fileName defines the name to be used for saving the current image.
"scale" Queries and optionally changes ("concatenates") the scale factor for the x and y axis. The command returns the scale values at the time of invocation.
Cf. the Java documentation for the Java class Graphics2D and the method scale(...).
To set these factors to absolute values use the transform command.
JDORFX Note: Queries or appends scaling. If y is omitted it equals x; setting returns the previous X/Y scale components.
scaleX [scaleY] scaleX and scaleY to define the scale factors. If the argument scaleY is omitted, then scaleX gets used instead.
"setPaintMode" Invokes the setPaintMode method.
Cf. the Java documentation for the Java class Graphics2D and the methods setPaintMode() and setXORMode(...).
(no arguments)No arguments.
"setXorMode" Invokes the setXorMode method with the supplied color.
Cf. the Java documentation for the Java class Graphics2D and the methods setXORMode(...) and setPaintMode().
colorNickName colorNickName gets uppercased and is used to look up the internal color registry for the denoted color or stored in a Rexx variable which should be used from now on for xorMode processing.
"clipboardSet"
"setClipboard" (alias)
Sets the system clipboard to the current image unless the optional imageNickName is supplied in which case the image is retrieved from the internal image registry stored with an index matching imageNickName in uppercase. The image used to set the system clipboard gets returned via the Rexx variable RC.
JDORFX Note: Places an image on the system Clipboard and returns the corresponding BufferedImage in RC.
imageNickName optional imageNickName gets uppercased and is used to retrieve the image from the internal image registry
"clipboardSetWithoutAlpha"
"setClipboardWithoutAlpha" (alias)
Sets the system clipboard to the current image unless the optional imageNickName is supplied in which case the image is retrieved from the internal image registry stored with an index matching imageNickName in uppercase. The image used to set the system clipboard gets returned via the Rexx variable RC.
Note: images of type TYPE_4BYTE_ABGR or TYPE_4BYTE_ABGR_PRE are redrawn on white background on a new image of type TYPE_3BYTE_BGR, images of type TYPE_INT_ARGB or TYPE_INT_ARGB_PRE are redrawn on white background on a new image of type TYPE_INT_RGB.
JDORFX Note: Places an opaque version of an image on the system Clipboard and returns the converted BufferedImage in RC.
imageNickName optional imageNickName gets uppercased and is used to retrieve the image from the internal image registry
"shear" Queries and optionally changes ("concatenates") the shear (skew) factor for the x and y axis. The command returns the shear values at the time of invocation. Note: if supplying shear factors the shear algorithm may not only change the shear factors but also the scale factors.
Cf. the Java documentation for the Java class Graphics2D and the method shear(...).
To set these factors to absolute values use the transform command.
JDORFX Note: Queries or appends shearing. If y is omitted it equals x; setting returns the previous X/Y shear components.
shearX [shearY] shearX and shearY to define the shear factors. If the argument shearY is omitted, then shearX gets used instead.
"sleep" Sleeps (halts execution) for the given interval expressed in seconds.
JDORFX Note: Pauses the Rexx command thread for the supplied possibly fractional number of seconds. RC has no result.
seconds seconds determines the length of the sleep. It is possible to supply 1/1000 of a fraction of a second to allow for animation effects, eg.0.01 or 0.005.
"stringBounds" Returns the bounds (a rectangle) for the supplied string (text) if drawn in the current font on the current graphic context (via the Rexx variable RC). One can use this information to exactly set the position before using the drawString command to draw the string.
Note: In order to preserve leading blanks in a string, only the first (delimiting) blank after the command drawString will be consumed, all following characters - including leading whitespace - are regarded to constitute the string to be drawn.
Cf. the Java documentation for the Java class java.awt.FontMetrics and the method getStringBounds(String str, Graphics context).
JDORFX Note: RC receives minX minY width height for the complete remaining text in the current JavaFX Font. Leading, trailing, and whitespace-only text is measured. Results can differ slightly from JDOR because JavaFX and AWT measure fonts differently.
string string (text) for which the bounds get returned if drawn in the current font using the current graphics context. The string returned via the Rexx variable RC consists of blank delimited fields: "x y width height".
"stroke" Queries, defines and sets strokes.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
Cf. the Java documentation for the Java class Graphics[2D] and the methods getStroke(), setStroke(...) and the Java class java.awt.BasicStroke with its constructors and constants for the cap (CAP_BUTT or 0, CAP_ROUND or 1, CAP_SQUARE or 2) and join (JOIN_MITER or 0, JOIN_ROUND or 1, JOIN_BEVEL or 2) arguments.
JDORFX Note: A query returns the current JDOR-compatible java.awt.Stroke; selecting or defining a Stroke returns the previous one. A Stroke returned in RC can therefore be selected later through a Rexx variable. JDOR BasicStroke settings map to JavaFX line settings. A custom AWT Stroke is also accepted, but a drawShape made with it becomes Canvas pixels and cannot be animated separately. JavaFX has no exact equivalent for JDOR's zero-width hairline, so JDORFX remembers width 0 but draws it at width 1.
strokeNickName strokeNickName is uppercased and used to fetch the stroke from the internal stroke registry or stored in a Rexx variable, sets the Graphics[2D] object to it and returns the previous stroke via the Rexx variable RC.
strokeNickName width Defines a new stroke of width in pixels, stores it in the internal registry with the uppercased strokeNickName and returns the previous stroke via the Rexx variable RC.
strokeNickName width cap join Defines a new stroke of width in pixels, cap, join, stores it in the internal registry with the uppercased strokeNickName and returns the previous stroke via the Rexx variable RC.
strokeNickName width cap join miterlimit Defines a new stroke of width in pixels, cap, join, miterlimit, stores it in the internal registry with the uppercased strokeNickName and returns the previous stroke via the Rexx variable RC.
strokeNickName width cap join miterlimit dashArray dashPhase Defines a new stroke of width in pixels, cap, join, miterlimit, dashArray, dashPhase, stores it in the internal registry with the uppercased strokeNickName and returns the previous stroke via the Rexx variable RC.
"translate" Query or moves the current origin (originally at "(0,0)") from the upper left hand corner by adding x pixels to currX and y pixels to currY. The command returns the translate values at the time of invocation.
Cf. the Java documentation for the Java class Graphics2D and the method translate(...).
To set these factors to absolute values use the transform command.
JDORFX Note: Queries or appends a translation. If y is omitted it equals x; setting returns the previous translation.
x [y] x and y to add to currX and currY respectively. If the argument y is omitted, then x gets used instead.
"transform" Queries, resets, changes the current gc (Graphics2D) settings or allows to define a new AffineTransform that gets stored with a nickName.
An AffineTransform defines a matrix that gets used to calculate the effective x and y values for the target device according to this formula:

    x' = translateX + scaleX*x + shearX*y
    y' = translateY + scaleY*y + shearY*x

Cf. the Java documentation for the Java classes java.awt.geom.AffineTransform, java.awt.Graphics2D and the methods getTransform(), setTransform(...).


JDORFX Note: A query returns the six current transform values tx ty mxx myy mxy myx. The other forms reset the transform, retrieve or apply a named JavaFX Affine, or define and register one. The six-value form sets the values directly; a dot keeps the corresponding current value. Retrieving or defining a named transform returns the Affine object in RC.
No argument: returns the current gc (Graphics2D) AffineTransform settings in effect.
The command returns six blank delimited decimal numbers in the order: translateX, translateY, scaleX, scaleY, shearX, shearY at the time of invocation.
translateX translateY scaleX scaleY shearX shearY The arguments are taken to be decimal numbers and used to set the new values for the current gc (Graphics2D) to take effect. If a value for an argument consists of a dot (.) only, then that argument's value does not get changed (its current value gets used instead).
R[ESET] The current transform settings of the current gc (Graphics2D) will be reset such that translateX, translateY, shearX, shearY get set to 0.0 and scaleX and scaleY to 1.0. It is only necessary to supply the first letter.
nickName Returns the AffineTransform object stored with nickName.
nickName translateX translateY scaleX scaleY shearX shearY The arguments are used to create a new AffineTransform which gets stored with the name nickName and returned.
"winAlwaysOnTop" Queries and optionally sets the value.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC. If set to .true, the frame (window) that displays the image will be always on top of other windows. If no argument is supplied the current setting will be returned via the Rexx variable RC.
Cf. the Java documentation for the Java class java.awt.Window and the methods isAlwaysOnTop(), setAlwaysOnTop(...).
JDORFX Note: Queries or sets always-on-top state and returns the current/previous value as 1 or 0. If no Stage exists, the command creates and shows a fresh Stage around the existing Scene. Hide/show preserves the property; winClose discards it with the Stage.
booleanValue optional booleanValue can be one of 1, ".true", "true", 0, ".false" or "false".
"winAlwaysOnTopSupported" Returns the boolean value via the Rexx variable RC.
Cf. the Java documentation for the Java class java.awt.Window and the method isAlwaysOnTopSupported().
JDORFX Note: Returns 1 if the platform supports always-on-top windows, otherwise 0. If no Stage exists, the command prepares a new hidden Stage around the existing Scene.
(no arguments)No arguments.
"winClose" Closes the frame (window) that gets used to display the image by sending it the java.awt.event.WindowEvent named WINDOW_CLOSING.
JDORFX Note: Hides and discards the Stage while preserving the Scene, Canvas, drawing state, clip, and visible content. A later show creates a new default decorated Stage for that content. The command has no result in RC.
(no arguments)No arguments.
"winFrame" Queries and optionally sets the value.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC. If set to .false, the frame (window) that displays the image will not have a frame and a title. If no argument is supplied the current setting will be returned via the Rexx variable RC.
Cf. the Java documentation for the Java class java.awt.Frame and the methods isUndecorated(), setUndecorated(...).
JDORFX Note: Queries or sets stage decoration and returns the current/previous value as 1 or 0. Changing decoration rebuilds the stage.
booleanValue optional booleanValue can be one of 1, ".true", "true", 0, ".false" or "false".
"winHide" Hides the frame (window) that displays the current image.
Cf. the Java documentation for the Java class java.awt.Window and the method setVisible(...).
JDORFX Note: Hides and retains the Stage. A later show reuses the same window and its window-specific properties. Drawing content and state are unchanged. The command has no result in RC.
(no arguments)No arguments.
"winLocation"
"winMoveTo"
Queries and optionally sets location of the frame (window) that shows the current image.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
The command name winMoveTo is an alias, a synonym for this command.
Cf. the Java documentation for the Java class java.awt.Window and the method setLocation(...) and the Java class java.awt.Component and the method getLocation().
JDORFX Note: Queries or sets the Stage position. A query returns x y; setting returns the previous position. After winClose, the command creates and shows a fresh Stage around the preserved Scene.
x y The x and y coordinate where to move the frame (window) to on the current screen.
"winResizable" Queries and optionally sets the value. If set to .true, the frame (window) that displays the current image can be resized, by default this property is set to .false.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
Cf. the Java documentation for the Java class java.awt.Frame and the method setResizable(...).
JDORFX Note: Queries or sets resizability and returns the current/previous value as 1 or 0.
booleanValue optional booleanValue can be one of 1, ".true", "true", 0, ".false" or "false".
"winScreenSize" Returns the blank delimited values of the current screen's width and height in pixels via the Rexx variable RC upon return from this command.
Cf. the Java documentation for the Java class java.awt.Toolkit and the method getScreenSize().
JDORFX Note: Returns the screen width and height as width height.
(no arguments)No arguments.
"winShow" Shows the frame (window) that displays the current image.
Cf. the Java documentation for the Java class java.awt.Window and the method setVisible(...).
JDORFX Note: Shows the JavaFX stage. RC has no result.
(no arguments)No arguments.
"winSize" Queries and optionally sets the size of the frame (window) that displays the current image.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
If no argument is supplied this command returns the blank delimited values for the current frame's (window) width and height in pixels via the Rexx variable RC upon return from this command.
JDORFX Note: Queries or sets the display window's content size. A query returns width height; setting returns the previous content size. This does not resize the Canvas or current image; drawing-surface dimensions are controlled by newImage.
width height optional, if supplied the new size is given in width and height pixels.
"winTitle" Queries and optionally sets the title of the frame (window) that displays the current image.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
Note: In order to preserve leading blanks in the title, only the first (delimiting) blank after the command winTitle will be consumed, all following characters - including leading whitespace - are regarded to constitute the title to be used.
Cf. the Java documentation for the Java class java.awt.Frame and the methods getTitle(), setTitle(...).
JDORFX Note: Queries or sets the title. The complete remainder is the title; setting returns the previous title. After winClose, the command creates and shows a fresh Stage around the preserved Scene.
title optional, the new title for the frame (window).
"winToBack" Sends the frame (window) that displays the current image to the back of all windows that are defined for the current screen.
Cf. the Java documentation for the Java class java.awt.Window and the method toBack().
JDORFX Note: Requests that the Stage move behind other windows without changing always-on-top state. After winClose, it creates and shows a fresh usable Stage. RC has no result.
(no arguments)No arguments.
"winToFront" Sends the frame (window) that displays the current image to the front of all windows that are defined for the current screen.
Cf. the Java documentation for the Java class java.awt.Window and the method toFront().
JDORFX Note: Requests that the Stage move in front of other windows without changing always-on-top state. After winClose, it creates and shows a fresh usable Stage. RC has no result.
(no arguments)No arguments.
"winUpdate" Queries and optionally sets the value. If set to .true, the frame (window) that displays the current image will be updated each time a change occurs in the current image, otherwise the frame (window) does not get visually updated.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
JDORFX Note: A query returns the current setting as 1 or 0; a setter returns the previous setting. FALSE freezes the displayed Canvas and retained 2D Shapes while drawing and 2D animations continue. TRUE displays their latest state. This does not freeze 3D objects, cameras, lights, or window changes. The setting survives hiding or closing the window and creating a new image.
booleanValue optional booleanValue can be one of 1, ".true", "true", 0, ".false" or "false".
"winVisible" Queries and optionally sets the value. If set to .true, the frame (window) that displays the current image will be shown, otherwise it will be hidden.
Querying the current value (no argument supplied) will return it, setting (changing) the value to a new value will return the old (previously set) value via the Rexx variable RC.
Cf. the Java documentation for the Java class java.awt.Window and the method setVisible(...).
JDORFX Note: Queries or sets visibility and returns the current/previous value as 1 or 0.
booleanValue optional booleanValue can be one of 1, ".true", "true", 0, ".false" or "false".

The JDORFX Shape Related Rexx Commands

Most shapes created by JDORFX are JavaFX Shape objects. They remain available after creation, so they can later be drawn, transformed, or animated. The sole exception is Area: to preserve JDOR behavior, it is an AWT java.awt.geom.Area object. The shape command accepts familiar JDOR type names such as Arc2D and Rectangle2D:

A JavaFX Path is built from move, line, curve, and close segments. JDORFX can append another Shape's outline, permanently transform the Path, or return an AWT PathIterator for compatibility with JDOR. That iterator can later be supplied to pathAppend.

Note: JavaFX shape coordinates are double-precision values. A created shape remains a named scene-graph node and can later be transformed or animated.

The Shape related JDORFX Rexx commands are:

The Area shape specific JDORFX Rexx commands are:

shape target Area source creates an independent Area copy. Area operations change the registered Area itself and return that object. Their other Shape or transform may come from a registry or a Rexx variable. Because an Area is not a JavaFX Node, JDORFX makes a JavaFX Path copy when it needs to display one. Later Area changes therefore affect later bounds, iterators, and renderings, but do not alter a rendering or clip already created.

The JavaFX Path commands, retaining JDOR's Path2D compatibility terminology, are:

Shape Related Commands

Here the JDORFX commands that are related to all Shapes:

Command Argument(s) Description
"shape" Queries or creates a named Shape.
Querying will return the stored shape, creating a new shape will store it with the supplied shapeNickName and return it via the Rexx variable RC.
shapeNickName The name of the Shape that gets returned from the registry.
shapeNickName typeName args Creates a new Shape of type typeName using args arguments, registers and returns it.
Accepted typeName arg(s) Brief Description
Area shapeNickName Defines a new area shape for the supplied shape. Using an area shape as argument will create a new area shape (effectively a copy).
All area related commands start with the word area.
Arc | Arc2D x y width height start extent type This is the JDOR-compatible bounding-box form. JDORFX treats x/y as the upper-left position, converts the box to JavaFX center and radius properties, and passes start and extent unchanged to the JavaFX Arc constructor as startAngle and length.
JDORFX follows this documented width/height order. This intentionally corrects a defect in the JDOR Java implementation, whose numeric overload interchanges the two dimensions. No angle-direction conversion is performed.
type determines whether it should be left open (OPEN or 0), or a line should be drawn between the starting and the ending point of the arc (CHORD or 1), or a line should get drawn between the starting point, the center point and the ending point of the arc (PIE or 2).
bounds start extent type bounds resolves a registered Shape first and then a Rexx variable. JavaFX Rectangle and AWT java.awt.geom.Rectangle2D objects (including subclasses such as java.awt.Rectangle) are accepted. JDORFX copies x/y/width/height and converts the bounds to the JavaFX Arc's centerX/centerY/radiusX/radiusY properties and passes start and extent unchanged as startAngle and length. Unlike the numeric form, this form preserves the Rectangle's horizontal and vertical dimensions.
type determines whether it should be left open (OPEN or 0), or a line should be drawn between the starting and the ending point of the arc (CHORD or 1), or a line should get drawn between the starting point, the center point and the ending point of the arc (PIE or 2).
Cubic | CubicCurve | CubicCurve2D x1 y1 ctrlx1 ctrly1 ctrlx2 ctrly2 x2 y2 Defines a cubic parametric curve shape between the points x1/y1 and x2/y2 controlled by the two control points located at ctrlx1/ctrly1 and ctrlx2/ctrly2.
Elli | Ellipse | Ellipse2D x y width height Defines an ellipse (oval) shape at position x and y in a rectangle of width and height. If width and height are of the same length the ellipse (oval) will be a circle.
line | Line2D x1 y1 x2 y2 Defines a line shape that will be drawn from position x1/y1 to x2/y2.
path | Path2D [rule] Creates a JavaFX Path. The optional rule can be either 0 (WIND_EVEN_ODD) or 1 (WIND_NON_ZERO), which is the default.
Polygon xPoints-array yPoints-array nPoints Creates a Polygon shape consisting of nPoints taken from the xPoints-array and yPoints-array. If the endpoint is not the same coordinate as the first point, the polygon gets closed by drawing a line from the first to the last point.
Quad | QuadCurve | QuadCurve2D x1 y1 ctrlx ctrly x2 y2 Defines a quadratic parametric curve shape between the points x1/y1 and x2/y2 controlled by the control point located at ctrlx/ctrly.
Rect | Rectangle | Rectangle2D x y width height Defines a rectangular shape at position x and y of width and height. If width and height are of the same length the rectangle is a square.
RoundRect | RoundRectangle | RoundRectangle2D x y width height arcWidth arcHeight Defines a round rectangular shape at position x and y of width and height, where the corner arcs have width arcWidth and height arcHeight.
"clipShape"
"shapeClip"
Limits later drawing to the part inside the supplied Shape. It combines with any existing clip and uses the current transform when the command is issued. The source Shape is not changed. Successful execution has no result in RC.
shapeNickName shapeNickName identifies a registered Shape or a supported JavaFX/AWT Shape in a Rexx variable. The command remembers the Shape's geometry at that moment; later changes to the Shape do not change the clip. clipRemove removes the complete combined clip.
"drawShape"
"shapeDraw"
Draws the outline of the supplied Shape using the current stroke and drawing settings. Each call creates a separate visible rendering and does not change the source Shape. Successful execution has no result in RC.
shapeNickName shapeNickName identifies a registered Shape or a supported JavaFX/AWT Shape in a Rexx variable. The latest retained rendering of a registered Shape can be used by 2D animations. With XOR, a custom AWT Stroke, or a Composite rule that requires Canvas drawing, the result becomes pixels and cannot be animated separately. When Shape and Canvas drawing are mixed, their earlier order cannot always be reproduced exactly.
"fillShape"
"shapeFill"
Fills the supplied Shape using the current fill and drawing settings. Each call creates a separate visible rendering and does not change the source Shape. Successful execution has no result in RC.
shapeNickName shapeNickName identifies a registered Shape or a supported JavaFX/AWT Shape in a Rexx variable. The latest retained rendering of a registered Shape can be used by 2D animations. With XOR or a Composite rule that requires Canvas drawing, the result becomes pixels and cannot be animated separately. When Shape and Canvas drawing are mixed, their earlier order cannot always be reproduced exactly.
"shapeBounds" Returns the bounds of the supplied Shape's own geometry as a blank-delimited Rexx string: "x y width height".
shapeNickName Returns a blank delimited string denoting the bounds (x, y, width, height) for the shape stored with shapeNickName, or a supported JavaFX or AWT Shape referred to by a Rexx variable with that name. Stroke, paint, effects, clipping, and JavaFX Node transforms are not included. A Path whose coordinates were changed by pathTransform reports those changed coordinates.

Path (Path2D Compatibility) Related Commands

The JavaFX Path (javafx.scene.shape.Path) allows arbitrary geometry to be assembled from move, line, quadratic Bézier, cubic Bézier, and close elements. JDORFX retains the Path2D terminology and creation alias for source compatibility, but the stored and returned object is a JavaFX Path.

Here are the JDORFX commands related to a JavaFX Path:

Command Argument(s) Description
"pathIterator" Returns a standard AWT java.awt.geom.PathIterator for the named JavaFX or AWT Shape. The returned object can be supplied to pathAppend through a Rexx variable.
shapeNickName [transformNickName [flatness]] The Shape and optional transform may be registered objects or objects held in Rexx variables. JavaFX Affine and AWT AffineTransform objects are accepted. Use .nil when flatness is wanted without a transform. Flatness replaces curves with sufficiently short line segments. Only JavaFX Shape types whose outlines JDORFX can obtain are accepted.
"pathAppend" Adds the source Shape or path segments to the end of the named JavaFX Path. The target Path is changed in place; successful execution has no result in RC.
pNickName spNickName [connect=.true] pNickName identifies the target JavaFX Path. spNickName identifies a supported registered or Rexx-variable JavaFX/AWT Shape, or an AWT PathIterator in a Rexx variable. By default, connect is TRUE and a line joins the existing Path to the appended geometry. An empty Polygon adds nothing; other Polygons retain JDOR's closed-path behavior.
"pathClone" The named JavaFX Path gets cloned and returned.
pNickName [clonedNickName] pNickName identifies the registered JavaFX Path. The command returns a new Path with the same geometry and fill rule; later geometry changes to either Path do not affect the other. Visual Node properties are not copied. If clonedNickName is supplied, the clone is also registered under that name, replacing an existing entry with the same name.
"pathClose" The named JavaFX Path will have its current segment closed by drawing a straight line back to the last pathMoveTo position.
pNickName pNickName denotes the name of a registered JavaFX Path, of which the last segment gets closed by drawing a line to the last pathMoveTo position.
"pathCurrentPoint" Returns the current point of the named JavaFX Path.
pNickName pNickName denotes the name of a registered JavaFX Path, whose current point gets returned.
Note: an empty Path returns .nil; otherwise a blank-delimited Rexx string in the form "x y" is returned. A pathMoveTo establishes the current point, line and curve endpoints update it, and pathClose returns it to the beginning of the current subpath. A later pathMoveTo starts a new subpath and becomes its current point.
"pathCurveTo" Creates a cubic parametric curve segment.
pNickName ctrlx1 ctrly1 ctrlx2 ctrly2 x y pNickName denotes the name of a registered JavaFX Path for which a cubic parametric curve segment gets created between the points currentPoint (cf. pathCurrentPoint command above) and the point with the co-ordinate x/y controlled by the two control points located at ctrlx1/ctrly1 and ctrlx2/ctrly2.
"pathLineTo" Creates a line segment.
pNickName x y pNickName denotes the name of a registered JavaFX Path for which a line segment gets created between the points currentPoint (cf. pathCurrentPoint command above) and the point with the co-ordinate x/y.
"pathMoveTo" Adds a point to the path at the supplied position.
pNickName x y pNickName denotes the name of a registered JavaFX Path for which a point should get added at x/y (making it the currentPoint, cf. pathCurrentPoint command above).
"pathQuadTo" Creates a quadratic parametric curve segment.
pNickName ctrlx ctrly x y pNickName denotes the name of a registered JavaFX Path for which a quadratic parametric curve segment gets created between the points currentPoint (cf. pathCurrentPoint command above) and the point with the co-ordinate x/y controlled by the control point located at ctrlx/ctrly.
"pathReset" The named JavaFX Path will be reset to become empty.
pNickName pNickName denotes the name of a registered JavaFX Path, which gets reset to become empty.
"pathTransform" Permanently moves, scales, rotates, or shears the existing points of the named JavaFX Path. The same Path object is retained; successful execution has no result in RC.
pNickName tNickName pNickName identifies the JavaFX Path. tNickName identifies a registered JavaFX Affine, a JavaFX Affine in a Rexx variable, or an AWT AffineTransform in a Rexx variable. Repeated calls build on the already transformed Path. Points added later are unchanged until the command is used again. The transform object itself is not modified.
"pathWindingRule" Queries or sets the winding rule of the named JavaFX Path.
pNickName [newValue] Returns or sets the winding rule of the JavaFX Path denoted by pNickName. If newValue is supplied, it needs to be WIND_EVEN_ODD or 0, alternatively WIND_NON_ZERO or 1. A query returns the numeric string 0 or 1. A setter has no explicit Java result and is exposed by the ooRexx command environment as successful RC=0. The selected rule survives cloning, transformation, and path reset.

3D, Camera, Light, and Material Related Commands

JDORFX adds retained JavaFX 3D nodes, cameras, lights, texture maps, and Phong materials. A true fourth newImage depth-buffer argument, used after an explicit type or PREFERRED, enables correct depth testing for 3D scenes.

CommandArgument(s)Description
"shape3d"Queries or creates a registered JDORFX/JavaFX 3D Shape. A query returns the registered Shape3D object in RC. A creation form registers a new object under name and returns that object in RC; it does not add the object to the Scene Graph.
nameQueries the 3D-shape registry for name; no object is created or selected.
name BOX x y z width height depthCreates a JavaFX Box with the supplied dimensions. The x/y/z values set its initial translation.
name CYLINDER x y z radius heightCreates a JavaFX Cylinder with the supplied radius and height at the initial translation.
name SPHERE x y z radiusCreates a JavaFX Sphere with the supplied radius at the initial translation.
"draw3DShape"
"drawShape3D"
Sets a 3D Shape to wireframe drawing, adds it to the Scene Graph, and returns the same Shape3D object in RC.
shapeNameshapeName resolves a registered Shape3D or a Rexx variable referring to one. Its draw mode becomes LINE; the registry entry itself is not replaced.
"fill3DShape"
"fillShape3D"
Sets a 3D Shape to filled-surface drawing, adds it to the Scene Graph, and returns the same Shape3D object in RC.
shapeNameshapeName resolves a registered Shape3D or a Rexx variable referring to one. Its draw mode becomes FILL; the registry entry itself is not replaced.
"rotate3DShape"
"rotateShape3D"
Adds a cumulative axis-angle Affine rotation and returns the modified Shape3D object in RC.
name angle pivotX pivotY pivotZ axisX axisY axisZname must identify a registered Shape3D. angle is measured in degrees; the pivot fixes the point of rotation and the axis vector selects its 3D axis. RC is the modified Shape3D.
"scale3DShape"
"scaleShape3D"
Adds a cumulative 3D scale around a pivot and returns the modified Shape3D object in RC.
name scaleX scaleY scaleZ pivotX pivotY pivotZThe three scale factors apply around the supplied 3D pivot. RC is the modified registered Shape3D.
"shear3DShape"
"shearShape3D"
Adds a cumulative two-dimensional shear around a pivot and returns the modified Shape3D object in RC.
name shearX shearY pivotX pivotYThe two shear factors apply in the x/y plane around the supplied pivot. RC is the modified registered Shape3D.
"translate3DShape"
"translateShape3D"
Adds a cumulative 3D translation and returns the modified Shape3D object in RC.
name tx ty tzThe translation is appended to existing transforms, so repeated calls are cumulative. RC is the modified registered Shape3D.
"cullFace"Queries or sets which faces of a registered Shape3D JavaFX omits while rendering. A query returns the current mode in RC; a setter returns the previous mode in RC.
shapeNameReturns NONE, BACK, or FRONT without changing the Shape3D.
shapeName NONE|BACK|FRONTNONE renders both sides, BACK omits back-facing surfaces, and FRONT omits front-facing surfaces. JavaFX Shape3D objects default to BACK.
"camera"Queries or creates a camera; it never selects the active camera. Queries and creation forms return the requested or created Camera object in RC, except that querying an implicit JavaFX default returns .nil.
(no arguments)Returns the explicitly active camera, or .nil while the Scene uses JavaFX's implicit default camera.
nameReturns the registered camera named by name; it neither creates nor activates a camera.
name PARALLEL x y zCreates and registers a parallel-projection camera with the supplied initial translation.
name PERSPECTIVE x y z [fieldOfView [fixedEyeAtCameraZero]]Creates and registers a perspective camera. The field of view defaults to 30 degrees and fixedEyeAtCameraZero defaults to false.
"setCamera"Selects the active camera. A name resolves a registered/Rexx-variable camera; omitting it restores JDORFX's default parallel camera. This does not assign a Rexx variable. RC is the previously explicit camera, or .nil if JavaFX was using its implicit default.
(no arguments)Selects JDORFX's default parallel camera. RC is the previously explicit camera, or .nil if the implicit default was active.
cameraNameSelects a registered camera or Camera held in the named Rexx variable. RC is the previously selected Camera or .nil. This does not assign a Rexx variable.
"translateCamera"Appends a translation transform to a registered camera and returns the modified Camera in RC.
name tx ty tzThe translation is cumulative; it changes the camera's effective position without replacing its registry entry.
"rotateCamera"Appends an axis-angle rotation transform to a registered camera and returns the modified Camera in RC.
name angle pivotX pivotY pivotZ axisX axisY axisZangle is in degrees; the pivot fixes the rotation point and the axis vector selects the 3D rotation axis.
"cameraNearClip"Queries or sets the nearest distance at which a registered camera renders content. A query returns the current distance in RC; a setter returns the previous distance.
name [distance]The optional distance must be finite, positive, and less than the camera's far clipping distance.
"cameraFarClip"Queries or sets the farthest distance at which a registered camera renders content. A query returns the current distance in RC; a setter returns the previous distance.
name [distance]The optional distance must be finite, positive, and greater than the camera's near clipping distance.
"light"Queries or creates a registered JavaFX light; it does not enable the light. A name alone returns the registered Light object in RC. A form containing a type creates, registers, adds, initially disables, and returns the new Light object in RC.
nameQueries and returns the registered Light object; it does not create or enable one.
name AMBIENT [color]Creates uniform illumination with the optional registered colour, defaulting to white. The light is added to the Scene Graph but initially disabled.
name POINT x y z [color]Creates a positional light at x/y/z with the optional registered colour, defaulting to white. The light is added but initially disabled.
"setLight"Selects the enabled state of a registered/Rexx-variable light; it neither creates a light nor assigns a Rexx variable. RC is the previous state as 1 or 0.
name [TURNON|TURNOFF]The default action is TURNON. The name may resolve a registered Light or a Light in a Rexx variable. RC is its previous disabled/enabled state as 0 or 1.
"translatePointLight"Appends a translation transform to the named PointLight, so tx/ty/tz are added cumulatively to its effective light-source position. An AmbientLight is rejected because it illuminates uniformly and has no positional source for translation to affect. RC is the modified PointLight.
name tx ty tzname must identify a registered PointLight. Each call appends tx/ty/tz to its effective source position. AmbientLight is rejected because uniform ambient illumination has no source position to move.
"map"Loads an image for use as a texture map, registers it under name, and returns its blank-delimited width height in RC.
name imagePathLoads and registers the image without changing its dimensions. The path is one token and may be Rexx-quoted.
name imagePath addWidth addHeight angle [color]Creates a writable map enlarged by the supplied amounts, centers and rotates the source through angle degrees, and optionally fills uncovered pixels with a registered colour. Arbitrary angles use nearest-pixel placement and can leave gaps.
"material"Always creates and registers a new JavaFX PhongMaterial and returns that object in RC; this command has no query or selection form. Reusing a name replaces that registry entry. It does not assign the material to a Shape.
name [color]The optional colour may resolve from the colour registry, a Rexx Color variable, or JavaFX web-colour syntax and sets the diffuse surface colour; otherwise JavaFX defaults apply. Reusing a name replaces that registry entry, but does not modify Shapes already using an earlier material object.
"materialColor"Modifies a PhongMaterial's diffuse or specular colour. Successful execution returns the previous colour in RC, or .nil if no specular colour was set.
name DIFFUSE|DIFFUSECOLOR colorSets the base colour seen where light falls on the material.
name SPECULAR|SPECULARCOLOR color [specularPower]Sets the highlight colour and optionally its concentration; specularPower defaults to 32.
"materialMap"Assigns an image map to one surface channel of a PhongMaterial. RC is the previously assigned Image for that channel, or .nil.
name BUMP|BUMPMAP|DIFFUSE|DIFFUSEMAP|SELFILLUMINATION|SELFILLUMINATIONMAP|SPECULAR|SPECULARMAP mapname resolves a registered material or Rexx-variable PhongMaterial. map first resolves the map registry and otherwise is treated as an image file path. Bump controls apparent surface relief, diffuse controls base colour, self-illumination appears independently of lighting, and specular controls highlights.
"setMaterial"Selects a registered/Rexx-variable PhongMaterial for a registered/Rexx-variable Shape3D. It neither creates a material nor assigns a Rexx variable. RC is the Shape3D's previous Material, or .nil.
shapeName materialNameEach name resolves its registry first and then a compatible Rexx variable. The material is assigned to the Shape3D; neither object is created or registered by this command.


Animation Related Commands

Animations operate on named JavaFX nodes. A registered 2D Shape nickname resolves to its most recently successful drawShape or fillShape rendering; render the Shape before constructing its animation. Existing animations remain bound if a later rendering is created. The path argument of animationPath instead remains registered source geometry. Shape3D, camera, and light targets keep their registry lookup. Durations are milliseconds; cycle count defaults to one, auto-reverse defaults to false, and -1 means indefinite. Because JavaFX cameras and lights extend Node, node transitions and timeline translation/rotation properties can animate cameras and PointLights; fill and stroke transitions remain limited to 2D Shapes because JavaFX FillTransition and StrokeTransition animate the fill and stroke properties declared by javafx.scene.shape.Shape. Shape3D surface appearance is instead provided by a Material and has no Shape fill/stroke property.

When a Command cell lists multiple spellings, every spelling is an equally accepted command name; the listed names are synonyms for the same operation.

CommandArgument(s)Description
"animationFade"
"fade"
"fadeTransition"
Creates and registers an opacity transition for a Node and returns the new FadeTransition object in RC.
anim node duration [from [to [cycles [autoReverse]]]]anim is the new animation nickname, node identifies its target, and duration is one cycle in milliseconds. Optional from and to are opacity values; omitted values retain JavaFX defaults. The remaining options control repetition and alternating reverse cycles.
"animationRotate"
"rotateTransition"
Creates and registers a transition that rotates a Node by an angle during each cycle and returns the new RotateTransition object in RC.
anim node duration [angle [cycles [autoReverse [axisX [axisY [axisZ]]]]]]duration is in milliseconds and angle is in degrees. Optional axis components select a 3D rotation axis; omitted components of an explicitly supplied axis default to 0, 0, and 1.
"animationScale"
"scaleTransition"
Creates and registers a transition that changes a Node's scale by the supplied components and returns the new ScaleTransition object in RC.
anim node duration [byX [byY [byZ [cycles [autoReverse]]]]]duration is one cycle in milliseconds. Each supplied component is added to the Node's corresponding scale value during a cycle; omitted components retain JavaFX defaults.
"animationTranslate"
"translateTransition"
Creates and registers a transition that moves a Node by the supplied components and returns the new TranslateTransition object in RC.
anim node duration [byX [byY [byZ [cycles [autoReverse]]]]]duration is one cycle in milliseconds. Each supplied component is added to the Node's corresponding translation during a cycle; omitted components retain JavaFX defaults.
"animationPath"
"pathTransition"
Creates and registers a transition that moves a Node along registered 2D Shape geometry and returns the new PathTransition object in RC.
anim node duration path [cycles [autoReverse [orientation]]]path remains the registered source geometry. Orientation NONE leaves the Node's rotation unchanged; ORTHOGONAL and ORTHOGONAL_TO_TANGENT rotate it to follow the path tangent.
"animationFill"
"fillTransition"
Creates and registers a transition that changes a rendered 2D Shape's interior colour and returns the new FillTransition object in RC.
anim shape duration [fromColor [toColor [cycles [autoReverse]]]]Colors resolve from the registry, Rexx variables, or JavaFX web syntax. Shape3D is unsupported because its Material, not the Shape3D itself, supplies surface colour.
"animationStroke"
"strokeTransition"
Creates and registers a transition that changes a rendered 2D Shape's outline colour and returns the new StrokeTransition object in RC.
anim shape duration [fromColor [toColor [cycles [autoReverse]]]]Colors resolve in the same way as for animationFill. Shape3D has no stroke property.
"animationPauseTransition"Creates and registers a timed pause that can be used in a composed animation and returns the new PauseTransition object in RC.
anim duration [cycles [autoReverse]]This transition has no target Node and changes no property; its duration is measured in milliseconds.
"animationSequential"
"sequentialTransition"
Creates and registers a group whose child animations play one after another and returns the new SequentialTransition object in RC.
anim [node] child1 child2 ... [cycles] [autoReverse]The children must name registered animations. A resolvable first Node supplies the group's default target; otherwise the first token after anim is the first child. Optional trailing cycle and Boolean values configure the group.
"animationParallel"
"parallelTransition"
Creates and registers a group whose child animations play together and returns the new ParallelTransition object in RC.
anim [node] child1 child2 ... [cycles] [autoReverse]The children must name registered animations. A resolvable first Node supplies the group's default target; otherwise the first token after anim is the first child. Optional trailing cycle and Boolean values configure the group.
"setInterpolator"Sets how a supported transition progresses between its start and end and returns the previous Interpolator object in RC.
anim LINEAR|DISCRETE|EASE_IN|EASE_OUT|EASE_BOTH|SPLINE(x1,y1,x2,y2)Timelines and sequential/parallel groups reject a global interpolator. RC is the previous Interpolator.
"animationPlay"
"play"
Starts or resumes a registered animation and returns its previous status in RC.
animStatus values are RUNNING, PAUSED, and STOPPED.
"animationPause"
"pause"
Pauses a registered animation at its current time and returns its previous status in RC.
animanim is the case-insensitive nickname of a registered animation.
"animationStop"
"stop"
Stops a registered animation, resets it to the beginning, and returns its previous status in RC.
animanim is the case-insensitive nickname of a registered animation.
"animationStatus"Queries a registered animation and returns RUNNING, PAUSED, or STOPPED in RC without changing it.
animanim is the case-insensitive nickname of a registered animation.
"timeline"Creates a Timeline when name is new, or retrieves the existing Timeline with that name, registers it as an animation, and returns the Timeline object in RC.
name [cycles [autoReverse]]The optional values set repetition and alternate reverse cycles on the created or retrieved Timeline. Existing KeyFrames are preserved when a Timeline is retrieved.
"keyValue"Creates and registers a reusable description of one target property value and returns the new KeyValue object in RC.
name node property target [interpolator]node identifies the object whose property will change when a containing Timeline runs. Supported properties are opacity, rotate, translateX/translateY/translateZ (also x/y/z), scaleX/scaleY/scaleZ, fill/fillColor, and stroke/strokeColor. The optional interpolator controls progression toward target.
"keyframe"Creates a KeyFrame, adds it to a registered Timeline at the supplied millisecond time, and returns the new KeyFrame object in RC.
timeline time keyValueNameOrArrayThe last argument names either one registered KeyValue or a non-empty Rexx variable containing a typed Java KeyValue[]. Quote an array variable name so Rexx passes the name rather than substituting its value.


JDORFX synopsis copied from the JDOR synopsis structure and adapted: 2026-09-13
JDORFX synopsis version: 100.20260913