1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package ifc.drawing;
25 
26 import com.sun.star.beans.PropertyValue;
27 import com.sun.star.drawing.LineDash;
28 import lib.MultiPropertyTest;
29 
30 /**
31 * Testing <code>com.sun.star.drawing.LineProperties</code>
32 * service properties :
33 * <ul>
34 *  <li><code> LineStyle</code></li>
35 *  <li><code> LineDash</code></li>
36 *  <li><code> LineColor</code></li>
37 *  <li><code> LineTransparence</code></li>
38 *  <li><code> LineWidth</code></li>
39 *  <li><code> LineJoint</code></li>
40 *  <li><code> LineStartName</code></li>
41 *  <li><code> LineStart</code></li>
42 *  <li><code> LineEnd</code></li>
43 *  <li><code> LineStartCenter</code></li>
44 *  <li><code> LineStartWidth</code></li>
45 *  <li><code> LineEndCenter</code></li>
46 *  <li><code> LineEndWidth</code></li>
47 * </ul> <p>
48 * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
49 * @see com.sun.star.drawing.LineProperties
50 */
51 public class _LineProperties extends MultiPropertyTest {
52 
53     /**
54      * Tester used for property LineStartName which can have
55      * only predefined String values.
56      */
57     protected PropertyTester LineTester = new PropertyTester() {
58         protected Object getNewValue(String propName, Object oldValue)
59                 throws java.lang.IllegalArgumentException {
60             if (oldValue.equals("Arrow"))
61                 return "Square"; else
62                 return "Arrow";
63         }
64     }  ;
65 
66     /**
67      * The property switched between 'Square' and 'Arrow' values.
68      */
_LineStartName()69     public void _LineStartName() {
70         log.println("Testing with custom Property tester");
71         testProperty("LineStartName", LineTester) ;
72     }
73 
_LineDash()74     public void _LineDash() {
75         LineDash aLineDash = new LineDash();
76         LineDash aLineDash2 = new LineDash();
77         aLineDash.DashLen = 5;
78         aLineDash2.DashLen = 1;
79         testProperty("LineDash",aLineDash,aLineDash2);
80     }
81 }
82 
83