Examples of CachedLayoutData


Examples of org.pentaho.reporting.designer.core.model.CachedLayoutData

    final int lastElementIdx = reportElements.size() - 1;
    final Element lastElement = reportElements.get(lastElementIdx);
    final Element firstElement = reportElements.get(0);

    final CachedLayoutData firstLayoutData = ModelUtility.getCachedLayoutData(firstElement);
    final CachedLayoutData lastLayoutData = ModelUtility.getCachedLayoutData(lastElement);

    final long firstElementY = firstLayoutData.getY();
    final long height = (lastLayoutData.getY()) - (firstElementY);

    final long incr = height / lastElementIdx;
    long currentY = firstElementY;
    currentY += incr;//start from second element

    for (Element reportElement : reportElements)
    {
      final CachedLayoutData layoutData = ModelUtility.getCachedLayoutData(reportElement);

      carrier[0] = reportElement;
      final Point2D.Double originPoint = new Point2D.Double(0, StrictGeomUtility.toExternalValue(layoutData.getY()));
      final MoveDragOperation mop =
          new MoveDragOperation(Arrays.asList(carrier), originPoint, EmptySnapModel.INSTANCE, EmptySnapModel.INSTANCE);
      mop.update(new Point2D.Double(0, StrictGeomUtility.toExternalValue(currentY)), 1);
      mop.finish();
View Full Code Here

Examples of org.pentaho.reporting.designer.core.model.CachedLayoutData

{
  private static class ElementPositionComparator implements Comparator<Element>
  {
    public int compare(final Element o1, final Element o2)
    {
      final CachedLayoutData data1 = ModelUtility.getCachedLayoutData(o1);
      final long x1 = data1.getY();
      final CachedLayoutData data2 = ModelUtility.getCachedLayoutData(o2);
      final long x2 = data2.getY();
      if (x1 < x2)
      {
        return -1;
      }
      if (x1 > x2)
View Full Code Here

Examples of org.pentaho.reporting.designer.core.model.CachedLayoutData

    long totalHeight = 0;
    long topmostY = Long.MAX_VALUE;
    long bottommostY = Long.MIN_VALUE;
    for (Element element : reportElements)
    {
      final CachedLayoutData layoutData = ModelUtility.getCachedLayoutData(element);
      totalHeight += layoutData.getHeight();
      topmostY = Math.min(topmostY, layoutData.getY());
      bottommostY = Math.max(bottommostY, layoutData.getY() + layoutData.getHeight());
    }

    final long gap = (bottommostY - topmostY - totalHeight) / (reportElements.size() - 1);
    long currentY = topmostY;
    for (Element reportElement : reportElements)
    {
      final CachedLayoutData layoutData = ModelUtility.getCachedLayoutData(reportElement);
      final long height = layoutData.getHeight();

      carrier[0] = reportElement;
      final Point2D.Double originPoint = new Point2D.Double(StrictGeomUtility.toExternalValue(layoutData.getX()), 0);
      final MoveDragOperation mop = new MoveDragOperation
          (Arrays.asList(carrier), originPoint, EmptySnapModel.INSTANCE, EmptySnapModel.INSTANCE);
      mop.update(new Point2D.Double(0, StrictGeomUtility.toExternalValue(currentY)), 1);
      mop.finish();
View Full Code Here

Examples of org.pentaho.reporting.designer.core.model.CachedLayoutData

{
  private static class ElementPositionComparator implements Comparator<Element>
  {
    public int compare(final Element o1, final Element o2)
    {
      final CachedLayoutData data1 = ModelUtility.getCachedLayoutData(o1);
      final long x1 = data1.getY();
      final CachedLayoutData data2 = ModelUtility.getCachedLayoutData(o2);
      final long x2 = data2.getY();
      if (x1 < x2)
      {
        return -1;
      }
      if (x1 > x2)
View Full Code Here

Examples of org.pentaho.reporting.designer.core.model.CachedLayoutData

    final int lastElementIdx = reportElements.size() - 1;
    final Element lastElement = reportElements.get(lastElementIdx);
    final Element firstElement = reportElements.get(0);

    final CachedLayoutData firstLayoutData = ModelUtility.getCachedLayoutData(firstElement);
    final CachedLayoutData lastLayoutData = ModelUtility.getCachedLayoutData(lastElement);

    final long height = (lastLayoutData.getX() + lastLayoutData.getWidth()) -
        (firstLayoutData.getX() + firstLayoutData.getWidth());

    final long incr = height / lastElementIdx;
    long currentY = firstLayoutData.getX() + firstLayoutData.getWidth();
    currentY += incr;//start from second element

    for (Element reportElement : reportElements)
    {
      final CachedLayoutData layoutData = ModelUtility.getCachedLayoutData(reportElement);
      final long delta = currentY - layoutData.getWidth();
      if (delta == 0)
      {
        continue;
      }

      carrier[0] = reportElement;
      final Point2D.Double originPoint = new Point2D.Double(StrictGeomUtility.toExternalValue(layoutData.getX()), 0);
      final MoveDragOperation mop = new MoveDragOperation
          (Arrays.asList(carrier), originPoint, EmptySnapModel.INSTANCE, EmptySnapModel.INSTANCE);
      mop.update(new Point2D.Double(StrictGeomUtility.toExternalValue(delta), 0), 1);
      mop.finish();
View Full Code Here

Examples of org.pentaho.reporting.designer.core.model.CachedLayoutData

{
  private static class ElementPositionComparator implements Comparator<Element>
  {
    public int compare(final Element o1, final Element o2)
    {
      final CachedLayoutData data1 = ModelUtility.getCachedLayoutData(o1);
      final long x1 = data1.getX() + data1.getWidth();
      final CachedLayoutData data2 = ModelUtility.getCachedLayoutData(o2);
      final long x2 = data2.getX() + data2.getWidth();
      if (x1 < x2)
      {
        return -1;
      }
      if (x1 > x2)
View Full Code Here

Examples of org.pentaho.reporting.designer.core.model.CachedLayoutData

    if (element instanceof Element == false)
    {
      return;
    }

    final CachedLayoutData data = ModelUtility.getCachedLayoutData((Element) element);
    if (data.isConflictsInTableMode())
    {
      final Map<InstanceID, Set<InstanceID>> conflicts = reportRenderContext.getSharedRenderer().getConflicts();
      final Set<InstanceID> instanceIDs = conflicts.get(element.getObjectID());
      final String message;
      if (instanceIDs == null || instanceIDs.isEmpty())
View Full Code Here

Examples of org.pentaho.reporting.designer.core.model.CachedLayoutData

    }
  }

  private double getParentX(final Band band)
  {
    final CachedLayoutData data = ModelUtility.getCachedLayoutData(band);
    return StrictGeomUtility.toExternalValue(data.getX());
  }
View Full Code Here

Examples of org.pentaho.reporting.designer.core.model.CachedLayoutData

    return StrictGeomUtility.toExternalValue(data.getX());
  }

  private double getParentY(final Band band)
  {
    final CachedLayoutData data = ModelUtility.getCachedLayoutData(band);
    return StrictGeomUtility.toExternalValue(data.getY());
  }
View Full Code Here

Examples of org.pentaho.reporting.designer.core.model.CachedLayoutData

    }
  }

  private double getParentX(final Band band)
  {
    final CachedLayoutData data = ModelUtility.getCachedLayoutData(band);
    return StrictGeomUtility.toExternalValue(data.getX());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.