/** * Create an AbstractImagePrototype backed by a ClientBundle ImageResource. * This method provides an API compatibility mapping for the new ImageResource * API. * * @param resource an ImageResource produced by a ClientBundle * @return an AbstractImagePrototype that displays the contents of the * ImageResource */ public static AbstractImagePrototype create(ImageResource resource) { // for backwards compatilibity, and to keep things simple, we treat standalone resources the // same as composite ones (which means using a clear gif with the image as the CSS background) return new ClippedImagePrototype(resource.getSafeUri(), resource.getLeft(), resource.getTop(), resource.getWidth(), resource.getHeight()); }
/** * Returns an image for the given url. * * @param url the image url * @param width the image width in pixels * @param height the image height in pixels * @return the image */ public static AbstractImagePrototype createPath(String url, int width, int height) { @SuppressWarnings("deprecation") ClippedImagePrototype c = new ClippedImagePrototype(url, 0, 0, width, height); return c; }
@Override public RolodexCard[] getRolodexCards() { RolodexCard[] cards = new RolodexCard[3]; for (int index = 0; index < 3; index++) { ClippedImagePrototype expanded = new ClippedImagePrototype(defaultImage.getURL(), 0, 0, 300, 200); ClippedImagePrototype collapseLeft = new ClippedImagePrototype(defaultImage.getURL(), 0, 0, 100, 100); ClippedImagePrototype collapseRight = new ClippedImagePrototype(defaultImage.getURL(), 0, 0, 100, 100); cards[index] = new RolodexCard(expanded, collapseLeft, collapseRight, 300, 100, 0); } return cards; }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (method.getReturnType() == AbstractImagePrototype.class) { String url = getImageUrl(method); return new ClippedImagePrototype(url, 0, 0, 0, 0); } throw new GwtTestResourcesException("Not managed return type for image bundle : " + method.getReturnType().getSimpleName()); }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (method.getReturnType() == AbstractImagePrototype.class) { String url = getImageUrl(method); return new ClippedImagePrototype(url, 0, 0, 0, 0); } throw new GwtTestResourcesException("Not managed return type for image bundle : " + method.getReturnType().getSimpleName()); }
/** * Create an AbstractImagePrototype backed by a ClientBundle ImageResource. * This method provides an API compatibility mapping for the new ImageResource * API. * * @param resource an ImageResource produced by a ClientBundle * @return an AbstractImagePrototype that displays the contents of the * ImageResource */ public static AbstractImagePrototype create(ImageResource resource) { // for backwards compatilibity, and to keep things simple, we treat standalone resources the // same as composite ones (which means using a clear gif with the image as the CSS background) return new ClippedImagePrototype(resource.getSafeUri(), resource.getLeft(), resource.getTop(), resource.getWidth(), resource.getHeight()); }
/** * Create an AbstractImagePrototype backed by a ClientBundle ImageResource. * This method provides an API compatibility mapping for the new ImageResource * API. * * @param resource an ImageResource produced by a ClientBundle * @return an AbstractImagePrototype that displays the contents of the * ImageResource */ public static AbstractImagePrototype create(ImageResource resource) { // for backwards compatilibity, and to keep things simple, we treat standalone resources the // same as composite ones (which means using a clear gif with the image as the CSS background) return new ClippedImagePrototype(resource.getSafeUri(), resource.getLeft(), resource.getTop(), resource.getWidth(), resource.getHeight()); }