<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
      "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-canvas-polyline-model">

	<refnamediv>
		<refname>goocanvas.PolylineModel</refname>
		<refpurpose>A model for polyline items (a series of lines with optional arrows).</refpurpose>
	</refnamediv>
	
	<refsect1>
		<title>Synopsis</title>
	
		<classsynopsis language="python">
			<ooclass><classname>goocanvas.PolylineModel</classname></ooclass>
			<ooclass><classname>goocanvas.ItemModelModelSimple</classname></ooclass>
			
			<constructorsynopsis language="python">
				<methodname><link linkend="constructor-canvas-polyline-model">goocanvas.PolylineModel</link></methodname>
				<methodparam><parameter role="keyword">properties</parameter><initializer>None</initializer></methodparam>
			</constructorsynopsis>
		</classsynopsis>
<programlisting>
<emphasis role="bold">Functions</emphasis>
<methodsynopsis language="python">
	<methodname><link linkend="function-goocanvas--polyline-model-new-line">goocanvas.polyline_model_new_line</link></methodname>
	<methodparam><parameter role="keyword">parent</parameter></methodparam>
	<methodparam><parameter role="keyword">x1</parameter></methodparam>
	<methodparam><parameter role="keyword">y1</parameter></methodparam>
	<methodparam><parameter role="keyword">x2</parameter></methodparam>
	<methodparam><parameter role="keyword">y2</parameter></methodparam>
	<methodparam><parameter role="keyword">properties</parameter></methodparam>
</methodsynopsis></programlisting>
	</refsect1>

	<refsect1>
		<title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
	+-- <link linkend="class-canvas-item-model-model-simple">goocanvas.ItemModelModelSimple</link>
		+-- <link linkend="class-canvas-polyline-model">goocanvas.PolylineModel</link>
</synopsis>

	</refsect1>
	
	<refsect1 id="properties-goocanvaspolyline-model">
		<title>goocanvas.PolylineModel Properties</title>
	
		<blockquote role="properties">
			<informaltable pgwide="1" frame="none">
				<tgroup cols="3">
					<colspec column="1" colwidth="1in"/>
					<colspec column="2" colwidth="1in"/>
					<colspec column="3" colwidth="3.5in"/>
					<tbody>
						<row valign="top">
							<entry>"arrow-length"</entry>
							<entry>Read/Write</entry>
							<entry>The length of the arrows, as a multiple of the line width. Allowed values: >= 0. Default value: 5.</entry>
						</row>
						<row valign="top">
							<entry>"arrow-tip-length"</entry>
							<entry>Read/Write</entry>
							<entry>The length of the arrow tip, as a multiple of the line width. Allowed values: >= 0. Default value: 4.</entry>
						</row>
						<row valign="top">
							<entry>"arrow-width"</entry>
							<entry>Read/Write</entry>
							<entry>The width of the arrows, as a multiple of the line width. Allowed values: >= 0. Default value: 4.</entry>
						</row>
						<row valign="top">
							<entry>"close-path"</entry>
							<entry>Read/Write</entry>
							<entry>If the last point should be connected to the first. Default value: False.</entry>
						</row>
						<row valign="top">
							<entry>"end-arrow"</entry>
							<entry>Read/Write</entry>
							<entry>If an arrow should be displayed at the end of the polyline. Default value: False.</entry>
						</row>
						<row valign="top">
							<entry>"points"</entry>
							<entry>Read/Write</entry>
							<entry>The array of points.</entry>
						</row>
						<row valign="top">
							<entry>"start-arrow"</entry>
							<entry>Read/Write</entry>
							<entry>If an arrow should be displayed at the start of the polyline. Default value: False.</entry>
						</row>
					</tbody>
				</tgroup>
			</informaltable>
		</blockquote>
	</refsect1>

	<refsect1>
		<title>Implemented Interfaces</title>
		<para>
			<link linkend="class-canvas-polyline-model"><classname>goocanvas.PolylineModel</classname></link>
			implements 
			<link linkend="class-canvas-item-model"><classname>goocanvas.ItemModel</classname></link>
		</para>
	</refsect1>

	<refsect1>
		<title>Description</title>
			<link linkend="class-canvas-polyline-model"><classname>goocanvas.PolylineModel</classname></link> 
			represents a model for polyline items, which is a series of one or more lines, with optional arrows at either end.

			It is a subclass of 
			<link linkend="class-canvas-item-model-model-simple"><classname>goocanvas.ItemModelModelSimple</classname></link> 
			and so inherits all of the style properties such as "stroke-color", "fill-color" and "line-width".

			It also implements the <link linkend="class-canvas-item-model"><classname>goocanvas.ItemModel</classname></link> 
			interface, so you can use the <link linkend="class-canvas-item-model"><classname>goocanvas.ItemModel</classname></link> 
			functions such as <methodname><link linkend="method-goocanvasitemmodel--raise-">goocanvas.ItemModel.raise_()</link></methodname> 
			and <methodname><link linkend="method-goocanvasitemmodel--rotate-">goocanvas.ItemModel.rotate()</link></methodname>
	</refsect1>

	<refsect1 id="constructor-canvas-polyline-model">
		<title>Constructor</title>
		
		<programlisting><constructorsynopsis language="python">
				<methodname>goocanvas.PolylineModel</methodname>
				<methodparam><parameter role="keyword">properties</parameter><initializer>None</initializer></methodparam>
			</constructorsynopsis></programlisting>
		
		<variablelist>
			<varlistentry>
				<term><parameter role="keyword">properties</parameter>&nbsp;:</term>
				<listitem><simpara>A comma separated list of properties.</simpara></listitem>
			</varlistentry>
			<varlistentry>
				<term><emphasis>Returns</emphasis>&nbsp;:</term>
				<listitem><simpara>A new 
						<link linkend="class-canvas-polyline-model"><classname>goocanvas.PolylineModel</classname></link>
					</simpara></listitem>
			</varlistentry>
		</variablelist>
		<para>
			Creates a new canvas polyline item.
		</para>
		<para>
			Here's an example showing how to create a filled triangle with vertices at (100,100), (300,100), and (200,300).
		</para>
<programlisting>
	p_points = goocanvas.Points([(100.0, 100.0), (300.0, 100.0), (200.0, 300.0)])
	polyline = goocanvas.PolylineModel(parent = root,
                                       points=p_points,
                                       close_path=True,
                                       stroke_color="red",
                                       fill_color="blue")
</programlisting>

	</refsect1>
	<refsect1>
		<title>Functions</title>
		<refsect2 id="function-goocanvas--polyline-model-new-line">
			<title>goocanvas.polyline_model_new_line</title>
			
			<programlisting><methodsynopsis language="python">
					<methodname>goocanvas.polyline_model_new_line</methodname>
					<methodparam><parameter role="keyword">parent</parameter></methodparam>
					<methodparam><parameter role="keyword">x1</parameter></methodparam>
					<methodparam><parameter role="keyword">y1</parameter></methodparam>
					<methodparam><parameter role="keyword">x2</parameter></methodparam>
					<methodparam><parameter role="keyword">y2</parameter></methodparam>
					<methodparam><parameter role="keyword">properties</parameter></methodparam>
				</methodsynopsis></programlisting>
			
			<variablelist>
				<varlistentry>
					<term><parameter role="keyword">parent</parameter>&nbsp;:</term>
					<listitem><simpara>The parent item, or None.</simpara></listitem>
				</varlistentry>
				<varlistentry>
					<term><parameter role="keyword">x1</parameter>&nbsp;:</term>
					<listitem><simpara>The x coordinate of the start of the line.</simpara></listitem>
				</varlistentry>
				<varlistentry>
					<term><parameter role="keyword">y1</parameter>&nbsp;:</term>
					<listitem><simpara>The y coordinate of the start of the line.</simpara></listitem>
				</varlistentry>
				<varlistentry>
					<term><parameter role="keyword">x2</parameter>&nbsp;:</term>
					<listitem><simpara>The x coordinate of the end of the line.</simpara></listitem>
				</varlistentry>
				<varlistentry>
					<term><parameter role="keyword">y2</parameter>&nbsp;:</term>
					<listitem><simpara>The y coordinate of the end of the line.</simpara></listitem>
				</varlistentry>
				<varlistentry>
					<term><parameter role="keyword">properties</parameter>&nbsp;:</term>
					<listitem><simpara>A comma separated list of properties.</simpara></listitem>
				</varlistentry>
			</variablelist>
			
			<para>
				Creates a new polyline model item with a single line.
			</para>
		</refsect2>
	</refsect1>
</refentry>
