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 height = (lastLayoutData.getX() + lastLayoutData.getWidth() / 2) -
        (firstLayoutData.getX() + firstLayoutData.getWidth() / 2);

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

    for (Element reportElement : reportElements)
    {
      final CachedLayoutData layoutData = ModelUtility.getCachedLayoutData(reportElement);
      final long delta = currentY - layoutData.getWidth() / 2;
      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() / 2;
      final CachedLayoutData data2 = ModelUtility.getCachedLayoutData(o2);
      final long x2 = data2.getX() + data2.getWidth() / 2;
      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.getY() + lastLayoutData.getHeight()) -
        (firstLayoutData.getY() + firstLayoutData.getHeight());

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

    for (int i = 1; i < lastElementIdx; i++)
    {
      final Element reportElement = reportElements.get(i);
      final CachedLayoutData layoutData = ModelUtility.getCachedLayoutData(reportElement);
      final long delta = currentY - layoutData.getHeight();
      if (delta == 0)
      {
        continue;
      }

      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(delta)), 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() + data1.getHeight();
      final CachedLayoutData data2 = ModelUtility.getCachedLayoutData(o2);
      final long x2 = data2.getY() + data2.getHeight();
      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()) - (firstLayoutData.getX());

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

    for (Element reportElement : reportElements)
    {
      carrier[0] = reportElement;
      final CachedLayoutData layoutData = ModelUtility.getCachedLayoutData(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(currentY), 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();
      final CachedLayoutData data2 = ModelUtility.getCachedLayoutData(o2);
      final long x2 = data2.getX();
      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.getY() + lastLayoutData.getHeight() / 2) -
        (firstLayoutData.getY() + firstLayoutData.getHeight() / 2);

    final long incr = height / lastElementIdx;
    long currentY = firstLayoutData.getY() + firstLayoutData.getHeight() / 2;
    currentY += incr;//start from second element

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

      carrier.set(0, reportElement);
      final Point2D.Double originPoint = new Point2D.Double(0, StrictGeomUtility.toExternalValue(layoutData.getY()));

      final MoveDragOperation mop = new MoveDragOperation
          (carrier, originPoint, EmptySnapModel.INSTANCE, EmptySnapModel.INSTANCE);
      mop.update(new Point2D.Double(0, StrictGeomUtility.toExternalValue(delta)), 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 topmostY = Long.MAX_VALUE;
    long bottommostY = Long.MIN_VALUE;

    for (Element element : reportElements)
    {
      final CachedLayoutData layoutData = ModelUtility.getCachedLayoutData(element);
      totalHeight += layoutData.getWidth();
      topmostY = Math.min(topmostY, layoutData.getX());
      bottommostY = Math.max(bottommostY, layoutData.getX() + layoutData.getWidth());
    }

    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.getWidth();

      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(currentY), 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();
      final CachedLayoutData data2 = ModelUtility.getCachedLayoutData(o2);
      final long x2 = data2.getX();
      if (x1 < x2)
      {
        return -1;
      }
      if (x1 > x2)
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.