Package org.pentaho.reporting.designer.core.editor

Examples of org.pentaho.reporting.designer.core.editor.ReportDocumentContext


    putValue(Action.ACCELERATOR_KEY, ActionMessages.getOptionalKeyStroke("ZoomInAction.Accelerator"));
  }

  public void actionPerformed(final ActionEvent e)
  {
    final ReportDocumentContext activeContext = getActiveContext();
    if (activeContext == null)
    {
      return;
    }
    final ZoomModel zoomModel = activeContext.getZoomModel();

    final double nextZoomIn = PreviewPaneUtilities.getNextZoomIn(zoomModel.getZoomAsPercentage(), ZOOM_FACTORS);
    if (nextZoomIn == 0)
    {
      return;
View Full Code Here


    }
  }

  public void actionPerformed(final ActionEvent e)
  {
    final ReportDocumentContext activeContext = getActiveContext();
    if (activeContext == null)
    {
      return;
    }
    if (activeContext.getReportDefinition() instanceof MasterReport)
    {
      try
      {
        EditParametersAction.performEditMasterReportParameters(getReportDesignerContext(), null);
      }
View Full Code Here

  {
  }

  public void actionPerformed(final ActionEvent e)
  {
    final ReportDocumentContext activeContext = getActiveContext();
    if (activeContext == null)
    {
      return;
    }

    final CrosstabOtherGroup newGroup = new CrosstabOtherGroup();
    try
    {
      Object selectedElement = null;
      if (getSelectionModel().getSelectionCount() > 0)
      {
        selectedElement = getSelectionModel().getSelectedElement(0);
      }
      if (selectedElement instanceof CrosstabOtherGroup)
      {
        // execution order is important here.
        // first unlink the old root-group by setting a new one ...
        final CrosstabOtherGroup selectedGroup = (CrosstabOtherGroup) selectedElement;
        final GroupBody oldGroupBody = selectedGroup.getBody();
        final CrosstabOtherGroupBody newGroupBody = new CrosstabOtherGroupBody(newGroup);
        selectedGroup.setBody(newGroupBody);
        newGroup.setBody(oldGroupBody);

        activeContext.getUndo().addChange(ActionMessages.getString("InsertCrosstabOtherGroupAction.UndoName"),
            new InsertGroupBodyOnGroupUndoEntry(selectedGroup.getObjectID(), oldGroupBody, newGroupBody));
      }
      if (selectedElement instanceof CrosstabGroup)
      {
        final CrosstabGroup selectedGroup = (CrosstabGroup) selectedElement;
        final GroupBody oldGroupBody = selectedGroup.getBody();
        final CrosstabOtherGroupBody newGroupBody = new CrosstabOtherGroupBody(newGroup);
        selectedGroup.setBody(newGroupBody);
        newGroup.setBody(oldGroupBody);

        activeContext.getUndo().addChange(ActionMessages.getString("InsertCrosstabOtherGroupAction.UndoName"),
            new InsertGroupBodyOnGroupUndoEntry(selectedGroup.getObjectID(), oldGroupBody, newGroupBody));
      }
    }
    catch (Exception ex)
    {
View Full Code Here

    putValue(Action.ACCELERATOR_KEY, ActionMessages.getOptionalKeyStroke("ZoomFitPageAction.Accelerator"));
  }

  public void actionPerformed(final ActionEvent e)
  {
    final ReportDocumentContext activeContext = getActiveContext();
    if (activeContext == null)
    {
      return;
    }
View Full Code Here

    }
    if (designerContext == null)
    {
      throw new IllegalStateException();
    }
    final ReportDocumentContext activeContext = designerContext.getActiveContext();
    if (activeContext == null)
    {
      return new String[0];
    }
    final HashSet<String> columnNames = new HashSet<String>
        (Arrays.asList(activeContext.getReportDataSchemaModel().getColumnNames()));
    final ArrayList<String> retval = new ArrayList<String>();
    for (int i = 0; i < fieldDefinitions.length; i++)
    {
      final FieldDefinition fieldDefinition = fieldDefinitions[i];
      if (columnNames.contains(fieldDefinition.getName()) == false)
View Full Code Here

    updateDesignerContext(oldContext, reportDesignerContext);
  }

  protected void updateDesignerContext(final ReportDesignerContext oldContext, final ReportDesignerContext newContext)
  {
    final ReportDocumentContext oldRenderContext;
    if (oldContext != null)
    {
      oldContext.removePropertyChangeListener(ReportDesignerContext.ACTIVE_CONTEXT_PROPERTY, contextChangeHandler);
      oldRenderContext = oldContext.getActiveContext();
    }
    else
    {
      oldRenderContext = null;
    }

    final ReportDocumentContext newRenderContext;
    if (newContext != null)
    {
      newContext.addPropertyChangeListener(ReportDesignerContext.ACTIVE_CONTEXT_PROPERTY, contextChangeHandler);
      newRenderContext = newContext.getActiveContext();
    }
View Full Code Here

      final Point2D normalizedSelectionRectangleTarget = normalize(e.getPoint());
      normalizedSelectionRectangleTarget.setLocation(Math.max(0, normalizedSelectionRectangleTarget.getX()), Math.max(0, normalizedSelectionRectangleTarget
          .getY()));
      final ElementRenderer rendererRoot = getElementRenderer();
      final ReportDocumentContext renderContext = getRenderContext();

      if (clearSelectionOnDrag)
      {
        final DocumentContextSelectionModel selectionModel = renderContext.getSelectionModel();
        selectionModel.clearSelection();
        clearSelectionOnDrag = false;
      }

      selectionRectangleTarget = e.getPoint();

      // Calculate the bounding box for the selection
      final double y1 = Math.min(normalizedSelectionRectangleOrigin.getY(), normalizedSelectionRectangleTarget.getY());
      final double x1 = Math.min(normalizedSelectionRectangleOrigin.getX(), normalizedSelectionRectangleTarget.getX());
      final double y2 = Math.max(normalizedSelectionRectangleOrigin.getY(), normalizedSelectionRectangleTarget.getY());
      final double x2 = Math.max(normalizedSelectionRectangleOrigin.getX(), normalizedSelectionRectangleTarget.getX());

      final Element[] allNodes = rendererRoot.getElementsAt(x1, y1, x2 - x1, y2 - y1);
      final DocumentContextSelectionModel selectionModel = renderContext.getSelectionModel();

      // Convert between points to micro-points (1 point X 100K is a micro-point)
      final StrictBounds rect1 = StrictGeomUtility.createBounds(x1, y1, x2 - x1, y2 - y1);
      final StrictBounds rect2 = new StrictBounds();
View Full Code Here

      if (e.isShiftDown() == false)
      {
        clearSelectionOnDrag = true;
      }

      final ReportDocumentContext renderContext = getRenderContext();
      final ElementRenderer rendererRoot = getElementRenderer();

      final DocumentContextSelectionModel selectionModel = renderContext.getSelectionModel();
      final Element[] allNodes = rendererRoot.getElementsAt
          (normalizedSelectionRectangleOrigin.getX(), normalizedSelectionRectangleOrigin.getY());
      for (int i = allNodes.length - 1; i >= 0; i -= 1)
      {
        final Element element = allNodes[i];
View Full Code Here

    if (designerContext == null)
    {
      return new String[0];
    }

    final ReportDocumentContext reportContext = designerContext.getActiveContext();
    if (reportContext == null)
    {
      return new String[0];
    }

    AbstractReportDefinition definition = reportContext.getReportDefinition();
    final LinkedHashSet<String> names = new LinkedHashSet<String>();
    while (definition != null)
    {
      final CompoundDataFactory dataFactoryElement = (CompoundDataFactory) definition.getDataFactory();
      final int dataFactoryCount = dataFactoryElement.size();
View Full Code Here

  }

  public static AuthenticationData getStoredLoginData(final String baseUrl,
                                                      final ReportDesignerContext context)
  {
    final ReportDocumentContext reportRenderContext = context.getActiveContext();
    final AuthenticationStore authStore;
    if (reportRenderContext == null)
    {
      authStore = context.getGlobalAuthenticationStore();
    }
    else
    {
      authStore = reportRenderContext.getAuthenticationStore();
    }

    final AuthenticationData data = authStore.getCredentials(baseUrl);
    if (data == null)
    {
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.designer.core.editor.ReportDocumentContext

Copyright © 2018 www.massapicom. 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.