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

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


      return;
    }

    // This is an attribute change event ... see if it is one we are concerned about
    final AttributeChange attributeChange = (AttributeChange) event.getParameter();
    final ReportElement reportElement = (ReportElement) event.getElement();
    final AttributeMetaData attributeDescription = reportElement.getMetaData().getAttributeDescription(attributeChange.getNamespace(), attributeChange.getName());
    if (attributeDescription == null ||
        AttributeMetaData.VALUEROLE_RESOURCE.equals(attributeDescription.getValueRole()) == false)
    {
      return;
    }

    // See if we need to load the resource's value into the resource key
    final Object newValue = attributeChange.getNewValue();
    if (newValue instanceof ResourceKey && shouldBeLoaded((ResourceKey) newValue))
    {
      try
      {
        // Embed the file and swap in the key which refers to the embedded resource
        final ResourceKey newKey = loadResourceIntoKey((ResourceKey) newValue);
        if (newKey != null)
        {
          // Swap out the old key with the new key (the new key has the resource loaded)
          reportElement.setAttribute(attributeChange.getNamespace(), attributeChange.getName(), newKey);
        }
      }
      catch (Exception e)
      {
        reportElement.setAttribute(attributeChange.getNamespace(), attributeChange.getName(), null);
        UncaughtExceptionsModel.getInstance().addException(e);
      }
    }
  }
View Full Code Here


      {
        return;
      }

      final Element velement = (Element) element;
      ReportElement parentSearch = velement;
      final Section rootBand = getElementRenderer().getElement();
      final ZoomModel zoomModel = getRenderContext().getZoomModel();
      while (parentSearch != null)
      {
        if (parentSearch == rootBand)
        {
          final SelectionOverlayInformation renderer = new SelectionOverlayInformation(velement);
          renderer.validate(zoomModel.getZoomAsPercentage());
          velement.setAttribute(ReportDesignerBoot.DESIGNER_NAMESPACE, ReportDesignerBoot.SELECTION_OVERLAY_INFORMATION, renderer, false);
          repaintConditionally();
          return;
        }
        parentSearch = parentSearch.getParentSection();
      }
    }
View Full Code Here

    {
      final Section section = (Section) element;
      final int count = section.getElementCount();
      for (int i = 0; i < count; i++)
      {
        final ReportElement e = section.getElement(i);
        if (e instanceof Element)
        {
          draw((Element) e, graphics2D);
        }
      }
View Full Code Here

    return new EditGroupsUndoEntry(entries, changedEntries);
  }

  protected UndoEntry moveVisualElement(final AbstractReportDefinition report, final Element element)
  {
    final ReportElement reportElement = element.getParentSection();
    if (reportElement instanceof Band == false)
    {
      return null;
    }
View Full Code Here

    return new EditGroupsUndoEntry(entries, changedEntries);
  }

  protected UndoEntry moveVisualElement(final AbstractReportDefinition report, final Element element)
  {
    final ReportElement reportElement = element.getParentSection();
    if (reportElement instanceof Band == false)
    {
      return null;
    }
View Full Code Here

    this.visualElements = visualElements.toArray(new ReportElement[visualElements.size()]);
    this.styleProperties = new Object[visualElements.size()][];

    for (int i = 0; i < visualElements.size(); i++)
    {
      final ReportElement visualElement = visualElements.get(i);
      styleProperties[i] = computeStyleChangeSet(visualElement);
    }
  }
View Full Code Here

  {
    final Object[][] currentStyle = new Object[visualElements.length][];
    final InstanceID[] targets = new InstanceID[visualElements.length];
    for (int i = 0; i < visualElements.length; i++)
    {
      final ReportElement visualElement = visualElements[i];
      currentStyle[i] = computeStyleChangeSet(visualElement);
      targets[i] = visualElement.getObjectID();
    }
    return new MassElementStyleUndoEntry(targets, styleProperties, currentStyle);
  }
View Full Code Here

    this.newValue = newValue;
  }

  public void undo(final ReportDocumentContext renderContext)
  {
    final ReportElement elementById = ModelUtility.findElementById(renderContext.getReportDefinition(), target);
    elementById.setStyleExpression(styleKey, oldValue);
  }
View Full Code Here

  private void iterateSection(final Section s)
  {
    final int elementCount = s.getElementCount();
    for (int i = 0; i < elementCount; i++)
    {
      final ReportElement e = s.getElement(i);
      if (e instanceof SubReport)
      {
        continue;
      }
      if (e instanceof RootLevelBand)
      {
        final CachedLayoutData layoutData = ModelUtility.getCachedLayoutData((Element) e);
        final double height = StrictGeomUtility.toExternalValue(layoutData.getHeight());
        e.setAttribute(ReportDesignerBoot.DESIGNER_NAMESPACE, "visual-height", new Double(height)); // NON-NLS
      }

      if (e instanceof Section)
      {
        iterateSection((Section) e);
View Full Code Here

    final AbstractReportDefinition reportDefinition = renderContext.getReportDefinition();
    final StyleKey[] keys = StyleKey.getDefinedStyleKeys();
    for (int i = 0; i < visualElements.length; i++)
    {
      final InstanceID visualElement = visualElements[i];
      final ReportElement element = ModelUtility.findElementById(reportDefinition, visualElement);
      final ElementStyleSheet styleSheet = element.getStyle();
      final Object[] properties = oldStyle[i];
      for (int j = 0; j < keys.length; j++)
      {
        final StyleKey key = keys[j];
        styleSheet.setStyleProperty(key, properties[key.identifier]);
View Full Code Here

TOP

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

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.