Below is a screen snapshot of the
Shape Editor Demo
that uses a
to specify the MOVE, LINE, QUAD, CUBIC, and CLOSE path segments that
constitute the path for the shape. The path segment data on the left
hand side is reflected in the shape structure painted on the right
The source code for the Shape Editor Demo is available at
occupies the top half of the
left column and includes the sub-panels titled with
"Winding Rule" and "Path Node List". The "Winding Rule"
sub-panel simply has 2 radio buttons to select the winding
The "Path Node List" uses a
to collect the
items for the
The buttons signal insert path node view and the buttons signal delete path node view.
The buttons to the right of a particular
or delete that view while the buttons below insert or delete
at the end of the list. You may also set the total number of
path node views at once and then fill in the views one-by-one.
segment types that may be entered interactively in a
are as follows.
The x,y values are
float but there is no need to append
the "f" required internally in Java.
Shape corresponding to the
that is represented
is rendered into the graphics window based on the other settings
in the GUI (colors, stroke thickness, and grid choice).
The code uses tools provided in the
The path may be edited by dragging the vertex and control dots with
It is also possible to save and read back a
to and from a text file using the save and read buttons.