One of the goals of the Factor UI is to minimize the need to implement new types of gadgets by offering a highly reusable, orthogonal set of building blocks. However, in some cases implementing a new type of gadget is necessary, for example when writing a graphical visualization.
Bare gadgets can be constructed directly, which is useful if all you need is a custom appearance with no further behavior (see UI pen protocol ):
New gadgets are defined as subclasses of an existing gadget type, perhaps even gadget itself. Direct subclasses of gadget can be constructed using new, however some subclasses may define their own parameterized constructors (see Parameterized constructors ).