List of usage examples for com.google.gwt.user.client.ui HorizontalPanel HorizontalPanel
public HorizontalPanel()
From source file:at.ait.dme.yuma.client.image.annotation.StandardImageAnnotationForm.java
License:EUPL
protected Panel createSemanticLinksPanel(boolean update, ImageAnnotationTreeNode annotationTreeNode) { HorizontalPanel linksPanel = new HorizontalPanel(); Label linksLabel = new Label(Application.getConstants().annotationSuggestedLinks()); linksLabel.setStyleName("imageAnnotation-form-label"); linksPanel.add(linksLabel);// w w w.ja v a 2s . c o m suggestedLinksStack = new VerticalPanel(); suggestedLinksStack.setStyleName("imageAnnotation-form-links"); linksPanel.add(suggestedLinksStack); return linksPanel; }
From source file:at.ait.dme.yuma.client.image.annotation.StandardImageAnnotationForm.java
License:EUPL
private HorizontalPanel createButtonsPanel(boolean update, ImageAnnotationTreeNode annotationTreeNode, ImageAnnotationComposite annotationComposite) { HorizontalPanel buttonsPanel = new HorizontalPanel(); PushButton saveButton = new PushButton(Application.getConstants().actionSave()); if (update) { saveButton.addClickHandler(/*from ww w . j a v a 2 s.c om*/ new UpdateImageAnnotationClickHandler(annotationComposite, annotationTreeNode, this)); } else { saveButton.addClickHandler( new SaveImageAnnotationClickHandler(annotationComposite, annotationTreeNode, this)); } saveButton.setStyleName("imageAnnotation-form-button"); buttonsPanel.add(saveButton); PushButton cancelButton = new PushButton(Application.getConstants().actionCancel()); cancelButton.setStyleName("imageAnnotation-form-button"); cancelButton .addClickHandler(new CancelImageAnnotationClickHandler(annotationComposite, annotationTreeNode)); buttonsPanel.add(cancelButton); return buttonsPanel; }
From source file:at.ait.dme.yuma.client.map.annotation.ControlPointComposite.java
License:EUPL
@Override protected Widget createHeader() { // The parent header panel FlowPanel header = new FlowPanel(); // 'Help geo-Reference' label Label addAnnotationLabel = new Label(Application.getConstants().helpGeoreference()); addAnnotationLabel.setStyleName("imageAnnotation-add-annotation"); header.add(addAnnotationLabel);// www. j a v a 2 s .c o m // 'Help' link HTML help = new HTML( "<a target=\"_blank\" href=\"userguide_" + LocaleInfo.getCurrentLocale().getLocaleName() + ".html\">" + Application.getConstants().help() + "</a>"); help.setStyleName("imageAnnotation-help"); header.add(help); // Instructions text Label addAnnotationHint = new Label(Application.getConstants().helpGeoreferenceHint()); addAnnotationHint.setStyleName("imageAnnotation-add-annotation-hint"); header.add(addAnnotationHint); // Button panel HorizontalPanel buttons = new HorizontalPanel(); // 'Create Control Point' button createButton = new PushButton(Application.getConstants().actionCreateCP()); createButton.setStyleName("imageAnnotation-button"); createButton.addClickHandler(new CreateImageAnnotationClickHandler(this, null, false, false)); createButton.setEnabled(!Application.getUser().isEmpty()); buttons.add(createButton); header.add(buttons); // Placeholder for the annotation form header.add(annotationFormPanel); return header; }
From source file:at.ait.dme.yuma.client.map.annotation.ControlPointForm.java
License:EUPL
public ControlPointForm(ImageAnnotationComposite annotationComposite, ControlPointLayer controlPointLayer, ImageAnnotationTreeNode annotationTreeNode, boolean fragmentAnnotation, boolean update) { // Reference to control point layer this.controlPointLayer = controlPointLayer; // Place name (will be geo-coded) HorizontalPanel placeNamePanel = new HorizontalPanel(); Label placeNameLabel = new Label("Place: "); placeNameLabel.setStyleName("cp-Editor-Label"); placeNamePanel.add(placeNameLabel);//www.j a v a2 s . c om placeName = new TextBox(); placeName.setStyleName("cp-Editor-Field"); placeName.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { doAsyncGeocoding(placeName.getText() + event.getCharCode()); } }); placeNamePanel.add(placeName); // Lon (determined automatically - field disabled) HorizontalPanel lonPanel = new HorizontalPanel(); Label lonLabel = new Label("Lon: "); lonLabel.setStyleName("cp-Editor-Label"); lonPanel.add(lonLabel); lon = new TextBox(); lon.setEnabled(false); lon.setStyleName("cp-Editor-Field"); lonPanel.add(lon); // Lat (determined automatically - field disabled) HorizontalPanel latPanel = new HorizontalPanel(); Label latLabel = new Label("Lat: "); latLabel.setStyleName("cp-Editor-Label"); latPanel.add(latLabel); lat = new TextBox(); lat.setEnabled(false); lat.setStyleName("cp-Editor-Field"); latPanel.add(lat); // X/Y (determined automatically - field disabled) HorizontalPanel xyPanel = new HorizontalPanel(); Label xyLabel = new Label("X/Y: "); xyLabel.setStyleName("cp-Editor-Label"); xyPanel.add(xyLabel); xy = new TextBox(); xy.setEnabled(false); xy.setStyleName("cp-Editor-Field"); xyPanel.add(xy); if (update) { ImageAnnotation annotation = annotationTreeNode.getAnnotation(); placeName.setText(annotation.getTitle()); GeoPoint p = (GeoPoint) annotation.getFragment().getShape(); lon.setText(Double.toString(p.getLng())); lat.setText(Double.toString(p.getLat())); setXY(p.getX(), p.getY()); } // Assemble the main FlowPanel FlowPanel form = new FlowPanel(); form.setStyleName("cp-Editor"); form.add(placeNamePanel); form.add(lonPanel); form.add(latPanel); form.add(xyPanel); form.add(createButtonsPanel(update, annotationTreeNode, annotationComposite)); form.setStyleName("imageAnnotation-form"); initWidget(form); controlPointLayer.setControlPointForm(this); if (update) { controlPointLayer.showActiveFragmentPanel(annotationTreeNode.getAnnotation(), false); } else { controlPointLayer.showActiveFragmentPanel(null, false); } }
From source file:at.ait.dme.yuma.client.map.explore.KMLOverlayPanel.java
License:EUPL
private HorizontalPanel createRadioButton(final String kml, String label, boolean preselected) { HorizontalPanel panel = new HorizontalPanel(); RadioButton radio = new RadioButton(RADIO_GROUP); radio.setValue(preselected);/* w w w . j a v a2 s . c om*/ radio.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (kml != null) { kmlLayer.showKml(kml); } else { kmlLayer.hideKml(); } } }); panel.add(radio); panel.add(new InlineHTML(label)); return panel; }
From source file:at.ait.dme.yuma.client.map.explore.SearchPanel.java
License:EUPL
public SearchPanel(TiledImageComposite imageComposite) { this.searchLayer = imageComposite.getSearchLayer(); AnnotationConstants i18n = Application.getConstants(); HorizontalPanel hPanel = new HorizontalPanel(); hPanel.setStyleName("explore-PlaceSearch"); Label searchLabel = new Label(i18n.searchLabel()); searchBox = new TextBox(); Button searchBtn = new Button(i18n.searchButton(), new ClickHandler() { @Override// w w w . j a va2s . c o m public void onClick(ClickEvent event) { doAsyncGeocoding(); } }); hPanel.add(searchLabel); hPanel.add(searchBox); hPanel.add(searchBtn); this.add(hPanel); }
From source file:at.ait.dme.yuma.suite.apps.core.client.treeview.AnnotationPanel.java
License:EUPL
/** * show hints and create link to help page *//*from w w w . ja v a2s. c o m*/ protected Widget createHeader() { // The parent header panel FlowPanel header = new FlowPanel(); // 'Add your Annotation' label Label addAnnotationLabel = new Label(YUMACoreProperties.getConstants().addAnnotation()); addAnnotationLabel.setStyleName("imageAnnotation-add-annotation"); header.add(addAnnotationLabel); // 'Loading' animation header.add(loadingImage); // 'Help' link HTML help = new HTML( "<a target=\"_blank\" href=\"userguide_" + LocaleInfo.getCurrentLocale().getLocaleName() + ".html\">" + YUMACoreProperties.getConstants().help() + "</a>"); help.setStyleName("imageAnnotation-help"); header.add(help); // Instructions text Label addAnnotationHint = new Label(YUMACoreProperties.getConstants().addAnnotationHint()); addAnnotationHint.setStyleName("imageAnnotation-add-annotation-hint"); header.add(addAnnotationHint); // Button panel HorizontalPanel buttons = new HorizontalPanel(); // 'Annotate' button annotateButton.setStyleName("imageAnnotation-button"); annotateButton.setText(YUMACoreProperties.getConstants().annotate()); annotateButton.addClickHandler(new AnnotateClickHandler(this, null, null, false)); annotateButton.setEnabled(!User.get().isAnonymous()); buttons.add(annotateButton); // 'Annotate Fragment' button annotateFragmentButton.setStyleName("imageAnnotation-button"); annotateFragmentButton.setText(YUMACoreProperties.getConstants().annotateFragment()); annotateFragmentButton.addClickHandler(new AnnotateClickHandler(this, null, null, true)); annotateFragmentButton.setEnabled(!User.get().isAnonymous()); buttons.add(annotateFragmentButton); header.add(buttons); return header; }
From source file:at.ait.dme.yuma.suite.apps.image.core.client.treeview.ImageAnnotationEditForm.java
License:EUPL
protected FlowPanel createAddNewTagPanel() { FlowPanel container = new FlowPanel(); container.setStyleName("annotationEditForm-tag"); Label addTagLabel = new Label(i18n.addTag()); addTagLabel.setStyleName("annotationEditForm-label"); HorizontalPanel addTagPanel = new HorizontalPanel(); final TagSuggestBox newTagTextBox = new TagSuggestBox(10); newTagTextBox.setStyleName("annotationEditForm-tag-input"); newTagTextBox.addSelectionHandler(new SelectionHandler<Suggestion>() { @Override/*from w w w . j a v a2s.c o m*/ public void onSelection(SelectionEvent<Suggestion> evt) { addTag(newTagTextBox.getTag()); newTagTextBox.clear(); } }); addTagPanel.add(newTagTextBox); PushButton btnAdd = new PushButton(i18n.add()); btnAdd.addStyleName("annotationEditForm-tag-btn-add"); btnAdd.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent evt) { addTag(newTagTextBox.getTag()); newTagTextBox.clear(); } }); addTagPanel.add(btnAdd); PushButton btnBrowse = new PushButton(i18n.browse()); btnBrowse.addStyleName("annotationEditForm-tag-btn-browse"); final TagTreePanel tagTreePanel = new TagTreePanel(this); btnBrowse.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { WindowPanel window = MinMaxWindowPanel.createMinMaxWindowPanel(200, 200, 350, 450); window.setWidget(tagTreePanel); window.getHeader().setText(i18n.vocabularyBrowser()); window.show(); } }); addTagPanel.add(btnBrowse); container.add(addTagLabel); container.add(addTagPanel); return container; }
From source file:at.ait.dme.yuma.suite.apps.image.core.client.treeview.ImageAnnotationEditForm.java
License:EUPL
protected HorizontalPanel createScopePanel() { HorizontalPanel radioPanel = new HorizontalPanel(); Label scopeLabel = new Label(); scopeLabel.setStyleName("imageAnnotation-form-label"); rdPublic = new RadioButton(SCOPE_RADIO_GROUP_NAME, " " + i18n.publicScope()); rdPublic.setStyleName("imageAnnotation-form-radiobutton"); rdPrivate = new RadioButton(SCOPE_RADIO_GROUP_NAME, " " + i18n.privateScope()); rdPrivate.setStyleName("imageAnnotation-form-radiobutton"); if (annotation != null && annotation.getAnnotation().getScope() == Scope.PRIVATE) { rdPrivate.setValue(true, true);/*from w w w. j a va 2s . co m*/ } else { rdPublic.setValue(true, true); } radioPanel.add(scopeLabel); radioPanel.add(rdPublic); radioPanel.add(rdPrivate); return radioPanel; }
From source file:at.ait.dme.yuma.suite.apps.image.core.client.treeview.ImageAnnotationEditForm.java
License:EUPL
protected HorizontalPanel createButtonsPanel() { HorizontalPanel buttonsPanel = new HorizontalPanel(); PushButton btnSave = new PushButton(i18n.save()); btnSave.setStyleName("imageAnnotation-form-button"); if (annotation == null) { btnSave.addClickHandler(new SaveClickHandler(panel, parent, this)); } else {//from w w w. j a va 2 s .c o m btnSave.addClickHandler(new UpdateClickHandler(panel, annotation, parent, this)); } buttonsPanel.add(btnSave); PushButton btnCancel = new PushButton(i18n.cancel()); btnCancel.setStyleName("imageAnnotation-form-button"); if (annotation == null) { btnCancel.addClickHandler(new CancelClickHandler(panel, parent)); } else { btnCancel.addClickHandler(new CancelClickHandler(panel, annotation)); } buttonsPanel.add(btnCancel); return buttonsPanel; }