KickJava   Java API By Example, From Geeks To Geeks.

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


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.model.Axis;
16 import com.tonbeller.jpivot.olap.model.Hierarchy;
17 import com.tonbeller.jpivot.olap.model.Member;
18 import com.tonbeller.jpivot.olap.navi.PlaceHierarchiesOnAxes;
19
20 /**
21  * Created on 09.12.2002
22  *
23  * @author av
24  */

25 public class TestPlaceHierarchiesOnAxes extends TestExtensionSupport implements PlaceHierarchiesOnAxes {
26
27   /**
28    * @see com.tonbeller.jpivot.olap.navi.PlaceHierarchiesOnAxes#findMemberExpression(Hierarchy)
29    */

30   public Object JavaDoc createMemberExpression(Hierarchy hier) {
31     return TestOlapModelUtils.createAxis((TestDimension)hier.getDimension());
32   }
33
34   /**
35    * @see com.tonbeller.jpivot.olap.navi.PlaceHierarchiesOnAxes#setAxis(Axis, Object[])
36    */

37   public void setQueryAxis(Axis target, Object JavaDoc[] memberExpressions) {
38     int index = model().indexOf(target);
39     if (index < 0)
40       throw new IllegalArgumentException JavaDoc("axis not found");
41     TestAxis axis = (TestAxis)memberExpressions[0];
42     for (int i = 1; i < memberExpressions.length; i++) {
43       TestAxis x = (TestAxis)memberExpressions[i];
44       axis = TestOlapModelUtils.crossJoin(axis, x);
45     }
46     model().setAxis(index, axis);
47     fireModelChanged();
48   }
49
50   public void setSlicer(Member[] members) {
51     TestAxis axis = TestOlapModelUtils.createAxis(members);
52     model().setSlicer(axis);
53     fireModelChanged();
54   }
55
56   public void setExpandAllMember(boolean expandAllMember) {
57   }
58
59   public boolean getExpandAllMember() {
60     return false;
61   }
62
63 }
64
Popular Tags