List of usage examples for com.google.gwt.user.client.ui FlowPanel FlowPanel
public FlowPanel()
From source file:asquare.gwt.tk.demo.client.DebugPanel.java
License:Apache License
private Widget createCheckBoxes() { // can't use HashMap because it does not preserve order final Vector eventToMask = new Vector(); eventToMask.add(new EventToMask("onfocus", Event.ONFOCUS)); eventToMask.add(new EventToMask("onblur", Event.ONBLUR)); eventToMask.add(new EventToMask("onchange", Event.ONCHANGE)); eventToMask.add(new EventToMask("onkeydown", Event.ONKEYDOWN)); eventToMask.add(new EventToMask("onkeypress", Event.ONKEYPRESS)); eventToMask.add(new EventToMask("onkeyup", Event.ONKEYUP)); eventToMask.add(new EventToMask("onscroll", Event.ONSCROLL)); eventToMask.add(new EventToMask("onmousemove", Event.ONMOUSEMOVE)); eventToMask.add(new EventToMask("onmouseover", Event.ONMOUSEOVER)); eventToMask.add(new EventToMask("onmouseout", Event.ONMOUSEOUT)); eventToMask.add(new EventToMask("onmousedown", Event.ONMOUSEDOWN)); eventToMask.add(new EventToMask("onmouseup", Event.ONMOUSEUP)); eventToMask.add(new EventToMask("onclick", Event.ONCLICK)); eventToMask.add(new EventToMask("ondblclick", Event.ONDBLCLICK)); eventToMask.add(new EventToMask("onerror", Event.ONERROR)); ClickListener checkBoxController = new ClickListener() { public void onClick(Widget sender) { CheckBox cb = (CheckBox) sender; EventToMask mapping = (EventToMask) eventToMask.get(eventToMask.indexOf(cb.getText())); int traceEventMask = m_eventListener.getEventMask(); if (cb.isChecked()) { traceEventMask |= mapping.m_mask; } else { traceEventMask &= ~mapping.m_mask; }//from ww w . ja v a 2 s .c om m_eventListener.setEventMask(traceEventMask); } }; FlowPanel panel = new FlowPanel(); for (int i = 0; i < eventToMask.size(); i++) { EventToMask mapping = (EventToMask) eventToMask.get(i); addCheckBox(panel, mapping.m_event, mapping.m_mask, checkBoxController); } return panel; }
From source file:at.ait.dme.yuma.client.image.annotation.ImageAnnotationComposite.java
License:EUPL
/** * show hints and create link to help page */// w ww . j a v a2s . co m protected Widget createHeader() { // The parent header panel FlowPanel header = new FlowPanel(); // 'Add your Annotation' label Label addAnnotationLabel = new Label(Application.getConstants().addAnnotation()); addAnnotationLabel.setStyleName("imageAnnotation-add-annotation"); header.add(addAnnotationLabel); // '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().addAnnotationHint()); addAnnotationHint.setStyleName("imageAnnotation-add-annotation-hint"); header.add(addAnnotationHint); // Button panel HorizontalPanel buttons = new HorizontalPanel(); // 'Annotate' button annotateButton.setStyleName("imageAnnotation-button"); annotateButton.setText(Application.getConstants().actionCreate()); annotateButton.addClickHandler(new CreateImageAnnotationClickHandler(this, null, false, false)); annotateButton.setEnabled(!Application.getUser().isEmpty()); buttons.add(annotateButton); // 'Annotate Fragment' button annotateFragmentButton.setStyleName("imageAnnotation-button"); annotateFragmentButton.setText(Application.getConstants().actionCreateFragment()); annotateFragmentButton.addClickHandler(new CreateImageAnnotationClickHandler(this, null, true, false)); annotateFragmentButton.setEnabled(!Application.getUser().isEmpty()); buttons.add(annotateFragmentButton); // 'Show on Map' button showOnMapButton.setStyleName("imageAnnotation-button"); showOnMapButton.setText(Application.getConstants().actionShowOnMap()); showOnMapButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { WindowPanel window = MinMaxWindowPanel.createMinMaxWindowPanel(550, 300, 500, 300); window.getHeader().setText("Map"); window.setWidget(new GoogleMapsComposite(annotations)); window.setResizable(false); window.show(); } }); showOnMapButton.setVisible(Application.getBbox() != null || Application.isInTileMode()); buttons.add(showOnMapButton); header.add(buttons); header.add(annotationFormPanel); return header; }
From source file:at.ait.dme.yuma.client.image.annotation.ImageAnnotationTreeNode.java
License:EUPL
/** * adds the body (title and text)// w ww .ja va 2 s . c o m */ public void addBody() { title.setText(annotation.getTitle()); title.setStyleName("imageAnnotation-title"); text.setStyleName("imageAnnotation-text"); text.setHTML(annotation.getText()); if (title.getText() != null) annotationPanel.add(title); annotationPanel.add(text); // Semantic tags if (annotation.hasSemanticTags()) { FlowPanel tagPanel = new FlowPanel(); tagPanel.setStyleName("imageAnnotation-taglist"); for (SemanticTag t : annotation.getSemanticTags()) { InlineHTML span = new InlineHTML("<a target=\"_blank\" href=\"" + t.getURI() + "\" title=\"" + t.getDescription() + "\">" + t.getTitle() + "</a>"); tagPanel.add(span); } annotationPanel.add(tagPanel); } }
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);/*w ww.j a v a2 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);//from ww w . ja v a 2 s . c o m 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.annotation.TagEnabledMapAnnotationForm.java
License:EUPL
@Override protected Panel createLinksPanel(boolean update, ImageAnnotationTreeNode annotationTreeNode) { tagPanel = new FlowPanel(); tagPanel.setStyleName("imageAnnotation-taglist"); return tagPanel; }
From source file:at.ait.dme.yuma.client.map.annotation.TagEnabledMapAnnotationForm.java
License:EUPL
@Override protected Panel createSemanticLinksPanel(boolean update, ImageAnnotationTreeNode annotationTreeNode) { return new FlowPanel(); }
From source file:at.ait.dme.yuma.client.map.MapPopup.java
License:EUPL
public MapPopup(String title, String html, LonLat lonlat, Map map, ClickHandler closeHandler) { this.lonlat = lonlat; this.map = map; this.setStyleName("mapPopup"); FlowPanel header = new FlowPanel(); header.setStyleName("title"); header.add(new InlineHTML(title)); PushButton closeButton = new PushButton("X"); closeButton.setStyleName("close"); closeButton.addClickHandler(closeHandler); header.add(closeButton);//from w w w . j a v a2 s .c o m FlowPanel inner = new FlowPanel(); inner.setStyleName("inner"); inner.add(new InlineHTML(html)); moveListener = new EventListener() { @Override public void onEvent(LonLat ll, Pixel p, String tagname) { updatePosition(); } }; map.registerMapEventListener(moveListener, Map.EVENT_MOVE); FlowPanel panel = new FlowPanel(); panel.add(header); panel.add(inner); this.setWidget(panel); DeferredCommand.addCommand(new Command() { @Override public void execute() { updatePosition(); } }); }
From source file:at.ait.dme.yuma.client.util.LoadMask.java
License:EUPL
public LoadMask(String label) { this.setStyleName("loadmask"); FlowPanel inner = new FlowPanel(); inner.setStyleName("inner"); inner.add(new Image("images/loading.gif")); inner.add(new Label(label)); this.setWidget(inner); center();/* w w w . ja v a 2s .c om*/ }
From source file:at.ait.dme.yuma.suite.apps.core.client.treeview.AnnotationPanel.java
License:EUPL
/** * show hints and create link to help page *///w w w . j a v a2 s . co 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; }