Esempio n. 1
0
 public final Axis getAxis(String id) {
   for (Iterator<Axis> it = axes.iterator(); it.hasNext(); ) {
     Axis axis = it.next();
     if (axis.getId().equals(id)) return axis;
   }
   return null;
 }
Esempio n. 2
0
 public final Object getDefaultValue(String parameterName) {
   if (parameterName.equals(CubeView.PARAMETER_ELEMENT)) {
     for (Axis a : getAxes()) {
       for (Hierarchy h : a.getHierarchies()) {
         if (h.getElementCount() > 0) {
           return h.getElementAt(0);
         }
       }
     }
   }
   return null;
 }
Esempio n. 3
0
  /** copy constructor */
  private CubeViewImpl(CubeViewImpl cView) {
    this(cView.view, cView.srcCube, cView.authUser, (String) cView.getPropertyValue("paloSuiteID"));
    this.description = cView.description;

    // deep copy all members
    for (Axis axis : cView.axes) {
      axes.add(axis.copy());
    }

    for (Format format : cView.formats.values()) {
      Format fmCopy = format.copy();
      this.formats.put(fmCopy.getId(), fmCopy);
    }
    for (FormatRangeInfo rangeInfo : cView.formatRanges) formatRanges.add(rangeInfo.copy());

    // TODO deep copy properties...
    //		this.properties = new HashMap<String, Property>();
    properties.putAll(cView.properties);
  }
Esempio n. 4
0
 public final void setParameter(String parameterName, Object parameterValue) {
   checkPermission(Right.WRITE);
   if (!parameterName.equals(CubeView.PARAMETER_ELEMENT)) {
     return;
   }
   if (!(parameterValue instanceof Element[])) {
     return;
   }
   Element[] pars = (Element[]) parameterValue;
   Axis a = getAxis("selected");
   if (a == null) {
     return;
   }
   for (Element e : pars) {
     if (e == null) {
       continue;
     }
     AxisHierarchy ah;
     if ((ah = a.getAxisHierarchy(e.getHierarchy())) != null) {
       ah.clearSelectedElements();
       ah.addSelectedElement(e);
     }
   }
 }