예제 #1
0
  public LaunchFormLayout(String title, String icon, final String description) {

    super("600", "*");
    addTitle(title, icon);

    Label docLabel =
        WidgetUtil.getLabel(
            "Documentation and Terms of Use", CoreConstants.ICON_INFORMATION, 30, Cursor.HAND);
    docLabel.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            new DocumentationLayout(event.getX(), event.getY(), description).show();
          }
        });
    this.addMember(docLabel);

    simulationNameItem = FieldUtil.getTextItem(400, "[0-9A-Za-z-_ ]");
    simulationNameItem.setValidators(ValidatorUtil.getStringValidator());
    addField("Simulation Name", simulationNameItem);

    sourcesLayout = new VLayout(5);
    sourcesLayout.setAutoHeight();
    this.addMember(sourcesLayout);
  }
예제 #2
0
 private Label createAddTimeSeriesLabelButton() {
   Label addTS = new Label(i18n.picker());
   addTS.setStyleName("n52_sensorweb_client_legendbuttonPrimary");
   addTS.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           StationSelector.getInst().show();
         }
       });
   return addTS;
 }
예제 #3
0
 private Label createSESTabLabelButton() {
   Label sesTabLabelButton = new Label(i18n.editProfile());
   sesTabLabelButton.setStyleName("n52_sensorweb_client_legendbutton");
   sesTabLabelButton.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           Legend.this.showProfileWindow();
         }
       });
   sesTabLabelButton.setVisible(true);
   return sesTabLabelButton;
 }
예제 #4
0
 private Label createPDFLabel() {
   Label toPDF = new Label(i18n.toPDF());
   toPDF.setWrap(false);
   toPDF.setAutoFit(true);
   toPDF.setPadding(3);
   toPDF.setWidth100();
   toPDF.setStyleName("n52_sensorweb_client_exportEntry");
   toPDF.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           controller.exportTo(ExportType.PDF_ALL_IN_ONE);
           exportMenu.hide();
         }
       });
   return toPDF;
 }
예제 #5
0
 private Label createExportLabelButton() {
   Label export = new Label(i18n.export());
   export.setStyleName("n52_sensorweb_client_legendbuttonDisabled");
   export.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           if (exportMenu.isVisible()) {
             exportMenu.hide();
           } else {
             exportMenu.setLeft(exportButton.getAbsoluteLeft() - 2);
             exportMenu.setWidth(exportButton.getWidth());
             exportMenu.show();
           }
         }
       });
   return export;
 }
  private Label buildSecondaryMenuOption(final String title, boolean selected) {
    Label tmp = new Label(title);
    tmp.setTitle(title);
    tmp.setWrap(false);
    tmp.setValign(VerticalAlignment.BOTTOM);
    tmp.setAlign(Alignment.CENTER);
    tmp.setPadding(10);
    tmp.setShowRollOver(true);
    tmp.setCursor(Cursor.POINTER);

    String style;

    if (selected) {
      style = "secondaryMenuText-selected";
      selectedSecondaryMenuOption = tmp;
    } else {
      style = "secondaryMenuText";
    }
    tmp.setBaseStyle(style);

    tmp.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            Object o = event.getSource();
            if (o instanceof Label) {
              Label lbl = (Label) o;
              if (!lbl.getTitle().equals(selectedSecondaryMenuOption.getTitle())) {
                selectedSecondaryMenuOption.setBaseStyle("secondaryMenuText");
                lbl.setBaseStyle("secondaryMenuText-selected");
                selectedSecondaryMenuOption = lbl;
                BLCMain.setCurrentPageKey(lbl.getTitle());
                buildHistoryNewItem(
                    lbl.getTitle(), BLCLaunch.getSelectedModule(History.getToken()), null);
              }
            }
          }
        });

    return tmp;
  }
  public UpgradeLevelLayout(int x, int y) {

    this.setWidth(500);
    this.setHeight(300);
    this.setMembersMargin(5);
    this.setPadding(5);
    this.setBackgroundColor("#FFFFFF");
    this.setBorder("1px solid #CCCCCC");
    this.setOpacity(85);
    this.moveTo(x, y + 20);

    Label titleLabel = new Label("<b>User Levels:</b>");
    titleLabel.setIcon(CoreConstants.ICON_USER_INFO);
    titleLabel.setHeight(30);
    this.addMember(titleLabel);

    HTMLPane pane = new HTMLPane();
    pane.setWidth100();
    pane.setHeight100();
    pane.setOverflow(Overflow.AUTO);
    pane.setContentsURL("./documentation/user/user_levels.html");
    pane.setContentsType(ContentsType.PAGE);
    this.addMember(pane);

    Label closeLabel = new Label("Close");
    closeLabel.setIcon(CoreConstants.ICON_CLOSE);
    closeLabel.setHeight(25);
    closeLabel.setWidth100();
    closeLabel.setAlign(Alignment.RIGHT);
    closeLabel.setCursor(Cursor.HAND);
    closeLabel.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            destroy();
          }
        });

    this.addMember(closeLabel);
  }
  private Label buildPrimaryMenuOption(final Module module, boolean selected) {
    Label tmp = new Label(module.getModuleTitle());
    tmp.setValign(VerticalAlignment.CENTER);
    tmp.setHeight(30);
    tmp.setAlign(Alignment.CENTER);
    tmp.setWrap(false);
    tmp.setPadding(0);
    tmp.setShowRollOver(true);
    tmp.setCursor(Cursor.POINTER);

    final String style;
    if (selected) {
      style = "primaryMenuText-selected";
    } else {
      style = "primaryMenuText";
    }

    tmp.setBaseStyle(style);

    tmp.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(final ClickEvent event) {
            Object o = event.getSource();
            if (o instanceof Label) {
              final Label lbl = (Label) o;
              if (!"primaryMenuText-selected".equals(lbl.getBaseStyle())) {
                selectPrimaryMenu(module.getModuleKey());
                lbl.setBaseStyle("primaryMenuText-selected");
                BLCMain.setCurrentModuleKey(module.getModuleKey());
                buildSecondaryMenu(null, module.getModuleKey());
                AppController.getInstance()
                    .go(canvas, module.getPages(), null, module.getModuleKey(), false);
              }
            }
          }
        });

    return tmp;
  }
예제 #9
0
    HtmlUploadComponentImpl(final UploadComponentOptions options, final boolean zip) {
      this.zip = zip;
      if (zip) {
        types = "*.zip";
        typesDescription = "Zip";
      } else {
        types = options.getTypes() == null ? null : options.getTypes();
        typesDescription =
            options.getTypesDescription() == null ? null : options.getTypesDescription();
      }
      this.options = options;
      if (isMultiple()) {
        formPanel.setHeight("125px");
        scrollPanel.setHeight("125px");
        formPanel.setWidth("320px");
        scrollPanel.setWidth("320px");
      } else {
        formPanel.setHeight("30px");
        scrollPanel.setHeight("30px");
        formPanel.setWidth("310px");
        scrollPanel.setWidth("310px");
      }

      panel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);

      formPanel.setWidget(scrollPanel);
      formPanel.setAction(GWT.getHostPageBaseURL() + "fileupload?zip=" + zip);
      formPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
      formPanel.setMethod(FormPanel.METHOD_POST);
      formPanel.addSubmitHandler(
          new SubmitHandler() {
            public void onSubmit(final SubmitEvent submitEvent) {}
          });
      formPanel.addSubmitCompleteHandler(
          new SubmitCompleteHandler() {
            public void onSubmitComplete(final SubmitCompleteEvent completeEvent) {
              System.out.println("Submit complete " + completeEvent.getResults());
              final String result = completeEvent.getResults();
              try {
                final List<FileSource> fileSources = toFileSources(result);
                options.getCompletionCallback().onSuccess(fileSources);
              } catch (final Exception e) {
                options.getCompletionCallback().onFailure(e);
              }
            }
          });
      final Layout parent = getParentCanvas(options);
      // final String parentPreix;
      // if(isZip) {
      //  parentPrefix = DomConstants.UPLOAD_PANEL_ZIP;
      // } else {
      //  parentPrefix = DomConstants.UPLOAD_PANEL_PLAIN;
      // }

      parent.setWidth100();
      if (debug) {
        parent.setBorder("1px solid pink");
      }
      parent.setAlign(VerticalAlignment.CENTER);
      parent.setLayoutAlign(VerticalAlignment.CENTER);
      final Layout wrapperLayout = new VLayout();
      // wrapperLayout.setHeight100();
      wrapperLayout.setWidth100();
      if (isMultiple()) {
        wrapperLayout.setHeight("140px");
      } else {
        wrapperLayout.setHeight("30px");
      }
      if (debug) {
        wrapperLayout.setBorder("1px solid blue");
      }
      wrapperLayout.setAlign(VerticalAlignment.CENTER);
      wrapperLayout.setLayoutAlign(VerticalAlignment.CENTER);
      /*
       * wrapperLayout.setGroupTitle(isMultiple() ? "File(s)" : (zip ? "Zip File" : "File"));
       * wrapperLayout.setIsGroup(true);
       * wrapperLayout.setPadding(15);
       * wrapperLayout.setLayoutAlign(Alignment.CENTER);
       * wrapperLayout.setAlign(Alignment.CENTER);
       */
      if (isMultiple()) {
        final Label addLabel =
            SmartUtils.smartParagraph(
                "<span style=\"color:blue;cursor:pointer; text-decoration: underline;\">Add Upload</span>");
        addLabel.addClickHandler(
            new ClickHandler() {
              public void onClick(final ClickEvent clickEvent) {
                addFileUploadWidget();
              }
            });
        wrapperLayout.addMember(addLabel);
      }
      wrapperLayout.addMember(formPanel);
      parent.addMember(wrapperLayout);
      // parent.setLayoutAlign(Alignment.CENTER);
      // parent.setAlign(Alignment.CENTER);
      addFileUploadWidget();
      setWidget(parent);
      parent.addDrawHandler(
          new DrawHandler() {

            public void onDraw(DrawEvent event) {
              if (zip) {
                parent.getDOM().addClassName(DomConstants.UPLOAD_PANEL_ZIP);
              } else {
                parent.getDOM().addClassName(DomConstants.UPLOAD_PANEL_PLAIN);
              }
            }
          });
    }
예제 #10
0
  public RepositoryNameView(final Console console) {
    super();
    setStyleName("repository");
    setLayoutAlign(Alignment.CENTER);
    setLayoutAlign(VerticalAlignment.CENTER);
    setDefaultLayoutAlign(Alignment.CENTER);
    setDefaultLayoutAlign(VerticalAlignment.CENTER);

    setHeight(55);
    setWidth100();

    Img logo = new Img();
    logo.setSrc("icons/attach.png");

    logo.setHeight(55);
    logo.setWidth(45);
    logo.setValign(VerticalAlignment.CENTER);

    HLayout panel0 = new HLayout();

    HLayout panel1 = new HLayout();

    panel1.setLayoutAlign(Alignment.RIGHT);
    panel1.setDefaultLayoutAlign(Alignment.RIGHT);
    panel1.setAlign(Alignment.RIGHT);
    HLayout panel = new HLayout();

    //            panel.setAlign(Alignment.LEFT);
    panel.setLayoutAlign(VerticalAlignment.CENTER);
    panel.setDefaultLayoutAlign(VerticalAlignment.CENTER);

    label.setStyleName("repository-caption");
    label.setWidth("100%");
    label.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            console.showRepositories();
          }
        });
    label.setBorder("1 px solid black");
    label.setValign(VerticalAlignment.CENTER);

    Label explore = new Label("<b>Explore</b>");
    explore.setAlign(Alignment.RIGHT);
    explore.setBorder("1ps solid green");
    explore.setAutoFit(true);
    explore.setStyleName("tab-label");
    explore.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            console.showContent();
          }
        });

    Label nodeTypes = new Label("<b>NodeTypes</b>");
    nodeTypes.setAlign(Alignment.RIGHT);
    nodeTypes.setAutoFit(true);
    nodeTypes.setStyleName("tab-label");
    nodeTypes.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            console.showNodeTypes();
          }
        });

    Label descriptor = new Label("<b>Descriptor</b>");
    descriptor.setAlign(Alignment.RIGHT);
    descriptor.setAutoFit(true);
    descriptor.setStyleName("tab-label");
    descriptor.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            console.showRepositoryInfo();
          }
        });

    Label query = new Label("<b>Query</b>");
    query.setAlign(Alignment.RIGHT);
    query.setAutoFit(true);
    query.setStyleName("tab-label");
    query.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            console.showQuery();
          }
        });

    panel.addMember(logo);
    panel.addMember(label);

    panel1.addMember(explore);
    panel1.addMember(new Spacer(10));
    panel1.addMember(nodeTypes);
    panel1.addMember(new Spacer(10));
    panel1.addMember(descriptor);
    panel1.addMember(new Spacer(10));
    panel1.addMember(query);
    panel1.setHeight(55);

    panel0.setWidth("70%");
    panel0.setHeight(55);

    panel0.addMember(panel);
    panel0.addMember(panel1);

    addMember(new Strut(10));
    addMember(panel0);
    addMember(new Strut(10));
    setVisible(false);
  }
예제 #11
0
  //    private final MapServiceInfoAsync mapServiceInfo = GWT.create(MapServiceInfo.class);
  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  public Authorization(final AsyncCallback<String> callback) {
    super(WINDOW_TITLE, WIDTH, HEIGHT, callback);

    this.setShowMinimizeButton(false);

    VLayout layout = new VLayout();
    layout.layoutChildren(null);

    accountForm = new DynamicForm();
    accountForm.setWidth100();
    accountForm.setPadding(5);
    //        backGround.setBorder("1px solid #ff0");
    TextItem login = new TextItem(CONTROL_LOGIN);
    login.setTitle(CAPTION_LOGIN);
    PasswordItem password = new PasswordItem(CONTROL_PASSWORD);
    password.setTitle(CAPTION_PASSWORD);

    password.addKeyPressHandler(
        new KeyPressHandler() {
          public void onKeyPress(KeyPressEvent keyPressEvent) {
            //                com.google.gwt.user.client.Window.alert("" +
            // keyPressEvent.getKeyName());
            if (keyPressEvent.getKeyName().equalsIgnoreCase("ENTER")) onOkClick();
          }
        });

    accountForm.setFields(login, password);

    Label linkRegistration = null;
    if (GWTViewer.config.withRegistration()) {
      linkRegistration = new Label();
      linkRegistration.setAlign(Alignment.RIGHT);
      linkRegistration.setStyleName(CSS_LABEL_LINK);
      linkRegistration.setHeight(20);
      linkRegistration.setWidth(265);
      linkRegistration.setContents(REGISTRATION);

      linkRegistration.addClickHandler(
          new ClickHandler() {
            public void onClick(ClickEvent event) {
              callback.onSuccess(CMD_REGISTRATION);
              closeForm();
            }
          });
    }
    labelException = new Label();
    labelException.setAlign(Alignment.CENTER);
    labelException.setStyleName(CSS_LABEL_ERROR);
    labelException.setHeight(35);
    labelException.setWidth100();
    labelException.setMargin(5);
    //       labelException.setBorder("1px solid #0aa");
    labelException.setContents("");

    HLayout controlPanel = new HLayout();
    controlPanel.setHeight("30px");
    controlPanel.setLayoutLeftMargin(55);

    Button btnOk = null;
    btnOk = new Button("Ok");
    btnOk.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onOkClick();
          }
        });
    Button btnClose = new Button(CAPTION_CLOSE);
    btnClose.setTop(10);
    btnClose.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            closeForm();
          }
        });
    controlPanel.addMember(btnOk);
    controlPanel.addMember(btnClose);

    layout.addMember(accountForm);
    if (linkRegistration != null) layout.addMember(linkRegistration);
    layout.addMember(labelException);
    layout.addMember(controlPanel);
    addItem(layout);
  }
예제 #12
0
  public void generateLegend() {

    // TODO cleanup/extract method(s)

    setWidth("365px"); // TODO make configurable (Legend width)
    // setWidth("27%");
    setHeight100();
    setMargin(2);
    setMinWidth(220);
    // setOverflow(Overflow.CLIP_H);

    this.topButtons = new HLayout();
    this.topButtons.setTabIndex(-1);
    this.topButtons.setHeight(1);
    this.topButtons.setAlign(Alignment.RIGHT);
    this.topButtons.setReverseOrder(true);

    ImageButton us =
        new ImageButton("us_lang", "../img/icons/gb.png", i18n.usLang(), i18n.usLangExtended());
    View.getView().registerTooltip(us);
    ImageButton de =
        new ImageButton("de_lang", "../img/icons/de.png", i18n.deLang(), i18n.deLangExtended());
    View.getView().registerTooltip(de);
    ImageButton ttips =
        new ImageButton("ttips", "../img/icons/comment.png", i18n.ttips(), i18n.ttipsExtended());
    View.getView().registerTooltip(ttips);
    ImageButton help =
        new ImageButton("help", "../img/icons/help.png", i18n.help(), i18n.helpExtended());
    View.getView().registerTooltip(help);
    ImageButton logger =
        new ImageButton("logger", "../img/icons/report.png", i18n.logger(), i18n.loggerExtended());
    View.getView().registerTooltip(logger);

    ImageButton impressum =
        new ImageButton(
            "impressum", "../img/icons/information.png", i18n.Impressum(), i18n.Impressum());

    Label imprint = new Label(i18n.Impressum());
    imprint.setTooltip(i18n.Impressum());
    imprint.setStyleName("label");
    imprint.setWidth(60);

    View.getView().registerTooltip(impressum);
    View.getView().switchDetailedTooltips();

    imprint.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            new Impressum().show();
          }
        });

    help.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            String helpUrl = GWT.getHostPageBaseURL() + i18n.helpPath();
            Window.open(helpUrl, "", "");
          }
        });

    // this.topButtons.addMember(us);
    // this.topButtons.addMember(de);
    // this.topButtons.addMember(ttips);
    // this.topButtons.addMember(help);
    // this.topButtons.addMember(logger);
    // this.topButtons.addMember(imprint);

    addMember(this.topButtons);

    // Button addTS = new Button(I18N.sosClient.addNewTimeseries());
    // addTS.setIcon("../img/icons/chart_curve_add_new.png");

    // ImageButton addTS = new ImageButton("addTSLegend",
    // "../img/icons/chart_curve_add_new.png",
    // I18N.sosClient.picker(),
    // I18N.sosClient.pickerExtended());
    // View.getInstance().registerTooltip(addTS);

    // addTS.addClickHandler(new ClickHandler() {
    // public void onClick(ClickEvent evt) {
    // StationSelector.getInst().show();
    // }
    // });

    // addTS.setPadding(2);
    // addTS.setSize("32px", "32px");
    // addTS.setAlign(Alignment.CENTER);

    // Label addTSLabel = new Label(I18N.sosClient.addNewTimeseries());
    // addTSLabel.setHeight(20);
    // addTSLabel.setWidth100();
    // addTSLabel.setPadding(8);
    // addTSLabel.setStyleName("legendAddBoxLabel");
    // addTSLabel.setCursor(Cursor.HAND);
    // addTSLabel.setAlign(Alignment.CENTER);

    // HLayout add = new HLayout();
    // add.setStyleName("legendAddBox");
    // add.setAutoHeight();
    // add.addMember(addTS);
    // add.addMember(addTSLabel);
    // add.addClickHandler(new ClickHandler() {
    // public void onClick(ClickEvent event) {
    // StationSelector.getInst().show();
    // }
    // });

    // zip-export CSV
    // this.exportZipCSV =
    // new ImageButton("diagExportZipCSV", "../img/icons/folder_csv.png", i18nManager.i18nSOSClient
    // .exportZipCSV(), i18nManager.i18nSOSClient.exportZipCSVExtended());

    // View.getInstance().registerTooltip(this.exportZipCSV);

    // zip-export XLS
    // this.exportPDFallInOne =
    // new ImageButton("diagExportPDFallIneOne", "../img/icons/page_white_acrobat_add.png",
    // i18nManager.i18nSOSClient.exportPDFallInOne(),
    // i18nManager.i18nSOSClient.exportPDFallInOneExtended());
    // View.getInstance().registerTooltip(this.exportPDFallInOne);

    Button exportZipCSV = new Button(i18n.csv());
    exportZipCSV.setIcon("../img/icons/table.png");
    exportZipCSV.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            controller.exportTo(ExportType.CSV_ZIP);
          }
        });

    Button exportPDFallInOne = new Button(i18n.pdf());
    exportPDFallInOne.setStyleName("input");
    exportPDFallInOne.setIcon("../img/icons/page_white_acrobat_add.png");
    exportPDFallInOne.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            controller.exportTo(ExportType.PDF_ALL_IN_ONE);
          }
        });

    createExportLoadingSpinner();

    HStack menuStack = new HStack();
    // menuStack.setAlign(Alignment.CENTER);
    menuStack.setHeight100();
    Label space = new Label();
    Label addTS = createAddTimeSeriesLabelButton();
    exportButton = createExportLabelButton();
    sesTabButton = createSESTabLabelButton();
    space.setWidth("1%");
    exportButton.setWidth("20%");
    exportLoadingSpinner.setTop(5);
    exportLoadingSpinner.setWidth("2%");
    menuStack.addMember(addTS);
    menuStack.addMember(space);
    if (ClientUtils.isSesEnabled()) {
      addTS.setWidth("38%");
      sesTabButton.setWidth("35%");
      menuStack.addMember(sesTabButton);
      menuStack.addMember(space);
    } else {
      addTS.setWidth("75%");
    }

    menuStack.addMember(exportButton);
    menuStack.addMember(exportLoadingSpinner);
    setExportButtonActiv(false);

    VStack vMenuStack = new VStack();
    vMenuStack.addMember(menuStack);
    vMenuStack.setHeight(28);
    addMember(vMenuStack);

    // create export menu
    createExportMenu();
    addChild(exportMenu);

    VStack separator = new VStack();
    separator.setHeight("3px");
    addMember(separator);

    this.legend = new VStack();
    this.legend.setOverflow(Overflow.AUTO);
    this.legend.setHeight("*");
    this.legend.setShowResizeBar(true);
    addMember(this.legend);
    // this.intro = new HTMLFlow(I18N.sosClient.intro());
    // this.legend.addMember(this.intro);

    addMember(separator);

    Layout layout = new Layout();
    layout.addMember(createMapContent());
    layout.setWidth100();
    layout.setHeight("40%");
    addMember(layout);

    // this.footer = new HLayout();
    // this.footer.setTabIndex( -1);
    // addMember(this.footer);

  }