<html> <head> <title>Developer's Guide: The class Protocols</title> </head> <body bgcolor=white text=black link=blue vlink=navy alink=red> <TABLE WIDTH="100%"> <TR> <TH ALIGN="left" WIDTH="33%"><img SRC="Images/arrow-left.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Prev"></TH> <TH ALIGN="center" WIDTH="33%"><img SRC="Images/arrow-up.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Up"></TH> <TH ALIGN="right" WIDTH="33%"><img SRC="Images/arrow-right.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Next"></TH> </TR> <TR> <TD ALIGN="left"><A HREF="devguide-13.html">The class HierarchyNode </A></TD> <TD ALIGN="center"><A HREF="devguide-9.html">The Document and Graphics Classes</A></TD> <TD ALIGN="right"><A HREF="devguide-15.html">The class Selectable</A></TD> </TR> </TABLE> <HR NOSHADE> <H2><FONT face="Helvetica,Arial"><A NAME="N1"></A>The class <A NAME="N2"></A><tt>Protocols</tt></font></H2> <P>While sharing a common interface, the various types of graphics objects provide a variety of additional capabilities and interfaces. The class <tt>Protocols</tt> defines some flags that indicate the presence of certain standard extensions. These flags are boolean class variables with names of the form `<CODE>is_</CODE>*' or `<CODE>has_</CODE>*'. By default all of these flags are false. Derived classes are expected to set the appropriate flags.</P> <P>The standard flags are: <DL> <DT><B><CODE>has_properties</CODE></B><DD> <P>True, iff object can have properties. If true, the object must implement the methods <tt>AddStyle</tt>, <tt>Properties</tt>, <tt>SetProperties</tt>, <tt>ObjectChanged</tt> and <tt>ObjectRemoved</tt>. </P> <P>The class <A HREF="devguide-16.html#N2"><tt>Primitive</tt></A> provides this interface.</P> <DT><B><CODE>has_fill</CODE></B><DD> <P>True, iff object can have fill properties. If true, <CODE>has_properties</CODE> must also be true. In addition, the object must implement the method <tt>Filled</tt> and the method <tt>SetProperties</tt> must accept the fill properties.</P> <P>The class <A HREF="devguide-16.html#N2"><tt>Primitive</tt></A> provides this interface.</P> <DT><B><CODE>has_line</CODE></B><DD> <P>True, iff object can have line properties. If true, <CODE>has_properties</CODE> must also be true. In addition, the object must implement the method <tt>LineWidth</tt> and the method <tt>SetProperties</tt> must accept the line properties.</P> <P>The class <A HREF="devguide-16.html#N2"><tt>Primitive</tt></A> provides this interface.</P> <DT><B><CODE>has_font</CODE></B><DD> <P>True, iff object can have a font. If true, <CODE>has_properties</CODE> must also be true. In addition, the method <tt>SetProperties</tt> must accept the font properties.</P> <DT><B><CODE>is_Bezier</CODE></B><DD> <DT><B><CODE>is_Rectangle</CODE></B><DD> <DT><B><CODE>is_Ellipse</CODE></B><DD> <DT><B><CODE>is_Text</CODE></B><DD> <DT><B><CODE>is_Image</CODE></B><DD> <DT><B><CODE>is_Eps</CODE></B><DD> <P>Indicate the type of object.</P> <DT><B><CODE>is_Compound</CODE></B><DD> <P>True, iff the object is a compound object.</P> <DT><B><CODE>is_Group</CODE></B><DD> <P>True, iff the object is a group. A group is a compound object. A group object can be <EM>ungrouped</EM>, 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 <tt>Ungroup</tt>. (see the document method <tt>UngroupSelected</tt>)</P> <DT><B><CODE>is_Blend</CODE></B><DD> <P>True, iff the object is a blend group.</P> <DT><B><CODE>is_curve</CODE></B><DD> <P>True, iff the object can be converted to a <tt>PolyBezier</tt> object. If true, the object must implement the methods <A HREF="devguide-11.html#N6"><tt>AsBezier</tt></A> and <tt>Paths</tt>.</P> <P>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.</P> <DT><B><CODE>is_clip</CODE></B><DD> <P>True, iff the object may be used as a clip mask. If true, the methods <A HREF="devguide-15.html#N5"><tt>Hit</tt></A> and <A HREF="devguide-11.html#N9"><tt>DrawShape</tt></A> must accept an additional boolean parameter <CODE>clip</CODE> indicating whether the object is used as a clip mask.</P> </DL> </P> <HR NOSHADE> <TABLE WIDTH="100%"> <TR> <TD ALIGN="left"><A HREF="devguide-13.html">The class HierarchyNode </A></TD> <TD ALIGN="center"><A HREF="devguide-9.html">The Document and Graphics Classes</A></TD> <TD ALIGN="right"><A HREF="devguide-15.html">The class Selectable</A></TD> </TR> <TR> <TH ALIGN="left" WIDTH="33%"><img SRC="Images/arrow-left.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Prev"></TH> <TH ALIGN="center" WIDTH="33%"><img SRC="Images/arrow-up.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Up"></TH> <TH ALIGN="right" WIDTH="33%"><img SRC="Images/arrow-right.png" WIDTH="16" HEIGHT="16" ALIGN="top" ALT="Next"></TH> </TR> </TABLE> </body> </html>