File: devguide-14.html

package info (click to toggle)
sketch 0.6.13-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,284 kB
  • ctags: 8,453
  • sloc: python: 34,711; ansic: 16,543; makefile: 83; sh: 26
file content (120 lines) | stat: -rw-r--r-- 4,996 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<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>