Package org.pentaho.reporting.engine.classic.core

Examples of org.pentaho.reporting.engine.classic.core.Group


                                    final GroupDataEntry[] newEntries)
  {
    final HashMap<InstanceID, RelationalGroup> groups = new HashMap();
    RelationalGroup innermostGroup = null;

    Group group = abstractReportDefinition.getRootGroup();
    while (group instanceof RelationalGroup)
    {
      final RelationalGroup rgroup = (RelationalGroup) group;
      innermostGroup = rgroup;
      groups.put(group.getObjectID(), rgroup);

      final GroupBody body = rgroup.getBody();
      if (body instanceof SubGroupBody)
      {
        final SubGroupBody subGroupBody = (SubGroupBody) body;
View Full Code Here


  public static CrosstabBuilder populateBuilder(final CrosstabGroup editedGroup,
                                                final ContextAwareDataSchemaModel reportDataSchemaModel)
  {
    CrosstabCellBody cellBody = null;
    Group group = editedGroup.getBody().getGroup();

    ArrayList<CrosstabRowGroup> rows = new ArrayList<CrosstabRowGroup>();
    ArrayList<CrosstabColumnGroup> cols = new ArrayList<CrosstabColumnGroup>();
    ArrayList<CrosstabOtherGroup> others = new ArrayList<CrosstabOtherGroup>();

    while (group != null)
    {
      if (group instanceof CrosstabOtherGroup)
      {
        CrosstabOtherGroup otherGroup = (CrosstabOtherGroup) group;
        others.add(otherGroup);
      }
      else if (group instanceof CrosstabRowGroup)
      {
        CrosstabRowGroup rowGroup = (CrosstabRowGroup) group;
        rows.add(rowGroup);
      }
      else if (group instanceof CrosstabColumnGroup)
      {
        CrosstabColumnGroup colGroup = (CrosstabColumnGroup) group;
        cols.add(colGroup);
      }
      else
      {
        break;
      }

      GroupBody body = group.getBody();
      if (body instanceof CrosstabCellBody)
      {
        cellBody = (CrosstabCellBody) body;
        break;
      }
View Full Code Here

      if (selectedElement == activeContext.getReportDefinition()  )
      {
        // execution order is important here.
        // first unlink the old root-group by setting a new one ...
        final AbstractReportDefinition report = (AbstractReportDefinition) selectedElement;
        final Group rootGroup = report.getRootGroup();

        final SubGroupBody body = new SubGroupBody();
        newGroup.setBody(body);
        report.setRootGroup(newGroup);

        // *then* you can set the old-root to the newly inserted group ..
        body.setGroup(rootGroup);

        activeContext.getUndo().addChange(ActionMessages.getString("InsertGroupAction.UndoName"),
            new InsertGroupOnReportUndoEntry(rootGroup, newGroup));
        return;
      }

      if (selectedElement instanceof RelationalGroup == false)
      {
        return;
      }
      final RelationalGroup selectedGroup = (RelationalGroup) selectedElement;

      final GroupBody bodyElement = selectedGroup.getBody();
      if (bodyElement instanceof SubGroupBody)
      {
        final SubGroupBody subGroupBodyReportElement = (SubGroupBody) bodyElement;
        final Group oldBodyContent = subGroupBodyReportElement.getGroup();

        final SubGroupBody body = new SubGroupBody();
        newGroup.setBody(body);
        subGroupBodyReportElement.setGroup(newGroup);
        body.setGroup(oldBodyContent);
View Full Code Here

      {
        throw new IllegalStateException();
      }

      final SubGroupBody subGroupBodyReportElement = (SubGroupBody) bodyElement;
      final Group oldBodyContent = subGroupBodyReportElement.getGroup();

      final SubGroupBody body = new SubGroupBody();
      newRootGroup.setBody(body);
      subGroupBodyReportElement.setGroup(newRootGroup);
      body.setGroup(oldBodyContent);
View Full Code Here

      this.newRootGroup = newRootGroup;
    }

    public void undo(final ReportDocumentContext renderContext)
    {
      final Group selectedGroup = (Group)
          ModelUtility.findElementById(renderContext.getReportDefinition(), target);
      selectedGroup.setBody(oldRootGroup);
    }
View Full Code Here

      selectedGroup.setBody(oldRootGroup);
    }

    public void redo(final ReportDocumentContext renderContext)
    {
      final Group selectedGroup = (Group)
          ModelUtility.findElementById(renderContext.getReportDefinition(), target);
      selectedGroup.setBody(newRootGroup);
    }
View Full Code Here

  {
    final LinkedHashSet<String> groups = new LinkedHashSet<String>();
    final int count = reportDefinition.getGroupCount();
    for (int i = 0; i < count; i++)
    {
      final Group g = reportDefinition.getGroup(i);
      final String groupName = g.getName();
      if (groupName != null)
      {
        groups.add(groupName);
      }
    }

    for (int i = 0; i < count; i++)
    {
      final Group g = reportDefinition.getGroup(i);
      final String groupName = g.getGeneratedName();
      if (groupName != null)
      {
        groups.add(groupName);
      }
    }
View Full Code Here

  }

  protected CrosstabOtherGroup createOtherGroup(final GroupBody body, final String column)
  {
    final Tuple tuple = predefinedGroups.getLast(column);
    final Group other = tuple.getGroup();
    if (other instanceof CrosstabOtherGroup)
    {
      predefinedGroups.remove(column, tuple);

      logger.debug(String.format("Preserving existing other group " + column));
      // 1:1 mapping, this should be ok as it is ..
      final CrosstabOtherGroup g = (CrosstabOtherGroup) other.derive(true);
      g.setBody(body);
      return g;
    }
    else
    {
View Full Code Here

    if (tuple == null)
    {
      return super.createRowGroup(cellBody, innerBody, rowDimension);
    }

    final Group other = tuple.group;
    if (ObjectUtilities.equal(tuple.dimension, rowDimension))
    {
      if (other instanceof CrosstabRowGroup)
      {
        predefinedGroups.remove(column, tuple);
        logger.debug(String.format("Preserving existing row group " + column));

        final CrosstabRowGroup og = (CrosstabRowGroup) other.derive(true);
        og.setBody(innerBody);
        createSummaryCells(cellBody, rowDimension);
        return og;
      }
      else if (other instanceof CrosstabColumnGroup)
View Full Code Here

    if (tuple == null)
    {
      return super.createColumnGroup(cellBody, innerBody, colDimension);
    }

    final Group other = tuple.group;
    if (ObjectUtilities.equal(tuple.dimension, colDimension))
    {
      if (other instanceof CrosstabColumnGroup)
      {
        predefinedGroups.remove(column, tuple);
        logger.debug(String.format("Preserving existing column group " + column));

        final CrosstabColumnGroup og = (CrosstabColumnGroup) other.derive(true);
        og.setBody(innerBody);
        createSummaryCells(cellBody, colDimension);
        return og;
      }
      else if (other instanceof CrosstabRowGroup)
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.Group

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.