1 13 package com.tonbeller.jpivot.mondrian; 14 15 import com.tonbeller.jpivot.core.ExtensionSupport; 16 import com.tonbeller.jpivot.olap.navi.SwapAxes; 17 18 23 public class MondrianSwapAxes extends ExtensionSupport implements SwapAxes { 24 25 28 public MondrianSwapAxes() { 29 super.setId(SwapAxes.ID); 30 } 31 32 36 public boolean canSwapAxes() { 37 MondrianModel model = (MondrianModel) getModel(); 38 mondrian.olap.Query monQuery = ((MondrianQueryAdapter)model.getQueryAdapter()).getMonQuery(); 39 if ( monQuery != null ) 40 return ( monQuery.getAxes().length == 2 ); 41 else 42 return false; 43 } 44 45 46 public void setSwapAxes(boolean swap) { 47 MondrianModel model = (MondrianModel) getModel(); 48 ((MondrianQueryAdapter)model.getQueryAdapter()).setSwapAxes(swap); 49 } 50 51 public boolean isSwapAxes() { 52 MondrianModel model = (MondrianModel) getModel(); 53 return ((MondrianQueryAdapter)model.getQueryAdapter()).isSwapAxes(); 54 } 55 56 } 57 | Popular Tags |