Examples of Renderer


Examples of org.pdfclown.tools.Renderer

    {file = new File(filePath);}
    catch(Exception e)
    {throw new RuntimeException(filePath + " file access error.",e);}

    // 2. Print the document!
    Renderer renderer = new Renderer();
    boolean silent = false;
    try
    {
      if(renderer.print(file.getDocument(), silent))
      {System.out.println("Print fulfilled.");}
      else
      {System.out.println("Print discarded.");}
    }
    catch(PrinterException e)
View Full Code Here

Examples of org.pdfclown.tools.Renderer

    // 2. Page rasterization.
    int pageIndex = promptPageChoice("Select the page to render", pages.size());
    Page page = pages.get(pageIndex);
    Dimension2D imageSize = page.getSize();
    Renderer renderer = new Renderer();
    BufferedImage image = renderer.render(page, imageSize);

    // 3. Save the page image!
    try
    {ImageIO.write(image,"jpg",new java.io.File(getOutputPath() + java.io.File.separator + "ContentRenderingSample.jpg"));}
    catch(IOException e)
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.Renderer

    clearPendingPageStart(event);
  }

  public boolean createRollbackInformation()
  {
    final Renderer commitableRenderer = getRenderer();
    commitableRenderer.createRollbackInformation();
    return true;
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.Renderer

                           final ReportEvent event) throws ReportProcessingException
  {
    CrosstabLayoutUtil.handleFinishPending(outputFunction, event);

    final PreparedCrosstabLayout preparedCrosstabLayout = outputFunction.getCurrentCrosstabLayout();
    final Renderer renderer = outputFunction.getRenderer();
    final int gidx = event.getState().getCurrentGroupIndex();
    final CrosstabRowGroup g = (CrosstabRowGroup) event.getReport().getGroup(gidx);

    final LayoutBuilder builder = renderer.createBufferedLayoutBuilder();

    final RenderBox titleBox = preparedCrosstabLayout.getRowHeaderTitleBox();
    final RenderBox titleSlot = CrosstabLayoutUtil.getSlot(titleBox, slotNumber);
    titleSlot.clear();
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.Renderer

  public void groupFinished(final DefaultOutputFunction outputFunction,
                            final ReportEvent event) throws ReportProcessingException
  {
    final PreparedCrosstabLayout preparedCrosstabLayout = outputFunction.getCurrentCrosstabLayout();

    final Renderer renderer = outputFunction.getRenderer();
    final LayoutBuilder builder = renderer.createBufferedLayoutBuilder();
    final int gidx = event.getState().getCurrentGroupIndex();
    final CrosstabRowGroup g = (CrosstabRowGroup) event.getReport().getGroup(gidx);

    final RenderBox titleBox = preparedCrosstabLayout.getRowFooterTitleBox();
    final RenderBox titleSlot = CrosstabLayoutUtil.getSlot(titleBox, slotNumber);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.layout.Renderer

          }
          continue;
        }

        final DefaultOutputFunction lm = (DefaultOutputFunction) outputFunction;
        final Renderer renderer = lm.getRenderer();
        pagebreakHandler.setReportState(state);

        boolean assertExpectPagebreak = false;
        if (isInRollBackMode)
        {
          // todo: Could be that we have to use the other key here..
          // was: state.getProcessKey()
          if (nextStateKey.equals(rollbackPageState))
          {
            // reached the border case. We have to insert a manual pagebreak here or at least
            // we have to force the renderer to end the page right now.
            if (AbstractReportProcessor.SHOW_ROLLBACKS)
            {
              AbstractReportProcessor.logger.debug(
                  "Paginate: Found real pagebreak position. This might be the last state we process: " + rollbackPageState);
              AbstractReportProcessor.logger.debug(
                  "Paginate:                                         : " + state.getProcessKey());
              if (restoreState != null)
              {
                AbstractReportProcessor.logger.debug(
                    "Paginate:                                         : " + restoreState.getProcessKey());
              }
              AbstractReportProcessor.logger.debug(
                  "Paginate: (Handler)                               : " + state.getAdvanceHandler());
            }
            assertExpectPagebreak = true;
            renderer.addPagebreak(state.getProcessKey());
          }
        }

        final Renderer.LayoutResult pagebreakEncountered = renderer.validatePages();
        if (AbstractReportProcessor.SHOW_ROLLBACKS)
        {
          AbstractReportProcessor.logger.debug("Validate Page returned " + pagebreakEncountered);
        }
        if (assertExpectPagebreak == true && pagebreakEncountered != Renderer.LayoutResult.LAYOUT_PAGEBREAK)
        {
          if (SHOW_ROLLBACKS)
          {
            AbstractReportProcessor.logger.debug("Paginate: Missed the pagebreak. This smells fishy!");
          }
        }

        if (pagebreakEncountered != Renderer.LayoutResult.LAYOUT_UNVALIDATABLE)
        {
          if (pagebreaksSupported && state.isArtifcialState() == false)
          {
            if (isInRollBackMode == false)
            {
              if (pageEventCount >= AbstractReportProcessor.COMMIT_RATE)
              {
                if (AbstractReportProcessor.SHOW_ROLLBACKS)
                {
                  logger.debug("Paginate: Try to apply new fallback state after commit count reached: " + state.getProcessKey());
                  logger.debug("Paginate:        : " + renderer.getLastStateKey());
                }

                fallBackState = realFallbackState;
                pageEventCount = 0;
              }
              else
              {
                pageEventCount += 1;
              }
            }
          }
        }

        if (pagebreakEncountered == Renderer.LayoutResult.LAYOUT_PAGEBREAK)
        {
          final ReportStateKey lastVisibleStateKey = renderer.getLastStateKey();
          if (isPagebreaksSupported() &&
              isInRollBackMode == false &&
              lastVisibleStateKey != null &&
              renderer.isOpen())
          {
            if (lastVisibleStateKey.equals(nextStateKey) == false)
            {
              // Roll back to the last known to be good position and process the states up to, but not
              // including the current state. This way, we can fire the page-events *before* this band
              // gets printed.
              rollbackPageState = lastVisibleStateKey;

              final ReportStateKey restoreStateProcessKey = restoreState.getProcessKey();
              if (AbstractReportProcessor.SHOW_ROLLBACKS)
              {
                AbstractReportProcessor.logger.debug(
                    "Paginate: Encountered bad break, need to roll-back: " + rollbackPageState);
                AbstractReportProcessor.logger.debug(
                    "Paginate:    Next StateKey                        : " + state.getProcessKey());
                AbstractReportProcessor.logger.debug(
                    "Paginate:    Restored Key                         : " + restoreStateProcessKey);
                AbstractReportProcessor.logger.debug(
                    "Paginate:    Position in event chain              : " + restoreState.getSequenceCounter());
              }
              if (lastVisibleStateKey.getSequenceCounter() < restoreStateProcessKey.getSequenceCounter())
              {
                if (AbstractReportProcessor.SHOW_ROLLBACKS)
                {
                  AbstractReportProcessor.logger.debug(
                      "Print: Fall back to start of page              : " + restoreStateProcessKey);
                }
                state = globalState.deriveForPagebreak();
              }
              else
              {
                if (AbstractReportProcessor.SHOW_ROLLBACKS)
                {
                  AbstractReportProcessor.logger.debug(
                      "Print: Fall back to save-state                 : " + restoreStateProcessKey);
                }
                state = restoreState.deriveForPagebreak();
              }

              final DefaultOutputFunction rollbackOutputFunction = (DefaultOutputFunction) state.getLayoutProcess().getOutputFunction();
              final Renderer rollbackRenderer = rollbackOutputFunction.getRenderer();
              rollbackRenderer.rollback();

              validate(state);

              isInRollBackMode = true;
              fallBackState = null; // there is no way we can fall-back inside a roll-back ..
              continue;
            }
            else
            {
              // The current state printed content partially on the now finished page and there is more
              // content on the currently open page. This is a in-between pagebreak, we invoke a pagebreak
              // after this state has been processed.
              if (AbstractReportProcessor.SHOW_ROLLBACKS)
              {
                AbstractReportProcessor.logger.debug("Paginate: Encountered on-going break " + lastVisibleStateKey);
              }
            }
          }
          else
          {
            if (AbstractReportProcessor.SHOW_ROLLBACKS)
            {
              if (isInRollBackMode)
              {
                if (assertExpectPagebreak == false)
                {
                  if (nextStateKey.equals(rollbackPageState) == false)
                  {
                    AbstractReportProcessor.logger.debug("X1: " + nextStateKey);
                    AbstractReportProcessor.logger.debug("X2: " + rollbackPageState);
                  }
                }
                AbstractReportProcessor.logger.debug("Paginate: Encountered a roll-back break: " + isInRollBackMode);
              }
              else
              {
                AbstractReportProcessor.logger.debug("Paginate: Encountered a good break: " + isInRollBackMode);
              }
              AbstractReportProcessor.logger.debug
                  ("Paginate:                                              : " + state.getProcessKey());
            }
            isInRollBackMode = false;
            rollbackPageState = null;
          }

          if (isPagebreaksSupported() == false)
          {
            // The commit causes all closed-nodes to become finishable. This allows the process-page
            // and the incremental-update methods to remove the nodes. For non-streaming targets (where
            // pagebreaks are possible) the commit state is managed manually
            renderer.applyAutoCommit();
          }

          if (renderer.processPage(pagebreakHandler, state.getProcessKey(), true) == false)
          {
            throw new IllegalStateException
                ("This cannot be. If the validation said we get a new page, how can we now get lost here");
          }

          if (isPagebreaksSupported() && renderer.isPendingPageHack() &&
              renderer.isCurrentPageEmpty() == false && renderer.isPageStartPending() == false)
          {
            if (AbstractReportProcessor.SHOW_ROLLBACKS)
            {
              logger.debug("Paginate: Delaying next event to allow pending pages to be processed: " + state.getProcessKey());
            }
            state = PendingPagesHandler.create(state);
          }
          else if (isPagebreaksSupported())
          {
            state = RestartOnNewPageHandler.create(state.commit());
          }
          else
          {
            state = state.commit();
          }

          // can continue safely ..
          final int newLogPageCount = outputProcessor.getLogicalPageCount();
          final int newPhysPageCount = outputProcessor.getPhysicalPageCount();

          final int result = pageStates.size() - 1;
          for (; physPageCount < newPhysPageCount; physPageCount++)
          {
            physicalMapping.add(result);
          }

          for (; logPageCount < newLogPageCount; logPageCount++)
          {
            logicalMapping.add(result);
          }

          if (state.isFinish() == false)
          {
            // A pagebreak has occured ...
            // We add all but the last state ..
            final PageState pageState = new PageState(state, outputProcessor.getPageCursor());
            pageStates.add(pageState);
          }

          if (isPagebreaksSupported())
          {
            fallBackState = state.deriveForPagebreak();
            globalState = state.deriveForStorage();
            if (AbstractReportProcessor.SHOW_ROLLBACKS)
            {
              logger.debug("Paginate: Generating new fallback state after pagebreak found: " + state.getProcessKey());
            }
            pageEventCount = 0;
            eventCount = 0;
          }
        }
        else
        {
          if (isPagebreaksSupported() == false)
          {
            renderer.applyAutoCommit();
          }

          // PageEventCount is zero on streaming exports and zero after a new rollback event is created.
          if (pageEventCount == 0 && isInRollBackMode == false &&
              pagebreakEncountered == Renderer.LayoutResult.LAYOUT_NO_PAGEBREAK)
          {
            if (AbstractReportProcessor.SHOW_ROLLBACKS)
            {
              logger.debug("Paginate: Perform incremental update: " + state.getProcessKey());
            }
            renderer.processIncrementalUpdate(false);
          }
          if (AbstractReportProcessor.SHOW_ROLLBACKS)
          {
            logger.debug("Paginate: Commit: " + state.getProcessKey() + " " + state.getAdvanceHandler());
          }
          state = state.commit();
          if (AbstractReportProcessor.SHOW_ROLLBACKS)
          {
            logger.debug("Paginate: Post Commit: " + state.getProcessKey() + " " + state.getAdvanceHandler());
          }

          if (pagebreaksSupported && fallBackState != restoreState)
          {
            final DefaultOutputFunction commitableOutputFunction =
                (DefaultOutputFunction) state.getLayoutProcess().getOutputFunction();
            final Renderer commitableRenderer = commitableOutputFunction.getRenderer();
            commitableRenderer.applyRollbackInformation();
          }
        }

      }
      return initialReportState;
View Full Code Here

Examples of org.semanticweb.owl.io.owl_rdf.Renderer

        }catch(IOException e) { return false;}
    }
   
    public static boolean save(OWLOntology ontology,String path){
    try {
      Renderer render = new Renderer();
      FileWriter writer = new FileWriter(path,false);
      render.renderOntology(ontology, writer);   
      writer.close();
    } catch (IOException e) {
      e.printStackTrace();
      return false;
    } catch (RendererException e) {
View Full Code Here

Examples of org.waveprotocol.wave.client.editor.content.Renderer

            return e;
          }
        }));

    LineRendering.registerContainer(TEXTAREA_TAGNAME, registry);
    registry.registerRenderer(TEXTAREA_TAGNAME, new Renderer() {

      @Override
      public Element createDomImpl(Renderable element) {
        Element e = DomHelper.setContentEditable(
            Document.get().createElement(TEXTAREA_TAGNAME), true, true);
View Full Code Here

Examples of org.xulfaces.annotation.faces.RENDERER

        COMPONENT componentAnnotation = typeDeclaration.getAnnotation(COMPONENT.class);
        if( (componentAnnotation != null&& (componentAnnotation.process())){
          Component component = new Component(componentAnnotation,currentClass);
          processComponentAnnotation(component, currentClass);
        }
        RENDERER rendererAnnotation = typeDeclaration.getAnnotation(RENDERER.class);
        if (rendererAnnotation != null) {
          processRendererAnnotation(rendererAnnotation, currentClass);
        }
        RENDERKIT renderKitAnnotation = typeDeclaration.getAnnotation(RENDERKIT.class);
        if (renderKitAnnotation != null) {
View Full Code Here

Examples of prefuse.render.Renderer

            m_queue.sortPickingQueue();
        // walk queue from front to back looking for hits
        for ( int i = m_queue.psize; --i >= 0; ) {
            VisualItem vi = m_queue.pitems[i];
            if ( !vi.isValid() ) continue; // in case tuple went invalid
            Renderer r = vi.getRenderer();
            if (r!=null && vi.isInteractive() && r.locatePoint(p2, vi)) {
                return vi;
            }
        }
        return null;
    }
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.