Examples of UndoManager


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

      final ReportDocumentContext reportRenderContext = getReportRenderContext();
      if (reportRenderContext == null)
      {
        throw new IllegalStateException("No report render context? Thats bad.");
      }
      final UndoManager undo = reportRenderContext.getUndo();
      final ArrayList<UndoEntry> undos = new ArrayList<UndoEntry>();

      for (int i = 0; i < elements.length; i++)
      {
        final Element element = elements[i];
        final ElementStyleSheet styleSheet = element.getStyle();
        final Object attribute = styleSheet.getStyleProperty(metaData.getStyleKey());
        undos.add(new StyleEditUndoEntry
            (element.getObjectID(), metaData.getStyleKey(), attribute, value));
        styleSheet.setStyleProperty(metaData.getStyleKey(), value);
      }
      undo.addChange(Messages.getString("StyleChange"), new CompoundUndoEntry((UndoEntry[]) undos.toArray(new UndoEntry[undos.size()])));
    }
    return changed;
  }
View Full Code Here

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

      final ReportDocumentContext reportRenderContext = getReportRenderContext();
      if (reportRenderContext == null)
      {
        throw new IllegalStateException("No report render context? Thats bad.");
      }
      final UndoManager undo = reportRenderContext.getUndo();
      final ArrayList<UndoEntry> undos = new ArrayList<UndoEntry>();

      for (int i = 0; i < elements.length; i++)
      {
        final Element element = elements[i];
        final Expression attribute = element.getStyleExpression(metaData.getStyleKey());
        if (value == null)
        {
          undos.add(new StyleExpressionEditUndoEntry
              (element.getObjectID(), metaData.getStyleKey(), attribute, null));
          element.setStyleExpression(metaData.getStyleKey(), null);
          element.notifyNodePropertiesChanged();
        }
        else
        {
          final Expression expression = value.getInstance();
          undos.add(new StyleExpressionEditUndoEntry
              (element.getObjectID(), metaData.getStyleKey(), attribute, expression));
          element.setStyleExpression(metaData.getStyleKey(), expression);
          element.notifyNodePropertiesChanged();
        }
      }
      undo.addChange(Messages.getString("StyleChange"), new CompoundUndoEntry((UndoEntry[]) undos.toArray(new UndoEntry[undos.size()])));

    }
    return changed;
  }
View Full Code Here

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

    {
      return (UndoManager) o;
    }
    else
    {
      return new UndoManager();
    }
  }
View Full Code Here

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

      final double width = pageDefinition.getWidth();
      final float scaleFactor = getZoomAsMicropoints();
      final double scaledPosition = (e.getX() / scaleFactor) - start;
      final double position = Math.min(width, Math.max((double) 0, scaledPosition));
      final GuideLine newGuideLine = new GuideLine(position, dragged.isActive());
      final UndoManager undo = getRenderContext().getUndo();
      undo.addChange(Messages.getString("LinealComponent.ChangeGuideUndoName"),
          new UpdateHorizontalGuidelineUndoEntry(draggedGuideLineIndex, newGuideLine, dragged));
      linealModel.updateGuideLine(draggedGuideLineIndex, newGuideLine);
    }
View Full Code Here

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

      final double width = pageDefinition.getWidth();
      final double scaledPosition = (e.getX() / scaleFactor) - start;
      final double position = Math.min(width, Math.max((double) 0, scaledPosition));
      final GuideLine guideLine = new GuideLine(position, e.getButton() == MouseEvent.BUTTON1);

      final UndoManager undo = getRenderContext().getUndo();
      undo.addChange(Messages.getString("LinealComponent.AddGuideUndoName"), new AddHorizontalGuidelinesUndoEntry(guideLine));
      linealModel.addGuidLine(guideLine);
    }
View Full Code Here

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

    public void actionPerformed(final ActionEvent e)
    {
      final GuideLine newGuideLine = new GuideLine(guideLine.getPosition(), false);
      final LinealModel linealModel = getLinealModel();
      final UndoManager undo = getRenderContext().getUndo();
      undo.addChange(Messages.getString("LinealComponent.DeactivateGuideUndoEntry"),
          new UpdateHorizontalGuidelineUndoEntry(index, newGuideLine, guideLine));
      linealModel.updateGuideLine(index, newGuideLine);
    }
View Full Code Here

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

    }

    public void actionPerformed(final ActionEvent e)
    {
      final GuideLine newGuideLine = new GuideLine(oldGuideLine.getPosition(), true);
      final UndoManager undo = getRenderContext().getUndo();
      final LinealModel linealModel = getLinealModel();
      undo.addChange(Messages.getString("LinealComponent.ActivateGuideUndoEntry"),
          new UpdateHorizontalGuidelineUndoEntry(index, newGuideLine, oldGuideLine));
      linealModel.updateGuideLine(index, newGuideLine);
    }
View Full Code Here

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

    }

    public void actionPerformed(final ActionEvent e)
    {
      final LinealModel linealModel = getLinealModel();
      final UndoManager undo = getRenderContext().getUndo();
      undo.addChange(Messages.getString("LinealComponent.DeleteGuideUndoName"),
          new RemoveHorizontalGuidelineUndoEntry(guideLine));
      linealModel.removeGuideLine(guideLine);
    }
View Full Code Here

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

      type.configureDesignTimeDefaults(visualElement, Locale.getDefault());


      final ReportDocumentContext context = getActiveContext();
      final UndoManager undo = context.getUndo();
      undo.addChange(ActionMessages.getString("InsertElementAction.UndoName"),
          new ElementEditUndoEntry(band.getObjectID(), band.getElementCount(), null, visualElement));
      band.addElement(visualElement);
    }
    catch (Exception ex)
    {
View Full Code Here

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

    public void actionPerformed(final ActionEvent e)
    {
      final GuideLine newGuideLine = new GuideLine(guideLine.getPosition(), false);
      final LinealModel linealModel = getLinealModel();
      final UndoManager undo = getRenderContext().getUndo();
      undo.addChange(Messages.getString("LinealComponent.DeactivateGuideUndoEntry"),
          new UpdateVerticalGuidelineUndoEntry(index, newGuideLine, guideLine, getInstanceID()));
      linealModel.updateGuideLine(index, newGuideLine);
    }
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.