Developing Stencils
The following screenshots are taken from a GNU/Linux desktop using Pencil to create the prototype GUI for a Windows application and the Pencil website mockups
The following screenshots are taken from a GNU/Linux desktop using Pencil to create the prototype GUI for a Windows application and the Pencil website mockups
A stencil collection is usually distributed as a single ZIP archive
containing all related files for that collection.
This collection ZIP archive has one main XML file named (exactly) Definition.xml and other optional
files or sub-directories containing supporting files for the main XML
(mainly for icon files).
The Definition.xml file
name is case-sensitive and is
the only required file for a collection. All other files can be omitted
when not needed.
Each Definition.xml file
defines a collection of stencils by providing collection information
and all stencil definitions. This is just a standard XML file that can
be created by virtually any text editor you have in your system.
The Definition.xml file has the following structure:

Figure 1. The Definition.xml file general
structure.
Each shape in a collection is defined in a <Shape> tag with the following structure:

Figure 2. The <Shape>
tag structure
The following table describe all tags used in the Definition.xml file.
| Tag Name |
Attributes |
Child Nodes |
Purposes |
|---|---|---|---|
| Shapes |
|
Shape |
Defining a collection of stencils |
| Shape |
|
Properties Behaviors Actions Content |
Defining a stencil |
|
Properties |
PropertyGroup |
Container tag holding all
properties of a stencil |
|
|
PropertyGroup |
|
Property |
Container tag to logically
divide property into named group. |
|
Property |
|
Defining a stencil property |
|
|
Behaviors |
For |
Container tag holding all
behaviors of a stencil |
|
|
For |
|
predefined behavior tags. See Pencil Predefined Behaviors. |
Defining a set of behaviors that
govern a specific SVG element. The ref
attribure specifies which SVG element in the content section is
governed by the current behavior set. |
|
Actions |
Action |
Container tag holding all
available external actions that the current stencil can accept. |
|
|
Action |
|
Impl |
Defining an external action. |
|
Impl |
Holding the Javascript
implementation of the action. |
||
|
Content |
SVG elements |
Defining the stencil look by
mean of SVG elements. |