1 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 25 public class TestPlaceHierarchiesOnAxes extends TestExtensionSupport implements PlaceHierarchiesOnAxes { 26 27 30 public Object createMemberExpression(Hierarchy hier) { 31 return TestOlapModelUtils.createAxis((TestDimension)hier.getDimension()); 32 } 33 34 37 public void setQueryAxis(Axis target, Object [] memberExpressions) { 38 int index = model().indexOf(target); 39 if (index < 0) 40 throw new IllegalArgumentException ("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 |