Examples of MassElementStyleUndoEntryBuilder


Examples of org.pentaho.reporting.designer.core.util.undo.MassElementStyleUndoEntryBuilder

    {
      return;
    }
    final Element[] carrier = new Element[1];
    final Element[] objects = ModelUtility.filterParents(visualElements);
    final MassElementStyleUndoEntryBuilder builder = new MassElementStyleUndoEntryBuilder(objects);

    long maxX = Long.MIN_VALUE;
    for (int j = 0; j < objects.length; j++)
    {
      final Element object = objects[j];
      final CachedLayoutData data = ModelUtility.getCachedLayoutData(object);
      final long x1 = data.getX();
      final long x2 = x1 + data.getWidth();
      if (x2 > maxX)
      {
        maxX = x2;
      }
    }

    for (int j = 0; j < objects.length; j++)
    {
      final Element object = objects[j];
      final CachedLayoutData data = ModelUtility.getCachedLayoutData(object);
      final long elementCenter = data.getX() + data.getWidth();
      final long delta = maxX - elementCenter;
      if (delta == 0)
      {
        continue;
      }

      carrier[0] = object;
      final MoveDragOperation mop = new MoveDragOperation
          (carrier, ORIGIN_POINT, EmptySnapModel.INSTANCE, EmptySnapModel.INSTANCE);
      mop.update(new Point2D.Double(StrictGeomUtility.toExternalValue(delta), 0), 1);
      mop.finish();
    }
    final MassElementStyleUndoEntry massElementStyleUndoEntry = builder.finish();
    getActiveContext().getUndo().addChange(ActionMessages.getString("AlignRightAction.UndoName"), massElementStyleUndoEntry);
  }
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.