1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: _GraphicObjectShapeDescriptor.java,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 import lib
.MultiPropertyTest
;
35 import com
.sun
.star
.awt
.XBitmap
;
37 public class _GraphicObjectShapeDescriptor
extends MultiPropertyTest
{
39 protected boolean compare(Object ob1
, Object ob2
) {
41 return super.compare(ob1
, ob2
);
45 protected PropertyTester URLTester
= new PropertyTester() {
46 protected Object
getNewValue(String propName
, Object oldValue
)
47 throws java
.lang
.IllegalArgumentException
{
48 if (oldValue
.equals(util
.utils
.getFullTestURL("space-metal.jpg")))
49 return util
.utils
.getFullTestURL("crazy-blue.jpg"); else
50 return util
.utils
.getFullTestURL("space-metal.jpg");
54 protected PropertyTester BitmapTester
= new PropertyTester() {
55 protected Object
getNewValue(String propName
, Object oldValue
)
56 throws java
.lang
.IllegalArgumentException
{
57 XBitmap aBitmap1
=(XBitmap
) tEnv
.getObjRelation("Bitmap1");
58 XBitmap aBitmap2
=(XBitmap
) tEnv
.getObjRelation("Bitmap2");
59 if (oldValue
.equals(aBitmap1
)) return aBitmap2
; else return aBitmap1
;
63 public void _GraphicURL() {
64 log
.println("Testing with custom Property tester") ;
65 testProperty("GraphicURL", URLTester
) ;
68 public void _GraphicObjectFillBitmap() {
69 log
.println("Testing with custom Property tester") ;
70 testProperty("GraphicObjectFillBitmap", BitmapTester
) ;