/** * Opens an HTML popup info window at the given screen coordinates (within the * plot bounds) * * It sets the same font family, size, color and bgcolor defined for markers, if * you wanted override them use the css selector div.chrono-infoWindow-content. * * FIXME: (MCM) this should be a unique instance of popup: ask Shawn */ public InfoWindow createInfoWindow(String html, double x, double y) { final PopupPanel pp = new DecoratedPopupPanel(true); pp.addStyleName("chrono-infoWindow"); Widget content = new HTML(html); content.setStyleName("chrono-infoWindow-content"); pp.setWidget(content); pp.setPopupPosition(getElement().getAbsoluteLeft() + (int)x, getElement().getAbsoluteTop() + (int)y); GssProperties markerProperties = gssContext.getPropertiesBySelector("marker"); if (markerProperties != null) { pp.getElement().getStyle().setBackgroundColor(markerProperties.bgColor.toString()); pp.getElement().getStyle().setColor(markerProperties.color.toString()); pp.getElement().getStyle().setProperty("fontFamily", markerProperties.fontFamily.toString()); pp.getElement().getStyle().setProperty("fontSize", markerProperties.fontSize.toString()); pp.getElement().getStyle().setPadding(5, Unit.PX); } pp.getElement().getStyle().setZIndex(9999); pp.show(); return new BrowserInfoWindow(this, pp); }
private void showSelectFromMap() { if(!showedSelectFromMapOnce) { showedSelectFromMapOnce = true; final DecoratedPopupPanel simplePopup = new DecoratedPopupPanel(true); simplePopup.setWidth("150px"); simplePopup.setWidget(new HTML(CONSTANTS.selectFromMap())); simplePopup.addStyleName("popup"); simplePopup.center(); Timer t = new Timer() { public void run() { simplePopup.hide(); } }; t.schedule(2000); } }
private void showMessageBox(String message) { hideSpinningCircle(); final DecoratedPopupPanel simplePopup = new DecoratedPopupPanel(true); simplePopup.setWidth("150px"); simplePopup.setWidget(new HTML(message)); simplePopup.addStyleName("popup"); simplePopup.center(); }
private void showMessageBox(String message) { hideSpinningCircle(); final DecoratedPopupPanel simplePopup = new DecoratedPopupPanel(true); simplePopup.setWidth("150px"); simplePopup.setWidget(new HTML(message)); simplePopup.center(); }
@Override public void onFailure(Throwable caught) { DecoratedPopupPanel popupPanel = new DecoratedPopupPanel(true); popupPanel.setWidget(new Label("Connection problem")); popupPanel.setPopupPosition(Window.getClientWidth() / 2, 0); popupPanel.show(); }