Prev Up Next
The class HierarchyNode The Document and Graphics Classes The class Selectable

The class Protocols

While sharing a common interface, the various types of graphics objects provide a variety of additional capabilities and interfaces. The class Protocols defines some flags that indicate the presence of certain standard extensions. These flags are boolean class variables with names of the form `is_*' or `has_*'. By default all of these flags are false. Derived classes are expected to set the appropriate flags.

The standard flags are:

has_properties

True, iff object can have properties. If true, the object must implement the methods AddStyle, Properties, SetProperties, ObjectChanged and ObjectRemoved.

The class Primitive provides this interface.

has_fill

True, iff object can have fill properties. If true, has_properties must also be true. In addition, the object must implement the method Filled and the method SetProperties must accept the fill properties.

The class Primitive provides this interface.

has_line

True, iff object can have line properties. If true, has_properties must also be true. In addition, the object must implement the method LineWidth and the method SetProperties must accept the line properties.

The class Primitive provides this interface.

has_font

True, iff object can have a font. If true, has_properties must also be true. In addition, the method SetProperties must accept the font properties.

is_Bezier
is_Rectangle
is_Ellipse
is_Text
is_Image
is_Eps

Indicate the type of object.

is_Compound

True, iff the object is a compound object.

is_Group

True, iff the object is a group. A group is a compound object. A group object can be ungrouped, that is, the user can issue a command that replaces the group with its children, which become direct children of the group's parent. To this end, a group must provide the method Ungroup. (see the document method UngroupSelected)

is_Blend

True, iff the object is a blend group.

is_curve

True, iff the object can be converted to a PolyBezier object. If true, the object must implement the methods AsBezier and Paths.

Sketch treats the PolyBezier as a kind of `common denominator' for blending. For instance, if you try to blend a rectangle and an ellipse, both are converted to beziers and the beziers are blended.

is_clip

True, iff the object may be used as a clip mask. If true, the methods Hit and DrawShape must accept an additional boolean parameter clip indicating whether the object is used as a clip mask.


The class HierarchyNode The Document and Graphics Classes The class Selectable
Prev Up Next