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

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


    final Band band = (Band) getElement();
    for (int i = 0; i < elementHandlers.size(); i++)
    {
      final XmlReadHandler readHandler = (XmlReadHandler) elementHandlers.get(i);
      final Element e = (Element) readHandler.getObject();
      band.addElement(e);
    }

  }
View Full Code Here


   * @param type the type.
   * @return The element.
   */
  public Element getElementForType(final String type)
  {
    return new Element();
  }
View Full Code Here

  public Element getElementForType(final String type)
  {
    for (int i = 0; i < factories.size(); i++)
    {
      final ElementFactory fact = (ElementFactory) factories.get(i);
      final Element element = fact.getElementForType(type);
      if (element != null)
      {
        return element;
      }
    }
View Full Code Here

   * @throws org.xml.sax.SAXException if there is a parsing error.
   */
  protected void doneParsing() throws SAXException
  {
    super.doneParsing();
    final Element band = getElement();
    if (band instanceof AbstractRootLevelBand)
    {
      final AbstractRootLevelBand arlb = (AbstractRootLevelBand) band;
      for (int i = 0; i < subReportHandlers.size(); i++)
      {
View Full Code Here

   * @throws SAXException if there is a parsing error.
   */
  protected void doneParsing() throws SAXException
  {
    super.doneParsing();
    final Element element = getElement();
    if (fieldName != null)
    {
      final GetDataRowValueExpression ex = new GetDataRowValueExpression();
      ex.setField(fieldName);
      element.setStyleExpression(ElementStyleKeys.ANCHOR_NAME, ex);
    }
    else if (formula != null)
    {
      final FormulaExpression fe = new FormulaExpression();
      fe.setFormula(formula);
      element.setStyleExpression(ElementStyleKeys.ANCHOR_NAME, fe);
    }
  }
View Full Code Here

  {
    final boolean visible = (isDataAvailable() == false);
    final Element[] elements = FunctionUtilities.findAllElements(b, getElement());
    for (int i = 0; i < elements.length; i++)
    {
      final Element element = elements[i];
      element.setVisible(visible);
    }

  }
View Full Code Here

  private void collectSubReports(final Band band) throws FunctionProcessingException
  {
    final Element[] elements = band.getElementArray();
    for (int i = 0; i < elements.length; i++)
    {
      final Element element = elements[i];
      if (element instanceof SubReport)
      {
        try
        {
          inlineSubreports.add(element.clone());
        }
        catch (CloneNotSupportedException e)
        {
          throw new FunctionProcessingException("Failed to clone subreport", e);
        }
View Full Code Here

  public void testAddElement()
  {
    final Band b = new Band();
    assertTrue(b.getElementCount() == 0);
    b.addElement(0, new Element());
    assertTrue(b.getElementCount() == 1);
    b.addElement(new Element());
    assertTrue(b.getElementCount() == 2);
    b.addElement(0, new Element());
    assertTrue(b.getElementCount() == 3);
    b.addElement(2, new Element());
    assertTrue(b.getElementCount() == 4);
    try
    {
      b.addElement(5, new Element());
      fail();
    }
    catch (IllegalArgumentException iob)
    {
      // expected, ignored
View Full Code Here

    factory.setHorizontalAlignment(ElementAlignment.LEFT);
    factory.setVerticalAlignment(ElementAlignment.MIDDLE);
    factory.setNullString("-");
    factory.setFieldname("Column1");

    final Element element1 = factory.createElement();
    report.getItemBand().addElement(element1);

    factory = new TextFieldElementFactory();
    factory.setName("T2");
    factory.setAbsolutePosition(new Point2D.Float(200, 0));
    factory.setMinimumSize(new FloatDimension(150, 20));
    factory.setColor(Color.black);
    factory.setHorizontalAlignment(ElementAlignment.LEFT);
    factory.setVerticalAlignment(ElementAlignment.MIDDLE);
    factory.setNullString("-");
    factory.setFieldname("Column2");

    final Element element2 = factory.createElement();
    report.getItemBand().addElement(element2);

    //report.getStyleSheetCollection().debug();

    report.getItemBand().removeElement(element1);
View Full Code Here

    final ByteArrayOutputStream bo = new ByteArrayOutputStream();
    final ObjectOutputStream out = new ObjectOutputStream(bo);
    out.writeObject(e);

    final ObjectInputStream oin = new ObjectInputStream(new ByteArrayInputStream(bo.toByteArray()));
    final Element e2 = (Element) oin.readObject();
    assertNotNull(e2); // cannot assert equals, as this is not implemented.
  }
View Full Code Here

TOP

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

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.