* Bug 15514 fixed [doc]: set() page overhauled
[scilab.git] / scilab / modules / graphics / help / ja_JP / property / set.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  *
5  * Copyright (C) INRIA - Djalel Abdemouche
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  * Copyright (C) 2019 - Samuel GOUGEON
8  *
9  * This file is hereby licensed under the terms of the GNU GPL v2.0,
10  * pursuant to article 5.3.4 of the CeCILL v.2.1.
11  * This file was originally licensed under the terms of the CeCILL v2.1,
12  * and continues to be available under such terms.
13  * For more information, see the COPYING file which you should have received
14  * along with this program.
15  *
16  -->
17 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18           xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
19           xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
20           xml:lang="ja" xml:id="set">
21     <refnamediv>
22         <refname>set</refname>
23         <refpurpose>グラフィックエンティティオブジェクトまたは
24             またはユーザインターフェイスオブジェクトのプロパティの値を設定する.
25         </refpurpose>
26     </refnamediv>
27     <refsynopsisdiv>
28         <title>呼び出し手順</title>
29         <synopsis>
30             set(h, prop,val)            // h(prop) = val,  h.prop = val
31             set(h, prop,val, prop2,val2, ..)
32             set(tagsPath, prop,val)
33             set(tagsPath, prop,val, prop2,val2, ..)
34
35             set('current_figure', fig)  // scf(fig)
36             set('current_axes', axes)   // sca(axes)
37             set('current_entity', h)
38         </synopsis>
39     </refsynopsisdiv>
40     <refsection>
41         <title>引数</title>
42         <variablelist>
43             <varlistentry>
44                 <term>h</term>
45                 <listitem>
46                     名前のあるプロパティを設定するエンティティの
47                     グラフィックハンドル.
48                     <literal>h</literal> はハンドルのベクトルとすることができ,
49                     この場合,プロパティを修正すると,hに含まれる全てのエンティティに
50                     適用されます.
51                     <para/>
52                 </listitem>
53             </varlistentry>
54             <varlistentry>
55                 <term>tagsPath</term>
56                 <listitem>
57                     Case-sensitive character string providing the tag or the tags-path leading
58                     to the graphic component to process.
59                     このパスはgraphicエンティティ<literal>"Tag"</literal> プロパティおよび
60                     <literal>"figuretag/entitytag"</literal> (エンティティが図の子の場合)形式による
61                     グラフィック階層におけるその親の<literal>"Tag"</literal>プロパティ
62                     から構成されます.
63                     <para/>
64                     <literal>"figuretag/entity1tag/entity2tag/entityntag/entitytag"</literal>のように
65                     より深い階層レベルも使用できます.
66                     複数のパスを検索する際にワイルドカードも使用できます.
67                     パスに一致した最初のエンティティが使用されます.
68                     <para/>
69                 </listitem>
70             </varlistentry>
71             <varlistentry>
72                 <term>prop, prop2, ...</term>
73                 <listitem>
74                     大文字と小文字を区別しない文字列:設定するプロパティの名前.
75                     <para/>
76                 </listitem>
77             </varlistentry>
78             <varlistentry>
79                 <term>val, val2, ...</term>
80                 <listitem>
81                     value to assign to the property. Its type depends on the considered property.
82                     If <varname>h</varname> and <varname>val</varname> are vectors or matrices
83                     of same size, the multiple settings are done in an element-wise way.
84                     <para/>
85                 </listitem>
86             </varlistentry>
87             <varlistentry>
88                 <term>fig</term>
89                 <listitem>
90                     Handle of a graphical figure.
91                     <para/>
92                 </listitem>
93             </varlistentry>
94             <varlistentry>
95                 <term>axes</term>
96                 <listitem>
97                     Handle of an axes.
98                     <para/>
99                 </listitem>
100             </varlistentry>
101         </variablelist>
102     </refsection>
103     <refsection>
104         <title>説明</title>
105         <para>
106             このルーチンはグラフィックエンティティまたはGUIオブジェクトの
107             特定のプロパティの値を修正する際に使用できます.
108             この場合,ハンドルにドット演算子を使用するのと等価です.
109             例えば,<literal>set(h,"background",5)</literal> は <literal>h.background = 5</literal>と等価です.
110         </para>
111         <para>存在するプロパティの全リストを取得するには,
112             <link linkend="graphics_entities">graphics_entities</link> または
113             (ユーザインタフェースオブジェクトについては)<link linkend="uicontrol">uicontrol</link>を
114             参照ください.
115         </para>
116         <para/>
117         <emphasis role="bold">set(h, prop, val)</emphasis> or
118         <emphasis role="bold">h(prop) = val</emphasis> or
119         <emphasis role="bold">h.prop = val</emphasis>
120         <para>
121             sets the property <varname>prop</varname> of the handle <varname>h</varname> to the
122             value <varname>val.</varname>.
123         </para>
124         <para>
125             When <varname>h</varname> is a matrix of handles,
126             <itemizedlist>
127                 <listitem>
128                     if <varname>val</varname> is a matrix of same size: assignments are done in a
129                     element-wise way: <literal>set(h, prop, val)</literal> sets
130                     <literal>h(1)(prop)=val(1)</literal>, <literal>h(2)(prop)=val(2)</literal>, ...,
131                     <literal>h($)(prop)=val($)</literal>.
132                     Most often, the simpler syntax <literal>h(tag) = val</literal> does it as well.
133                 </listitem>
134                 <listitem>
135                     otherwise: The same and whole <varname>val</varname> value (that may be scalar
136                     or not) is assigned to every <literal>h(i)(prop)</literal> component.
137                     <warning>
138                         If <varname>val</varname> is a cell array of same size as
139                         <varname>h</varname>, it is assigned as a whole as well. For instance,
140                         <literal>set([gcf() gca()], "user_data", {"Text", 1})</literal> will do
141                         <literal>gcf().user_data = {"Text", 1}, gca().user_data = {"Text", 1}</literal>,
142                         not <literal>gcf().user_data = "Text", gca().user_data = 1</literal>.
143                     </warning>
144                 </listitem>
145             </itemizedlist>
146         </para>
147         <para>
148             With this syntax, <varname>prop</varname> can't be an array of property names.
149             To set multiple properties with a single call to <literal>set(..)</literal>, the
150             following syntax must be used.
151         </para>
152         <para/>
153         <emphasis role="bold">set(h, prop1,val1, prop2,val2, ..)</emphasis>
154         <para>
155             sets the property <varname>prop1</varname> of the handle(s) <varname>h</varname> to the
156             value <varname>val1</varname>, its or their property <varname>prop2</varname> to the
157             value <varname>val2</varname>, etc. If <varname>h</varname> and some
158             <varname>val#</varname> are matrices of same size, element-wise assignments are done
159             for the related <varname>prop#</varname> properties, as already described for the
160             <literal>set(h, prop, val)</literal> syntax.
161         </para>
162         <para/>
163         <emphasis role="bold">set(tagsPath, prop,val)</emphasis> or
164         <emphasis role="bold">set(tagsPath, prop,val, prop2,val2, ..)</emphasis>
165         <para>
166             Identifying the targeted component(s) to be set can be done as well through their
167             .tag property instead of their handle. This is achieved through the
168             <varname>tagsPath</varname>.
169         </para>
170         <para>
171             In case of multiple entities matching the path, only the first one is processed.
172             Conversely, finding no matching entity yields an error.
173         </para>
174         <para/>
175         <emphasis role="bold">set("current_figure", fig)</emphasis>
176         <para>
177             sets the figure of handle <varname>fig</varname> as the active figure. This syntax
178             is equivalent to <literal>scf(fig)</literal> or <literal>scf(figure_id)</literal>,
179             that are shorter and may be prefered.
180         </para>
181         <para/>
182         <emphasis role="bold">set("current_axes", axes)</emphasis>
183         <para>
184             sets the axes of handle <varname>axes</varname> as the active one. This syntax
185             is equivalent to <literal>sca(axes)</literal> that is shorter and may be prefered.
186         </para>
187         <para/>
188         <emphasis role="bold">set("current_entity", h)</emphasis>
189         <para>
190             sets the graphical component whose <literal>h(1)</literal> is the handle as the
191             current component, as returned by <literal>gce()</literal>. If <varname>h</varname>
192             is a vector of handles, other components <literal>h(2:$)</literal> are ignored.
193         </para>
194     </refsection>
195     <refsection>
196         <title>例</title>
197         <para>
198             <programlisting role="example"><![CDATA[
199 gda().auto_clear = "off";
200 clf
201 // Plot 2Dの例
202 x = [-.2:0.1:2*%pi]';
203 plot2d(x-.3, [sin(x-1) cos(2*x)], [1 2] );
204 a = gca();
205 p1 = a.children.children(1);
206 p2 = a.children.children(2);
207
208 // 名前のあるプロパティをオブジェクト固有の値に設定
209 p2.thickness = 2;
210 set(p2, "foreground",13, "polyline_style",2);
211 a.y_location = "middle";
212 a.tight_limits = "on";
213 set(a, "box","off", "sub_tics",[7 0]);
214 set(p1, "mark_mode","on", "mark_style",3);
215
216 plot2d(x-2,x.^2/20);
217 p3 = a.children(1).children;
218 set([a p1 p2 p3], "foreground",5);
219          ]]></programlisting>
220         </para>
221         <para>
222         With a vector of handles:
223         </para>
224         <programlisting role="example"><![CDATA[
225 // With distinct element-wise inputs:
226 clf, plot2d()
227 [gcf() gca()].tag
228 set([gcf() gca()], "tag", ["myFigure" "myAxes"]);
229 [gcf() gca()].tag
230      ]]></programlisting>
231         <screen><![CDATA[
232 --> [gcf() gca()].tag
233  ans  =
234 !  !
235 !  !
236
237 --> set([gcf() gca()], "tag", ["myFigure" "myAxes"]);
238
239 --> [gcf() gca()].tag
240  ans  =
241 !myFigure  !
242 !myAxes    !
243 ]]></screen>
244     <para/>
245         <programlisting role="example"><![CDATA[
246 // With the same input for all recipients:
247 clf, plot()
248 curves = gce().children;
249 set([gca() ; curves], "thickness", 2);
250 curves(1:20).thickness = 1; // shorter than set(curves(1:20), "thickness", 1)
251      ]]></programlisting>
252         <para>
253             Using a tagsPath :
254         </para>
255         <para>
256             <programlisting role="example"><![CDATA[
257 f = figure("dockable", "off", "menubar", "none", "toolbar", "none", "infobar_visible", "off", "tag", "mainfig");
258 frameHandle = uicontrol("parent", f, "style", "frame", "position", [200 200 190 100], "tag", "myframe");
259 btnHandle = uicontrol("parent", frameHandle, "position", [20 20 150 30], "string", "button", "tag", "example");
260 set("mainfig/myframe/example", "string", "complete path");
261 get("mainfig/myframe/example", "string")
262 set("mainfig/*/example", "string", "wildcard path");
263 get("mainfig/*/example", "string")
264 set("myframe/example", "string", "partial path");
265 get("myframe/example", "string")
266  ]]></programlisting>
267         </para>
268     </refsection>
269     <refsection role="see also">
270         <title>参照</title>
271         <simplelist type="inline">
272             <member>
273                 <link linkend="get">get</link>
274             </member>
275             <member>
276                 <link linkend="scf">scf</link>
277             </member>
278             <member>
279                 <link linkend="sdf">sdf</link>
280             </member>
281             <member>
282                 <link linkend="sca">sca</link>
283             </member>
284             <member>
285                 <link linkend="sda">sda</link>
286             </member>
287             <member>
288                 <link linkend="delete">delete</link>
289             </member>
290             <member>
291                 <link linkend="copy">copy</link>
292             </member>
293             <member>
294                 <link linkend="move">move</link>
295             </member>
296             <member>
297                 <link linkend="graphics_entities">graphics_entities</link>
298             </member>
299         </simplelist>
300     </refsection>
301     <refsection>
302         <title>履歴</title>
303         <revhistory>
304             <revision>
305                 <revnumber>5.5.0</revnumber>
306                 <revremark>
307                     <itemizedlist>
308                         <listitem>
309                             最初の入力引数をグラフィックエンティティを指すパスとすることが できるようになりました.
310                         </listitem>
311                         <listitem>
312                             複数のプロパティ設定を一度に利用できるようになりました.
313                         </listitem>
314                     </itemizedlist>
315                 </revremark>
316             </revision>
317         </revhistory>
318     </refsection>
319 </refentry>