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

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


    paper.setImageableArea
        (StrictGeomUtility.toExternalValue(page.getImageableX()),
            StrictGeomUtility.toExternalValue(page.getImageableY()),
            StrictGeomUtility.toExternalValue(page.getImageableWidth()),
            StrictGeomUtility.toExternalValue(page.getImageableHeight()));
    drawArea = new StrictBounds(page.getGlobalX(), page.getGlobalY(),
        page.getWidth(), page.getHeight());
    plainTextPage = new PlainTextPage(paper, driver, encoding);
    startProcessing(logicalPage);
    plainTextPage.writePage();
  }
View Full Code Here


        StrictGeomUtility.toExternalValue(logicalPage.getPageWidth()),
        StrictGeomUtility.toExternalValue(logicalPage.getPageHeight()));
    paper.setSize(logicalPage.getPageWidth(), logicalPage.getPageHeight());
    paper.setImageableArea(0, 0, logicalPage.getPageWidth(), logicalPage.getPageHeight());

    drawArea = new StrictBounds(0, 0, logicalPage.getWidth(), logicalPage.getHeight());
    plainTextPage = new PlainTextPage(paper, driver, encoding);
    startProcessing(logicalPage);
    plainTextPage.writePage();
  }
View Full Code Here

public class StrictBoundsTest extends TestCase
{
  public void testIntersection ()
  {
    final StrictBounds testArea = new StrictBounds(100, 100, 100, 100);

    assertFalse(StrictBounds.intersects(testArea, new StrictBounds(0, 0, 10, 10)));
    assertFalse(StrictBounds.intersects(testArea, new StrictBounds(150, 0, 10, 10)));
    assertFalse(StrictBounds.intersects(testArea, new StrictBounds(210, 0, 10, 10)));
    assertFalse(StrictBounds.intersects(testArea, new StrictBounds(0, 150, 10, 10)));
    assertFalse(StrictBounds.intersects(testArea, new StrictBounds(210, 150, 10, 10)));
    assertFalse(StrictBounds.intersects(testArea, new StrictBounds(0, 210, 10, 10)));
    assertFalse(StrictBounds.intersects(testArea, new StrictBounds(150, 210, 10, 10)));
    assertFalse(StrictBounds.intersects(testArea, new StrictBounds(210, 210, 10, 10)));

    assertTrue(StrictBounds.intersects(testArea, new StrictBounds(95, 95, 10, 10)));
    assertTrue(StrictBounds.intersects(testArea, new StrictBounds(95, 150, 10, 10)));
    assertTrue(StrictBounds.intersects(testArea, new StrictBounds(95, 195, 10, 10)));
    assertTrue(StrictBounds.intersects(testArea, new StrictBounds(150, 95, 10, 10)));
    assertTrue(StrictBounds.intersects(testArea, new StrictBounds(150, 150, 10, 10)));
    assertTrue(StrictBounds.intersects(testArea, new StrictBounds(150, 195, 10, 10)));
    assertTrue(StrictBounds.intersects(testArea, new StrictBounds(195, 95, 10, 10)));
    assertTrue(StrictBounds.intersects(testArea, new StrictBounds(195, 150, 10, 10)));
    assertTrue(StrictBounds.intersects(testArea, new StrictBounds(195, 195, 10, 10)));

  }
View Full Code Here

    if (value instanceof Image)
    {
      try
      {
        final StrictBounds contentBounds = sheetLayout.getBounds(rectangle);
        final ImageContainer imageContainer = new DefaultImageReference((Image) value);
        createImageCell(rawSource, imageContainer, sheetLayout, rectangle, contentBounds);
      }
      catch (final IOException ioe)
      {
        // Should not happen.
        logger.warn("Failed to process AWT-Image in Excel-Export", ioe);
      }
      return true;
    }
    else if (value instanceof ImageContainer)
    {
      final ImageContainer imageContainer = (ImageContainer) value;
      final StrictBounds contentBounds = sheetLayout.getBounds(rectangle);
      createImageCell(rawSource, imageContainer, sheetLayout, rectangle, contentBounds);
      return true;
    }
    else if (value instanceof DrawableWrapper)
    {
      final DrawableWrapper drawable = (DrawableWrapper) value;
      final StrictBounds contentBounds = sheetLayout.getBounds(rectangle);
      final ImageContainer imageFromDrawable =
          RenderUtility.createImageFromDrawable(drawable, contentBounds, content.getComputedStyle(), getMetaData());
      createImageCell(rawSource, imageFromDrawable, sheetLayout, rectangle, contentBounds);
      return true;
    }
View Full Code Here

  {
    final long x = getXPosition(rectangle.getX1());
    final long y = getYPosition(rectangle.getY1());
    final long width = getCellWidth(rectangle.getX1(), rectangle.getX2());
    final long height = sheetLayout.getRowHeight(rectangle.getY1(), rectangle.getY2());
    return new StrictBounds(x, y, width, height);
  }
View Full Code Here

      final double x2 = Math.max(normalizedSelectionRectangleOrigin.getX(), normalizedSelectionRectangleTarget.getX());

      final RenderNode[] allNodes = pageDrawable.getNodesAt(x1, y1, x2 - x1, y2 - y1, null, null);
      final ReportSelectionModel selectionModel = renderContext.getSelectionModel();
      final HashMap<InstanceID, Element> id = rendererRoot.getElementsById();
      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 RenderNode node = allNodes[i];
        final InstanceID instanceId = node.getInstanceId();

        final Element element = id.get(instanceId);
        if (element == null || element instanceof RootLevelBand)
        {
          continue;
        }
        final CachedLayoutData data = ModelUtility.getCachedLayoutData(element);
        rect2.setRect(data.getX(), data.getY(), data.getWidth(), data.getHeight());
        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

    }

    final CachedLayoutData data = ModelUtility.getCachedLayoutData(element);
    if (data.getLayoutAge() == age)
    {
      data.addAdditionalBounds(new StrictBounds(box.getX(), box.getY(), box.getWidth(), box.getHeight()));
      return true;
    }

    horizontalEdgePositions.add(box.getX(), box.getInstanceId());
    horizontalEdgePositions.add(box.getX() + box.getWidth(), box.getInstanceId());
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.