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

Examples of org.pentaho.reporting.engine.classic.core.util.geom.StrictBounds


  {
    if (isValidDrawTarget(node))
    {
      if (bounds == null)
      {
        bounds = new StrictBounds(node.getX(), node.getY(), node.getWidth(), node.getHeight());
      }
      else
      {
        bounds.add(node.getX(), node.getY(), node.getWidth(), node.getHeight());
      }
View Full Code Here


  {
    if (isValidDrawTarget(box))
    {
      if (bounds == null)
      {
        bounds = new StrictBounds(box.getX(), box.getY(), box.getWidth(), box.getHeight());
      }
      else
      {
        bounds.add(box.getX(), box.getY(), box.getWidth(), box.getHeight());
      }
View Full Code Here

    return o;
  }

  protected Point2D getOffset()
  {
    final StrictBounds bounds = getElementRenderer().getRootElementBounds();
    return new Point2D.Double(StrictGeomUtility.toExternalValue(bounds.getX()),
        StrictGeomUtility.toExternalValue(bounds.getY()));
  }
View Full Code Here

      final Element[] allNodes = rendererRoot.getElementsAt(x1, y1, x2 - x1, y2 - y1);
      final DocumentContextSelectionModel selectionModel = renderContext.getSelectionModel();

      // Convert between points to micro-points (1 point X 100K is a micro-point)
      final StrictBounds rect1 = StrictGeomUtility.createBounds(x1, y1, x2 - x1, y2 - y1);
      final StrictBounds rect2 = new StrictBounds();

      for (int i = allNodes.length - 1; i >= 0; i -= 1)
      {
        final Element element = allNodes[i];
        if (element instanceof RootLevelBand)
        {
          continue;
        }

        final CachedLayoutData data = ModelUtility.getCachedLayoutData(element);
        rect2.setRect(data.getX(), data.getY(), data.getWidth(), data.getHeight());

        // Checking if the bounding box intersects an element
        if (StrictBounds.intersects(rect1, rect2))
        {
          if (selectionModel.add(element))
          {
            newlySelectedElements.add(element);
          }
        }
      }

      // second step, check which previously added elements are no longer selected by the rectangle.
      for (Iterator<Element> visualReportElementIterator = newlySelectedElements.iterator(); visualReportElementIterator.hasNext(); )
      {
        final Element element = visualReportElementIterator.next();
        final CachedLayoutData data = ModelUtility.getCachedLayoutData(element);
        rect2.setRect(data.getX(), data.getY(), data.getWidth(), data.getHeight());
        if (StrictBounds.intersects(rect1, rect2) == false)
        {
          selectionModel.remove(element);
          visualReportElementIterator.remove();
        }
View Full Code Here

  protected void processRootBand(final StrictBounds pageBounds)
  {
    if (subType == SectionSubType.WATERMARK)
    {
      final WatermarkAreaBox box = getRootBox().getWatermarkArea();
      setDrawArea(new StrictBounds(box.getX(), box.getY(), box.getWidth(), box.getHeight()));
      getGraphics().clip(createClipRect(getDrawArea()));
      startProcessing(box);
    }
    else if (subType == SectionSubType.HEADER)
    {
      final BlockRenderBox box = getRootBox().getHeaderArea();
      setDrawArea(new StrictBounds(box.getX(), box.getY(), box.getWidth(), box.getHeight()));
      getGraphics().clip(createClipRect(getDrawArea()));
      startProcessing(box);
    }
    else if (subType == SectionSubType.FOOTER)
    {
      final BlockRenderBox box = getRootBox().getFooterArea();
      setDrawArea(new StrictBounds(box.getX(), box.getY(), box.getWidth(), box.getHeight()));
      getGraphics().clip(createClipRect(getDrawArea()));
      startProcessing(box);
    }
    else
    {
      final RenderBox box = getRootBox();
      setDrawArea(new StrictBounds(box.getX(), box.getY(), box.getWidth(), box.getHeight()));
      getGraphics().clip(createClipRect(getDrawArea()));
      processBoxChilds(getRootBox());
    }
  }
View Full Code Here

  protected boolean startBox(final RenderBox box)
  {
    if (box.getLayoutNodeType() != LayoutNodeTypes.TYPE_BOX_LOGICALPAGE)
    {
      final StrictBounds bounds = new StrictBounds(box.getX(), box.getY(), box.getWidth(), box.getHeight());
      if (StrictBounds.intersects(rootElementBounds, bounds) == false)
      {
        return false;
      }
    }
View Full Code Here

  public StrictBounds getRootElementBounds()
  {
    if (logicalPageDrawable == null)
    {
      return new StrictBounds();
    }
    return (StrictBounds) logicalPageDrawable.getRootElementBounds().clone();
  }
View Full Code Here

    elementsById.clear();
    sharedRenderer.transferLocalLayout(getElement(), elementsById, verticalEdgePositions);
    final OutputProcessorMetaData outputProcessorMetaData = sharedRenderer.getLayouter().getOutputProcessorMetaData();

    logicalPageDrawable = new DesignerPageDrawable(pageBox, outputProcessorMetaData, resourceManager, element);
    final StrictBounds bounds = logicalPageDrawable.getRootElementBounds();
    computedBounds = StrictGeomUtility.createAWTRectangle(0, bounds.getY(), pageBox.getWidth(), bounds.getHeight());
    if (getVisualHeight() < computedBounds.getHeight())
    {
      setVisualHeight(computedBounds.getHeight());
    }
  }
View Full Code Here

    }
  }

  protected void processOtherNode(final RenderNode node)
  {
    final StrictBounds paragraphBounds = getParagraphBounds();
    if (isTextLineOverflow() && node.isNodeVisible(paragraphBounds, isOverflowX(), isOverflowY()) == false)
    {
      return;
    }

    super.processOtherNode(node);
    if (node.getNodeType() == LayoutNodeTypes.TYPE_NODE_TEXT)
    {
      if (node.isVirtualNode())
      {
        return;
      }

      if ((node.getX() + node.getWidth()) > (paragraphBounds.getX() + paragraphBounds.getWidth()))
      {
        // This node will only be partially visible. The end-of-line marker will not apply.
        return;
      }
      final RenderableText text = (RenderableText) node;
      if (text.isForceLinebreak())
      {
        final StyleContext currentContext = getCurrentContext();
        if (getTextLength() > 0)
        {
          currentContext.add(getText());
          clearText();
        }
        context.pop();
        final StyleContext cellContext = getCurrentContext();
        cellContext.add(currentContext.getTarget());

        context.push(new StyleContext(new Paragraph(), text.getStyleSheet(), metaData));
      }
    }
    else if (node.getNodeType() == LayoutNodeTypes.TYPE_NODE_COMPLEX_TEXT)
    {
      // todo: check if special text processing is required for RenderableComplexText nodes
//      return;
      if (node.isVirtualNode())
      {
        return;
      }

      if ((node.getX() + node.getWidth()) > (paragraphBounds.getX() + paragraphBounds.getWidth()))
      {
        // This node will only be partially visible. The end-of-line marker will not apply.
        return;
      }
      final RenderableComplexText text = (RenderableComplexText) node;
View Full Code Here

        image.scaleToFit(targetWidth, targetHeight);
        currentContext.add(image);
      }
      else if (rawObject instanceof DrawableWrapper)
      {
        final StrictBounds rect = new StrictBounds
            (node.getX(), node.getY(), node.getWidth(), node.getHeight());
        final ImageContainer ic =
            RenderUtility.createImageFromDrawable((DrawableWrapper) rawObject, rect, node, metaData);
        if (ic == null)
        {
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.util.geom.StrictBounds

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.