org.pentaho.aggdes.model.Dimension Java Examples

The following examples show how to use org.pentaho.aggdes.model.Dimension. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DimensionRowModel.java    From pentaho-aggdesigner with GNU General Public License v2.0 6 votes vote down vote up
public void setDimension(Dimension dimension) {
  this.dimension = dimension;
  Vector<String> hierarchyLevelVector = new Vector<String>();

  for (Hierarchy h : dimension.getHierarchies()) {
    List<? extends Level> levels = h.getLevels();
    for (Level level : levels) {
      allLevelAttributes.add(level.getAttribute());
      allLevels.add(level);
      String prefix = (dimension.getHierarchies().size() > 1) ? h.getName() + " : " : "";
      hierarchyLevelVector.add(prefix + level.getName());
    }
  }

  setLevelNames(hierarchyLevelVector);
}
 
Example #2
Source File: RuleBasedAggregateTableOutputFactory.java    From pentaho-aggdesigner with GNU General Public License v2.0 5 votes vote down vote up
private Level findLevel(Schema schema, Attribute attribute) {
    for (Dimension dimension : schema.getDimensions()) {
        for (Hierarchy hierarchy : dimension.getHierarchies()) {
            for (Level level : hierarchy.getLevels()) {
                if (level.getAttribute() == attribute) {
                    return level;
                }
            }
        }
    }
    System.out.println("failed to locate level for attribute " + attribute.getLabel());
    return null;
}
 
Example #3
Source File: MondrianSchemaGenerator.java    From pentaho-aggdesigner with GNU General Public License v2.0 5 votes vote down vote up
private Level findLevel(Schema schema, Attribute attribute) {
    for (Dimension dimension : schema.getDimensions()) {
        for (Hierarchy hierarchy : dimension.getHierarchies()) {
            for (Level level : hierarchy.getLevels()) {
                if (level.getAttribute() == attribute) {
                    return level;
                }
            }
        }
    }
    System.out.println("failed to locate level for attribute " + attribute.getLabel());
    return null;
}
 
Example #4
Source File: TileSuggester.java    From Bats with Apache License 2.0 4 votes vote down vote up
public List<? extends Dimension> getDimensions() {
  throw new UnsupportedOperationException();
}
 
Example #5
Source File: TileSuggester.java    From Quicksql with MIT License 4 votes vote down vote up
public List<? extends Dimension> getDimensions() {
  throw new UnsupportedOperationException();
}
 
Example #6
Source File: TileSuggester.java    From calcite with Apache License 2.0 4 votes vote down vote up
public List<? extends Dimension> getDimensions() {
  throw new UnsupportedOperationException();
}
 
Example #7
Source File: AggModel.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
public void setThinAgg(UIAggregate thinAgg) {

    // if thinAgg is null, clear form.
    if (thinAgg == null) {
      clearForm();
      return;
    }

    if (logger.isDebugEnabled()) {
      logger.debug("setThinAgg(" + thinAgg + ")");
      logger.debug("       agg name: " + thinAgg.getName());
      logger.debug("agg description: " + thinAgg.getName());
      logger.debug("       agg type: "
          + (thinAgg.isAlgoAgg() ? Messages.getString("agg_type_advisor") : Messages.getString("agg_type_custom")));
      logger.debug("     attributes:");
      for (Attribute attrib : thinAgg.getAttributes()) {
        logger.debug("                " + attrib.getLabel());
      }
    }

    ArrayList<DimensionRowModel> newDimensionRowModels = new ArrayList<DimensionRowModel>();
    this.thinAgg = thinAgg;
    setName(thinAgg.getName());
    setDesc(thinAgg.getDescription());

    //ensure that these get fired by sending null as previous
    firePropertyChange("name", null, name);
    firePropertyChange("desc", null, desc);

    if (connectionModel.getSchema() != null) {
      for (Dimension dim : connectionModel.getSchema().getDimensions()) {

        DimensionRowModel rowModel = new DimensionRowModel();
        rowModel.setDimension(dim);
        newDimensionRowModels.add(rowModel);
        
        //setup listener to mark model dirty when a user changes the level selection
        rowModel.addPropertyChangeListener("selectedIndex", new PropertyChangeListener() {
          public void propertyChange(PropertyChangeEvent evt) {
            setModified(true);
          }
        });

        rowModel.initSelected(thinAgg.getAttributes());
      }
      logger.debug("calling setDimensionRowModels with " + newDimensionRowModels);
      setDimensionRowModels(newDimensionRowModels);
    }
    setModified(false);
  }
 
Example #8
Source File: SchemaStub.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
public List<? extends Dimension> getDimensions() {
  return dimensions;
}