Examples of CachedLayoutData


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

    final int lastElementIdx = reportElements.length - 1;
    final Element lastElement = reportElements[lastElementIdx];
    final Element firstElement = reportElements[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[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
          (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.length - 1;
    final Element lastElement = reportElements[lastElementIdx];
    final Element firstElement = reportElements[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 (int i = 1; i < lastElementIdx; i++)
    {
      final Element reportElement = reportElements[i];
      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
          (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.length - 1;
    final Element lastElement = reportElements[lastElementIdx];
    final Element firstElement = reportElements[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 (int i = 1; i < lastElementIdx; i++)
    {
      final Element reportElement = reportElements[i];
      final CachedLayoutData layoutData = ModelUtility.getCachedLayoutData(reportElement);
      final long delta = currentY - layoutData.getHeight() / 2;
      if (delta == 0)
      {
        continue;
      }

      carrier[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 (int i = 0; i < reportElements.length; i++)
    {
      final Element element = reportElements[i];
      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.length - 1);
    long currentY = topmostY;
    for (int i = 0; i < reportElements.length; i++)
    {
      final Element reportElement = reportElements[i];
      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
          (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

      throw new NullPointerException();
    }

    this.inlineEditor = inlineEditor;

    final CachedLayoutData data = ModelUtility.getCachedLayoutData(element);
    if (data == null)
    {
      removeEditor();
      return false;
    }
    final Component editorComponent = inlineEditor.getElementCellEditorComponent(this, element);
    if (editorComponent == null)
    {
      removeEditor();
      return false;
    }

    if (editorRemover == null)
    {
      final KeyboardFocusManager fm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
      editorRemover = new CellEditorRemover(fm);
      fm.addPropertyChangeListener("permanentFocusOwner", editorRemover); // NON-NLS
    }

    this.editorComponent = editorComponent;

    final float zoomFactor = getRenderContext().getZoomModel().getZoomAsPercentage();

    final int x = (int) ((getLeftBorder() + StrictGeomUtility.toExternalValue(data.getX())) * zoomFactor);
    final int y = (int) ((getTopBorder() + StrictGeomUtility.toExternalValue(data.getY())) * zoomFactor);
    final int width = (int) (StrictGeomUtility.toExternalValue(data.getWidth()) * zoomFactor);
    final int height = (int) (StrictGeomUtility.toExternalValue(data.getHeight()) * zoomFactor);
    editorComponent.setBounds(x, y, width, height);
    add(editorComponent);
    editorComponent.validate();
    inlineEditor.addCellEditorListener(this);

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.