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

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


      return insert.derive();
    }

    if (insert instanceof Band)
    {
      final Band band = (Band) insert;
      if (insert instanceof RootLevelBand == false)
      {
        return band.derive();
      }
      final Band newBand = new Band();
      band.copyInto(newBand);
      band.setElementType(BandType.INSTANCE);
      return newBand;
    }
View Full Code Here


      }
    }

    if (parent instanceof Band)
    {
      final Band band = (Band) parent;
      final int index = ModelUtility.findIndexOf(band, veElement);
      band.removeElement(veElement);
      return new ElementEditUndoEntry(band.getObjectID(), index, veElement, null);
    }

    if (data instanceof GroupHeader)
    {
      final RelationalGroup g = (RelationalGroup) parent;
View Full Code Here

    return derived;
  }

  private static boolean isBandedSubreport(final Element r)
  {
    final Band parent = r.getParent();
    if (parent instanceof RootLevelBand == false)
    {
      return false;
    }
    final RootLevelBand rlb = (RootLevelBand) parent;
View Full Code Here

                          new BandedSubreportEditUndoEntry(re.getObjectID(), 0, null, sr));
        }
      }
    }

    final Band parentBand = (Band) reportElement;
    final int count = parentBand.getElementCount();
    for (int i = 1; i < count; i++)
    {
      final Element visualReportElement = parentBand.getElement(i);
      if (element == visualReportElement)
      {
        parentBand.removeElement(visualReportElement);
        parentBand.addElement(0, visualReportElement);

        return new CompoundUndoEntry
                (new ElementEditUndoEntry(parentBand.getObjectID(), i, visualReportElement, null),
                        new ElementEditUndoEntry(parentBand.getObjectID(), 0, null,
                                visualReportElement));
      }
    }
    return null;
  }
View Full Code Here

    if (selectionModel1.getSelectionCount() > 0)
    {
      selectedElement = selectionModel1.getSelectedElement(0);
    }
    final Band band;
    if (selectedElement instanceof Band)
    {
      band = (Band) selectedElement;
    }
    else
    {
      return;
    }

    try
    {
      final ElementType type = metaData.create();
      final Element visualElement = (Element) type.create();
      if (visualElement instanceof SubReport)
      {
        final Element rootBand = findRootBand(band);
        if (rootBand == null ||
            rootBand instanceof PageHeader ||
            rootBand instanceof PageFooter ||
            rootBand instanceof DetailsHeader ||
            rootBand instanceof DetailsFooter ||
            rootBand instanceof Watermark)
        {
          return;
        }
      }
     
      final ElementStyleSheet styleSheet = visualElement.getStyle();
      styleSheet.setStyleProperty(ElementStyleKeys.MIN_WIDTH, DEFAULT_WIDTH);
      styleSheet.setStyleProperty(ElementStyleKeys.MIN_HEIGHT, DEFAULT_HEIGHT);

      type.configureDesignTimeDefaults(visualElement, Locale.getDefault());


      final ReportDocumentContext context = getActiveContext();
      final UndoManager undo = context.getUndo();
      undo.addChange(ActionMessages.getString("InsertElementAction.UndoName"),
          new ElementEditUndoEntry(band.getObjectID(), band.getElementCount(), null, visualElement));
      band.addElement(visualElement);
    }
    catch (Exception ex)
    {
      UncaughtExceptionsModel.getInstance().addException(ex);
    }
View Full Code Here

                  new BandedSubreportEditUndoEntry(re.getObjectID(), i - 1, null, sr));
        }
      }
    }

    final Band parentBand = (Band) reportElement;
    final int count = parentBand.getElementCount();
    for (int i = 1; i < count; i++)
    {
      final Element visualReportElement = parentBand.getElement(i);
      if (element == visualReportElement)
      {
        parentBand.removeElement(visualReportElement);
        parentBand.addElement(i - 1, visualReportElement);
        return new CompoundUndoEntry
            (new ElementEditUndoEntry(parentBand.getObjectID(), i, visualReportElement, null),
                new ElementEditUndoEntry(parentBand.getObjectID(), i - 1, null, visualReportElement));
      }
    }

    return null;
  }
View Full Code Here

  }

  public void undo(final ReportDocumentContext context)
  {
    final AbstractReportDefinition abstractReportDefinition = context.getReportDefinition();
    final Band band = (Band) ModelUtility.findElementById(abstractReportDefinition, id);
    final LinealModel linealModel = ModelUtility.getVerticalLinealModel(band);
    linealModel.updateGuideLine(index, oldGuideLine);
  }
View Full Code Here

  }

  public void redo(final ReportDocumentContext context)
  {
    final AbstractReportDefinition abstractReportDefinition = context.getReportDefinition();
    final Band band = (Band) ModelUtility.findElementById(abstractReportDefinition, id);
    final LinealModel linealModel = ModelUtility.getVerticalLinealModel(band);
    linealModel.updateGuideLine(index, guideLine);
  }
View Full Code Here

    if (selectionModel1.getSelectionCount() > 0)
    {
      selectedElement = selectionModel1.getSelectedElement(0);
    }
    final Band band;
    if (selectedElement instanceof Band)
    {
      band = (Band) selectedElement;
    }
    else
    {
      return;
    }

    ReportDesignerContext context = getReportDesignerContext();
    final Component parent = context.getView().getParent();
    final Window window = LibSwingUtil.getWindowAncestor(parent);
    final CreateTableDialog dialog;
    if (window instanceof JDialog)
    {
      dialog = new CreateTableDialog((JDialog) window);
    }
    else if (window instanceof JFrame)
    {
      dialog = new CreateTableDialog((JFrame) window);
    }
    else
    {
      dialog = new CreateTableDialog();
    }

    if (dialog.createTable() == false)
    {
      return;
    }


    try
    {
      final Band visualElement = createTable(dialog.getColumns(), dialog.getHeaderRows(), dialog.getDataRows());

      final ElementStyleSheet styleSheet = visualElement.getStyle();
      styleSheet.setStyleProperty(ElementStyleKeys.MIN_WIDTH, DEFAULT_WIDTH);
      styleSheet.setStyleProperty(ElementStyleKeys.MIN_HEIGHT, DEFAULT_HEIGHT);

      final ReportDocumentContext activeContext = getActiveContext();
      final UndoManager undo = activeContext.getUndo();
View Full Code Here

    }
  }

  public static Band createTable(final int columns, final int headerRows, final int dataRows)
  {
    final Band table = new Band();
    table.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE);
    table.getStyle().setStyleProperty(BandStyleKeys.TABLE_LAYOUT, TableLayout.fixed);

    if (headerRows > 0)
    {
      final Band tableHeader = new Band();
      tableHeader.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE_HEADER);

      for (int r = 0; r < headerRows; r += 1)
      {
        final Band row = new Band();
        row.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE_ROW);
        row.setName("r-" + r);

        for (int cellNumber = 0; cellNumber < columns; cellNumber++)
        {
          final Band cell = createCell(1, 1);
          row.addElement(cell);
        }
        tableHeader.addElement(row);
      }
      table.addElement(tableHeader);
    }

    final Band tableBody = new Band();
    tableBody.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE_BODY);
    for (int r = 0; r < dataRows; r += 1)
    {
      final Band row = new Band();
      row.getStyle().setStyleProperty(BandStyleKeys.LAYOUT, BandStyleKeys.LAYOUT_TABLE_ROW);
      row.setName("r-" + (r + headerRows));

      for (int cellNumber = 0; cellNumber < columns; cellNumber++)
      {
        final Band cell = createCell(1, 1);
        row.addElement(cell);
      }
      tableBody.addElement(row);
    }
    table.addElement(tableBody);
View Full Code Here

TOP

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

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.