Esempio n. 1
0
  // This is called if the upload is finished.
  public void uploadSucceeded(final Upload.SucceededEvent event) {
    // Log the upload on screen.
    root.addComponent(
        new Label(
            "File " + event.getFilename() + " of type '" + event.getMIMEType() + "' uploaded."));

    // Display the uploaded file in the image panel
    final StreamSource streamSource = new IconStreamSource(outputStream);
    final StreamResource imageResource =
        new StreamResource(streamSource, event.getFilename(), getApplication());

    imagePanel.removeAllComponents();
    imagePanel.addComponent(new Embedded("", imageResource));

    final Set graphVisualization = findGraphVisualization();
    // final Set representationOfSemanticIdentity =
    // findRepresentationOfSemanticIdentity(visualizedGraph);
    final String iconContent = new String(outputStream.toByteArray());
    findIcon(graphVisualization).identity().setPayload(iconContent);

    /*
    final FileResource imageResource =
            new FileResource(file, getApplication());
    imagePanel.removeAllComponents();
    imagePanel.addComponent(new Embedded("", imageResource));
    */
  }