Package com.vaadin.terminal.StreamResource

Examples of com.vaadin.terminal.StreamResource.StreamSource


   
    Label processTitle = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM));
    processTitle.addStyleName(ExplorerLayout.STYLE_H3);
    processImageContainer.addComponent(processTitle);
   
    StreamSource streamSource = null;
    byte[] editorSourceExtra = repositoryService.getModelEditorSourceExtra(modelData.getId());
    if (editorSourceExtra != null) {
      InputStream svgStream = new ByteArrayInputStream(editorSourceExtra);
      TranscoderInput input = new TranscoderInput(svgStream);
     
      PNGTranscoder transcoder = new PNGTranscoder();
      try {
        // Setup output
        ByteArrayOutputStream outStream = new ByteArrayOutputStream();
        TranscoderOutput output = new TranscoderOutput(outStream);
       
        // Do the transformation
        transcoder.transcode(input, output);
        final byte[] result = outStream.toByteArray();
        outStream.close();
       
        streamSource = new StreamSource() {
          private static final long serialVersionUID = 1L;
 
          public InputStream getStream() {
            InputStream inStream = null;
            if (result != null) {
View Full Code Here


   
    Label processTitle = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM));
    processTitle.addStyleName(ExplorerLayout.STYLE_H3);
    processImageContainer.addComponent(processTitle);
   
    StreamSource streamSource = null;
    final byte[] editorSourceExtra = repositoryService.getModelEditorSourceExtra(modelData.getId());
    if (editorSourceExtra != null) {
      streamSource = new StreamSource() {
        private static final long serialVersionUID = 1L;

        public InputStream getStream() {
          InputStream inStream = null;
          try {
View Full Code Here

  public TextField getNameTextField() {
    return nameField;
  }
 
  protected void showDiagram() {
    StreamResource.StreamSource streamSource = new StreamSource() {
     
      private static final long serialVersionUID = 6993112534181068935L;

      public InputStream getStream() {
        WorkflowDefinitionConversion workflowDefinitionConversion =
View Full Code Here

    profilePanelLayout.addComponent(imageLayout);
    initPicture();
  }
 
  protected void initPicture() {
    StreamResource imageresource = new StreamResource(new StreamSource() {
      private static final long serialVersionUID = 1L;
      public InputStream getStream() {
        return picture.getInputStream();
      }
    }, user.getId(), ExplorerApp.get());
View Full Code Here

  protected void addTaskEventPicture(final org.activiti.engine.task.Event taskEvent, GridLayout eventGrid) {
    final Picture userPicture = identityService.getUserPicture(taskEvent.getUserId());
    Embedded authorPicture = null;
   
    if (userPicture != null) {
      StreamResource imageresource = new StreamResource(new StreamSource() {
        private static final long serialVersionUID = 1L;
        public InputStream getStream() {
          return userPicture.getInputStream();
        }
      }, "event_" + taskEvent.getUserId() + "." + Constants.MIMETYPE_EXTENSION_MAPPING.get(userPicture.getMimeType()), ExplorerApp.get());
View Full Code Here

   
    if(processDefinition.getDiagramResourceName() != null) {
      final InputStream definitionImageStream = repositoryService.getResourceAsStream(
        processDefinition.getDeploymentId(), processDefinition.getDiagramResourceName());
     
      StreamSource streamSource = new InputStreamStreamSource(definitionImageStream);
     
      // Creating image name based on process-definition ID is fine, since the diagram image cannot
      // be altered once deployed.
      String imageExtension = extractImageExtension(processDefinition.getDiagramResourceName());
      String fileName = processDefinition.getId() + "." + imageExtension;
View Full Code Here

          runtimeService.getActiveActivityIds(processInstance.getId()), Collections.<String>emptyList(),
          processEngineConfig.getActivityFontName(), processEngineConfig.getLabelFontName(),
          processEngineConfig.getClassLoader(), 1.0);
             
        if(definitionImageStream != null) {
          StreamSource streamSource = new InputStreamStreamSource(definitionImageStream);
         
          // Create image name
          String imageExtension = extractImageExtension(processDefinition.getDiagramResourceName());
          String fileName = processInstance.getId() + UUID.randomUUID() + "." + imageExtension;
         
View Full Code Here

      InputStream definitionImageStream = diagramGenerator.generateDiagram(bpmnModel, "png",
        runtimeService.getActiveActivityIds(processInstanceId), Collections.<String>emptyList(),
        processEngineConfig.getActivityFontName(), processEngineConfig.getLabelFontName(),
        processEngineConfig.getClassLoader(), 1.0);
     
      StreamSource streamSource = new InputStreamStreamSource(definitionImageStream);
     
      // Create image name
      String imageExtension = extractImageExtension(processDefinition.getDiagramResourceName());
      String fileName = processInstanceId + UUID.randomUUID() + "." + imageExtension;
     
View Full Code Here

      resourceLinksLayout.setSpacing(true);
      resourceLinksLayout.setMargin(true, false, false, false);
      addDetailComponent(resourceLinksLayout);
     
      for (final String resourceName : resourceNames) {
        StreamResource.StreamSource streamSource = new StreamSource() {
          public InputStream getStream() {
            return repositoryService.getResourceAsStream(deployment.getId(), resourceName);
          }
        };
        Link resourceLink = new Link(resourceName, new StreamResource(streamSource, resourceName, ExplorerApp.get()));
View Full Code Here

  protected void loadPicture() {
    Component pictureComponent = null;
    final Picture userPicture = identityService.getUserPicture(user.getId());
    if (userPicture != null) {
      StreamResource imageresource = new StreamResource(new StreamSource() {
        private static final long serialVersionUID = 1L;
        public InputStream getStream() {
          return userPicture.getInputStream();
        }
      }, user.getId() + "." + Constants.MIMETYPE_EXTENSION_MAPPING.get(userPicture.getMimeType()), ExplorerApp.get());
View Full Code Here

TOP

Related Classes of com.vaadin.terminal.StreamResource.StreamSource

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.