Exemplo n.º 1
0
 /**
  * Allow to update the progress status of the current component loading process. As the instance
  * of TPTLazyLoader is passed to your LazyLoader implementation, you may update the progress from
  * there.
  *
  * @param progress new progress. Must be specified from 0.0 to 1.0, which reflects 0% ... 100%
  *     interval. If set to 0.0, a progress indicator will be swithced to indeterminate mode,
  *     displaying an endless wheel.
  */
 public void setLoadingProgress(float progress) {
   if (progress == 0.0f) {
     progressBar.setIndeterminate(true);
   } else {
     progressBar.setIndeterminate(false);
     progressBar.setValue(progress);
   }
 }
Exemplo n.º 2
0
 protected void initUI() {
   setSizeFull();
   errorLabel.setWidth(null);
   loadingLabel.setWidth(null);
   progressBar.setIndeterminate(true);
   progressBar.setPollingInterval(500);
   progressBar.setWidth("50%");
   progressBar.setImmediate(true);
 }
Exemplo n.º 3
0
  private void handleFiles(final DragAndDropEvent dropEvent) {
    numberOfFiles = getFilesFrom(dropEvent).length;

    for (final Html5File html5File : getFilesFrom(dropEvent)) {
      if (html5File.getFileSize() > FILE_SIZE_LIMIT) {
        showFileSizeWarning();
        return;
      }
      html5File.setStreamVariable(createStreamVariable(html5File));
      progressView.setVisible(true);
    }
  }
Exemplo n.º 4
0
 @Override
 public void updateTrackPosition(Song song, long elapsedTime) {
   if (song != null) {
     double lenght = (double) song.getSong().getLength();
     indicator.setValue(new Float(elapsedTime / lenght));
     labelMusic.setValue(song.getArtist() + " - " + song.getTitle());
     labelDuration.setValue(
         Utils.formatTime(song.getSong().getLength(), TimeUnit.SECONDS)
             + " / "
             + Utils.formatTime(elapsedTime, TimeUnit.SECONDS));
   }
 }
Exemplo n.º 5
0
  public UploadUnit(
      String url,
      String dbName,
      String driver,
      String userName,
      String password,
      User user,
      TabSheet mainTabs,
      TabSheet subTabs) {
    this.user = user;
    this.mainTabs = mainTabs;
    this.subTabs = subTabs;

    eh = new ExperimentHandler(url, dbName, driver, userName, password);
    this.updateComponents(this.user);

    auth = new Authenticator(url, dbName, driver, userName, password);
    pi.setValue(0f);
    pi.setCaption("Loading...");
    pi.setVisible(false);
  }
Exemplo n.º 6
0
  public TradeTab() {
    HorizontalSplitPanel mainPanel = new HorizontalSplitPanel();
    mainPanel.setHeight("100%");

    VerticalLayout leftPanel = new VerticalLayout();
    leftPanel.setMargin(true);
    leftPanel.setSpacing(true);
    leftPanel.setHeight("100%");

    itemContainer.addContainerProperty("auction", AuctionService.class, null);
    itemContainer.addContainerProperty("id", String.class, null);
    itemContainer.addContainerProperty("description", String.class, null);
    itemContainer.addContainerProperty("startingPrice", Long.class, null);
    itemContainer.addContainerProperty("item", AuctionItem.class, null);

    itemTable.addStyleName("h1");
    //		itemTable.addStyleName("noheader");
    itemTable.setSelectable(true);
    itemTable.setImmediate(true);
    itemTable.setVisibleColumns(new String[] {"description", "startingPrice"});
    itemTable.setColumnHeaders(new String[] {"Description", "Starting Price"});
    itemTable.setSizeFull();

    itemTable.addListener(
        new Property.ValueChangeListener() {
          public void valueChange(ValueChangeEvent event) {
            Application application = getApplication();
            if (application instanceof UriFragmentService)
              ((UriFragmentService) application).setUriFragment(getCurrentUriFragment(), false);

            Object itemId = itemTable.getValue();
            AuctionItem item =
                itemId != null
                    ? (AuctionItem) itemTable.getContainerProperty(itemId, "item").getValue()
                    : null;
            for (Iterator<Component> iter = dynamicLayout.getComponentIterator();
                iter.hasNext(); ) {
              Component component = iter.next();
              if (component instanceof SelectionListener<?>) {
                ((SelectionListener<AuctionItem>) component).selectionChanged(item);
              }
            }
          }
        });

    leftPanel.addComponent(itemTable);
    leftPanel.setExpandRatio(itemTable, 1f);

    // Button panel
    VerticalLayout buttonBarLayout = new VerticalLayout();
    buttonBar = new DynamicContainer(buttonBarLayout);
    buttonBar.setWidth("100%");
    leftPanel.addComponent(buttonBar);

    // Progress Indicator (hidden)
    ProgressIndicator progress = new ProgressIndicator(ProgressIndicator.SIZE_UNDEFINED);
    progress.addStyleName("hidden");
    progress.setPollingInterval(POLL_INTERVAL);
    leftPanel.addComponent(progress);
    leftPanel.setExpandRatio(progress, 0f);

    mainPanel.addComponent(leftPanel);
    mainPanel.addComponent(container);

    Table table = new Table();
    table.setSizeFull();

    setCompositionRoot(mainPanel);
    setCaption("Trade");
    setSizeFull();
  }
Exemplo n.º 7
0
  @Override
  public void attach() {

    if ((SAIMApplication) getApplication() != null)
      config = ((SAIMApplication) getApplication()).getConfig();

    VerticalLayout mainLayout = new VerticalLayout();
    final VerticalLayout accordionLayout = new VerticalLayout();
    HorizontalLayout layout = new HorizontalLayout();

    layout.addComponent(accordionLayout);

    setContent(mainLayout);
    mainLayout.addComponent(layout);
    final ProgressIndicator progress = new ProgressIndicator();
    progress.setIndeterminate(false);
    accordionLayout.addComponent(progress);
    // buttons
    mainLayout.addComponent(getButtonLayout());
    // accordion panel
    Panel accordionPanel = new Panel();
    accordionLayout.addComponent(accordionPanel);

    final Accordion accordion = new Accordion();
    accordionPanel.addComponent(accordion);
    accordionPanel.setStyleName("accordionPanel");

    VerticalLayout metricsLayout, operatorsLayout;
    sourceLayout = new VerticalLayout();
    targetLayout = new VerticalLayout();
    metricsLayout = new VerticalLayout();
    operatorsLayout = new VerticalLayout();

    accordion.addTab(
        sourceLayout, messages.getString("MetricPanel.sourceproperties")); // $NON-NLS-1$
    accordion.addTab(
        targetLayout, messages.getString("MetricPanel.targetproperties")); // $NON-NLS-1$
    accordion.addTab(metricsLayout, messages.getString("MetricPanel.metrics")); // $NON-NLS-1$
    accordion.addTab(operatorsLayout, messages.getString("MetricPanel.operators")); // $NON-NLS-1$
    // add Cytographer

    saimcytopro = makeCytographer();

    layout.addComponent(saimcytopro);

    getAllProps();
    for (String s : sourceProps) {
      sourceLayout.addComponent(new Label(s));
    }

    for (String t : targetProps) {
      targetLayout.addComponent(new Label(t));
    }
    accordionLayout.removeComponent(progress);
    progress.setEnabled(false);

    //		metricsLayout.addComponent( new Label(messages.getString("MetricPanel.0")));
    //		operatorsLayout.addComponent( new Label(messages.getString("MetricPanel.8")));
    Set<String> sorted = new TreeSet<String>();
    sorted.addAll(Measure.identifiers);
    for (String label : sorted) {
      metricsLayout.addComponent(new Label(label));
    }

    sorted.clear();
    sorted.addAll(Operator.identifiers);
    for (String label : sorted) {
      operatorsLayout.addComponent(new Label(label));
    }

    sourceLayout.addListener(
        new AccordionLayoutClickListener(saimcytopro, SAIMCytoprocess.NODE_TYPE.SOURCE, config));
    targetLayout.addListener(
        new AccordionLayoutClickListener(saimcytopro, SAIMCytoprocess.NODE_TYPE.TARGET, config));
    metricsLayout.addListener(
        new AccordionLayoutClickListener(saimcytopro, SAIMCytoprocess.NODE_TYPE.MEASURE, config));
    operatorsLayout.addListener(
        new AccordionLayoutClickListener(saimcytopro, SAIMCytoprocess.NODE_TYPE.OPERATOR, config));

    checkButtons();
  }
Exemplo n.º 8
0
 private void setupComponents() {
   indicator.setPollingInterval(1000);
   indicator.setIndeterminate(false);
   indicator.setSizeFull();
 }