1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package ifc.drawing;
29 
30 import lib.MultiPropertyTest;
31 import lib.Status;
32 
33 /**
34 * Testing <code>com.sun.star.drawing.RotationDescriptor</code>
35 * service properties :
36 * <ul>
37 *  <li><code> RotateAngle</code></li>
38 *  <li><code> ShearAngle</code></li>
39 * </ul> <p>
40 * Properties testing is automated by <code>lib.MultiPropertyTest</code>.
41 * @see com.sun.star.drawing.RotationDescriptor
42 */
43 public class _RotationDescriptor extends MultiPropertyTest {
44 
45     /**
46      * Custom tester which increases value by 200
47      */
48     protected PropertyTester drawMeasureTester = new PropertyTester() {
49         protected Object getNewValue(String propName, Object oldValue) {
50             int val = ((Integer)oldValue).intValue() ;
51             return new Integer(val + 200) ;
52         }
53     } ;
54 
55     /**
56      * !!! DEPRECATED !!!
57      */
58     public void _RotationPointX() {
59         log.println("Testing with custom Property tester") ;
60         testProperty("RotationPointX", drawMeasureTester) ;
61     }
62 
63     /**
64      * !!! DEPRECATED !!!
65      */
66     public void _RotationPointY() {
67         log.println("Testing with custom Property tester") ;
68         testProperty("RotationPointY", drawMeasureTester) ;
69     }
70 
71     /**
72      * Tests the property with custom tester
73      */
74     public void _ShearAngle() {
75 
76         Object noShear = tEnv.getObjRelation("NoShear");
77 
78         if (noShear != null) {
79             log.println("This shape type doesn't support shear, see #85556#");
80             tRes.tested("ShearAngle",Status.skipped(true));
81             return;
82         }
83 
84         try {
85             oObj.setPropertyValue("RotateAngle",new Short((short) 0));
86         } catch (Exception e) {
87         }
88         log.println("Testing with custom Property tester") ;
89         testProperty("ShearAngle", drawMeasureTester) ;
90     }
91 
92     /**
93      * Tests the property with custom tester
94      */
95     public void _RotateAngle() {
96         log.println("Testing with custom Property tester") ;
97         testProperty("RotateAngle", drawMeasureTester) ;
98     }
99 
100 }  // finish class _RotationDescriptor
101 
102 
103