public PreloaderCallback getPreloaderCallback () { final Panel preloaderPanel = new VerticalPanel(); preloaderPanel.setStyleName("gdx-preloader"); final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png"); logo.setStyleName("logo"); preloaderPanel.add(logo); final Panel meterPanel = new SimplePanel(); meterPanel.setStyleName("gdx-meter"); meterPanel.addStyleName("red"); final InlineHTML meter = new InlineHTML(); final Style meterStyle = meter.getElement().getStyle(); meterStyle.setWidth(0, Unit.PCT); meterPanel.add(meter); preloaderPanel.add(meterPanel); getRootPanel().add(preloaderPanel); return new PreloaderCallback() { @Override public void error (String file) { System.out.println("error: " + file); } @Override public void update (PreloaderState state) { meterStyle.setWidth(100f * state.getProgress(), Unit.PCT); } }; }
public PreloaderCallback getPreloaderCallback () { final Panel preloaderPanel = new VerticalPanel(); preloaderPanel.setStyleName("gdx-preloader"); final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png"); logo.setStyleName("logo"); preloaderPanel.add(logo); final Panel meterPanel = new SimplePanel(); meterPanel.setStyleName("gdx-meter"); meterPanel.addStyleName("red"); final InlineHTML meter = new InlineHTML(); final Style meterStyle = meter.getElement().getStyle(); meterStyle.setWidth(0, Unit.PCT); meterPanel.add(meter); preloaderPanel.add(meterPanel); getRootPanel().add(preloaderPanel); return new PreloaderCallback() { @Override public void error (String file) { System.out.println("error: " + file); } @Override public void update (PreloaderState state) { meterStyle.setWidth(100f * state.getProgress(), Unit.PCT); } }; }
/** * Creates an image with a specified URL. The load event will be fired once * the image at the given URL has been retrieved by the browser. * * @param url the URL of the image to be displayed */ public Image(SafeUri url) { changeState(new UnclippedState(this, url)); setStyleName("gwt-Image"); }
/** * Creates an empty image. */ public Image() { changeState(new UnclippedState(this)); setStyleName("gwt-Image"); }
/** * Creates a clipped image with a specified URL and visibility rectangle. The * visibility rectangle is declared relative to the rectangle which * encompasses the entire image, which has an upper-left vertex of (0,0). The * load event will be fired immediately after the object has been constructed * (i.e. potentially before the image has been loaded in the browser). Since * the width and height are specified explicitly by the user, this behavior * will not cause problems with retrieving the width and height of a clipped * image in a load event handler. * * @param url the URL of the image to be displayed * @param left the horizontal co-ordinate of the upper-left vertex of the * visibility rectangle * @param top the vertical co-ordinate of the upper-left vertex of the * visibility rectangle * @param width the width of the visibility rectangle * @param height the height of the visibility rectangle */ public Image(SafeUri url, int left, int top, int width, int height) { changeState(new ClippedState(this, url, left, top, width, height)); setStyleName("gwt-Image"); }
/** * Creates an image whose size and content are defined by an ImageResource. * * @param resource the ImageResource to be displayed */ public Image(ImageResource resource) { if (resource instanceof ImageResourcePrototype.Bundle) { changeState(new ClippedState(this, resource.getSafeUri(), resource.getLeft(), resource.getTop(), resource.getWidth(), resource.getHeight())); } else { changeState(new UnclippedState(this, resource.getSafeUri(), resource.getWidth(), resource.getHeight())); } setStyleName("gwt-Image"); }
/** * Creates an image with a specified URL. The load event will be fired once * the image at the given URL has been retrieved by the browser. * * @param url the URL of the image to be displayed */ public Image(SafeUri url) { changeState(new UnclippedState(this, url)); setStyleName("gwt-Image"); }
private Image getPlusMinusWithStyle(final String image, final String tooltip) { final Image operatorWidget = new Image( image ); operatorWidget.setStyleName( "plusMinus" ); operatorWidget.setTitle( tooltip ); return operatorWidget; }
/** * Creates an empty image. */ public Image() { changeState(new UnclippedState(this)); setStyleName("gwt-Image"); }
/** * Creates an empty image. */ public Image() { changeState(new UnclippedState(this)); setStyleName("gwt-Image"); }
/** * Creates an image with a specified URL. The load event will be fired once * the image at the given URL has been retrieved by the browser. * * @param url the URL of the image to be displayed */ public Image(SafeUri url) { changeState(new UnclippedState(this, url)); setStyleName("gwt-Image"); }
/** * Creates a clipped image with a specified URL and visibility rectangle. The * visibility rectangle is declared relative to the rectangle which * encompasses the entire image, which has an upper-left vertex of (0,0). The * load event will be fired immediately after the object has been constructed * (i.e. potentially before the image has been loaded in the browser). Since * the width and height are specified explicitly by the user, this behavior * will not cause problems with retrieving the width and height of a clipped * image in a load event handler. * * @param url the URL of the image to be displayed * @param left the horizontal co-ordinate of the upper-left vertex of the * visibility rectangle * @param top the vertical co-ordinate of the upper-left vertex of the * visibility rectangle * @param width the width of the visibility rectangle * @param height the height of the visibility rectangle */ public Image(SafeUri url, int left, int top, int width, int height) { changeState(new ClippedState(this, url, left, top, width, height)); setStyleName("gwt-Image"); }
public void addImage(String imageUrl) { final Image img = new Image(imageUrl); img.setStyleName("img-circle"); img.getElement().getStyle().setMarginRight(4, Style.Unit.PX); faces.add(img); } }
/** * Image to display file with image type. * * @return {@link Image} */ private Image getImage() { String contentLink = urlModifier.modify(input.getFile().getContentUrl()); Image image = (contentLink != null) ? new Image(contentLink) : new Image(); image.setStyleName(resources.imageViewerCss().imageViewer()); return image; }
/** * */ private void setStatusIndicator() { if ( eiInstance.getWFState() != null && !EIEntity.NULL_ENTITY.equals( eiInstance.getWFState() ) ) { statusIndicator = new FlowPanel(); statusIndicator.setStyleName( "instanceStatus" ); statusIndicator.setTitle( "Status of this resource: " + eiInstance.getWFState().getLabel() ); // expected image name is composed with state label final String statusUrl = "images/dt-status-" + eiInstance.getWFState().getLabel().replaceAll( "\\s+", "" ).toLowerCase() + ".png"; Image statusImage = new Image(statusUrl); statusImage.setStyleName("statusImage"); statusIndicator.add( statusImage ); formPanel.add( statusIndicator ); } }
/** * Sets correct images for the arrows taking into account the current page number. */ protected void setArrows() { int currentPage = getRow().getCurrentPageNumber(); if (currentPage <= 0) left = new Image(ThemeHelper.getInstance().getFullResourceName("advanced/images/single.gif")); else { left = new ThemeImage("bullet-left.gif"); left.setStyleName("arrow-left"); left.addClickHandler(getArrowClickHandler()); } if (currentPage >= getRow().getEndPage()) right = new Image(ThemeHelper.getInstance().getFullResourceName("advanced/images/single.gif")); else { right = new ThemeImage("bullet-right.gif"); right.setStyleName("arrow-right"); right.addClickHandler(getArrowClickHandler()); } }
private void initGlasspane() { final Label resultsLoadingMainMessage = new Label("Your results are loading. Please be patient."); resultsLoadingMainMessage.setStyleName("resultsLoadingMainMessage"); glassPaneMessage.add(resultsLoadingMainMessage); loadingImage.setStyleName("loadingAnimation"); glassPaneMessage.add( loadingImage ); glassPaneMessage.add( new Label("Query powered by") ); glassPaneMessage.add(eiLogo); final Label resultsLoadingSubMessage = new Label("eagle-i is the premier source for publishing information about cell lines and other biomedical research resources for the benefit of the scientific community. eagle-i is a project of Harvard Catalyst at Harvard Medical School."); resultsLoadingSubMessage.setStyleName("resultsLoadingSubMessage"); glassPaneMessage.add(resultsLoadingSubMessage); glassPane.add(glassPaneMessage); }
/** * Creates an image whose size and content are defined by an ImageResource. * * @param resource the ImageResource to be displayed */ public Image(ImageResource resource) { if (resource instanceof ImageResourcePrototype.Bundle) { changeState(new ClippedState(this, resource.getSafeUri(), resource.getLeft(), resource.getTop(), resource.getWidth(), resource.getHeight())); } else { changeState(new UnclippedState(this, resource.getSafeUri(), resource.getWidth(), resource.getHeight())); } setStyleName("gwt-Image"); }
/** * Creates an image whose size and content are defined by an ImageResource. * * @param resource the ImageResource to be displayed */ public Image(ImageResource resource) { if (resource instanceof ImageResourcePrototype.Bundle) { changeState(new ClippedState(this, resource.getSafeUri(), resource.getLeft(), resource.getTop(), resource.getWidth(), resource.getHeight())); } else { changeState(new UnclippedState(this, resource.getSafeUri(), resource.getWidth(), resource.getHeight())); } setStyleName("gwt-Image"); }
public void showDescription(){ helpPanel.clear(); HTMLPanel textPanel = new HTMLPanel(choiceInfo.getTitle()); textPanel.setStyleName(getCSSName("help", "content-text")); helpPanel.add(textPanel); String imageURL = choiceInfo.getImageURL(); Image image = new Image(); image.setStyleName(getCSSName("help", "content-image")); image.setTitle(choiceInfo.getTitle()); if ((imageURL!=null)&&(!imageURL.equals(""))) { image.setUrl(imageURL); } helpPanel.add(image); HTMLPanel descPanel = new HTMLPanel(choiceInfo.getDescription()); descPanel.setStyleName(getCSSName("help", "content-description")); helpPanel.add(descPanel); } }