KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tonbeller > jpivot > test > olap > TestSwapAxes


1 /*
2  * ====================================================================
3  * This software is subject to the terms of the Common Public License
4  * Agreement, available at the following URL:
5  * http://www.opensource.org/licenses/cpl.html .
6  * Copyright (C) 2003-2004 TONBELLER AG.
7  * All Rights Reserved.
8  * You must accept the terms of that agreement to use this software.
9  * ====================================================================
10  *
11  *
12  */

13 package com.tonbeller.jpivot.test.olap;
14
15 import com.tonbeller.jpivot.olap.navi.SwapAxes;
16
17 /**
18  * Created on 21.10.2002
19  *
20  * @author av
21  */

22 public class TestSwapAxes extends TestExtensionSupport implements SwapAxes {
23   boolean swapped;
24   
25   TestOlapModel olapModel() {
26     return (TestOlapModel)getModel();
27   }
28
29   /**
30    * @see com.tonbeller.jpivot.olap.navi.SwapAxes#canSwapAxes()
31    */

32   public boolean canSwapAxes() {
33     return true;
34   }
35
36   public void setSwapAxes(boolean newSwapped) {
37     if (this.swapped != newSwapped) {
38       this.swapped = newSwapped;
39       TestAxis a = olapModel().getAxis(0);
40       TestAxis b = olapModel().getAxis(1);
41       olapModel().setAxis(0, b);
42       olapModel().setAxis(1, a);
43       fireModelChanged();
44     }
45   }
46
47   public boolean isSwapAxes() {
48     return swapped;
49   }
50
51
52 }
53
Popular Tags