Example usage for com.google.gwt.user.client.ui.impl ClippedImagePrototype ClippedImagePrototype

List of usage examples for com.google.gwt.user.client.ui.impl ClippedImagePrototype ClippedImagePrototype

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui.impl ClippedImagePrototype ClippedImagePrototype.

Prototype

@Deprecated
    public ClippedImagePrototype(String url, int left, int top, int width, int height) 

Source Link

Usage

From source file:com.extjs.gxt.ui.client.util.IconHelper.java

License:sencha.com license

/**
 * Returns an image for the given url./*w  ww  .  j  a  va  2s  . com*/
 * 
 * @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;
}

From source file:com.google.appinventor.client.editor.simple.components.MockComponent.java

License:Open Source License

/**
 * Constructs a tree item for the component which will be displayed in the
 * source structure explorer./* ww w . j a  v  a 2 s.  c o m*/
 *
 * @return  tree item for this component
 */
protected TreeItem buildTree() {
    // Instantiate new tree item for this component
    // Note: We create a ClippedImagePrototype because we need something that can be
    // used to get HTML for the iconImage. AbstractImagePrototype requires
    // an ImageResource, which we don't necessarily have.
    String imageHTML = new ClippedImagePrototype(iconImage.getUrl(), iconImage.getOriginLeft(),
            iconImage.getOriginTop(), ICON_IMAGE_WIDTH, ICON_IMAGE_HEIGHT).getHTML();
    TreeItem itemNode = new TreeItem(new HTML("<span>" + imageHTML + getName() + "</span>"));
    itemNode.setUserObject(sourceStructureExplorerItem);
    return itemNode;
}

From source file:com.google.appinventor.client.editor.simple.components.MockComponent.java

License:Open Source License

/**
 * If this component isn't a Form, and this component's type isn't already in typesAndIcons,
 * adds this component's type name as a key to typesAndIcons, mapped to the HTML string used
 * to display the component type's icon. Subclasses that contain components should override
 * this to add their own info as well as that for their contained components.
 * @param typesAndIcons/* w  w  w .ja  v a  2 s .  c o  m*/
 */
public void collectTypesAndIcons(Map<String, String> typesAndIcons) {
    String name = getVisibleTypeName();
    if (!isForm() && !typesAndIcons.containsKey(name)) {
        String imageHTML = new ClippedImagePrototype(iconImage.getUrl(), iconImage.getOriginLeft(),
                iconImage.getOriginTop(), ICON_IMAGE_WIDTH, ICON_IMAGE_HEIGHT).getHTML();
        typesAndIcons.put(name, imageHTML);
    }
}

From source file:org.drools.guvnor.client.ruleeditor.RolodexImageSetWidget.java

License:Apache License

private ClippedImagePrototype getClip() {
    //TODO: if the attachment doesn't exist AssetFileServlet will throw an NPE
    //TODO: need to find out how to check the condition if an attachment exists for a given UUID
    return new ClippedImagePrototype(
            GWT.getModuleBaseURL() + "asset?" + HTMLFileManagerFields.FORM_FIELD_UUID + "=" + asset.uuid, 0, 0,
            300, 200);//from www  . j av  a 2 s  . c om
}

From source file:org.jbpm.form.builder.ng.model.client.form.items.ImageRolodexFormItem.java

License:Apache License

private RolodexCard createCard(String url) {
    SafeUri surl = UriUtils.fromString(url);
    ClippedImagePrototype expanded = new ClippedImagePrototype(surl, 0, 0, getOffsetWidth() / 2,
            getOffsetHeight());//from  w  w w  . j a  v a  2  s.c o  m
    ClippedImagePrototype collapseLeft = new ClippedImagePrototype(surl, 0, 0, getOffsetWidth() / 4,
            getOffsetHeight() / 2);
    ClippedImagePrototype collapseRight = new ClippedImagePrototype(surl, 0, 0, getOffsetWidth() / 4,
            getOffsetHeight() / 2);
    int expandedWidth = getOffsetWidth() / 2;
    int collapsedWidth = getOffsetWidth() / 4;
    int heightOffset = getOffsetHeight() / 4;
    RolodexCard card = new RolodexCard(expanded, collapseLeft, collapseRight, expandedWidth, collapsedWidth,
            heightOffset);
    return card;
}

From source file:org.jbpm.formbuilder.client.form.items.ImageRolodexFormItem.java

License:Apache License

private RolodexCard createCard(String url) {
    ClippedImagePrototype expanded = new ClippedImagePrototype(url, 0, 0, getOffsetWidth() / 2,
            getOffsetHeight());//  ww  w  . j  av a2  s.  com
    ClippedImagePrototype collapseLeft = new ClippedImagePrototype(url, 0, 0, getOffsetWidth() / 4,
            getOffsetHeight() / 2);
    ClippedImagePrototype collapseRight = new ClippedImagePrototype(url, 0, 0, getOffsetWidth() / 4,
            getOffsetHeight() / 2);
    int expandedWidth = getOffsetWidth() / 2;
    int collapsedWidth = getOffsetWidth() / 4;
    int heightOffset = getOffsetHeight() / 4;
    RolodexCard card = new RolodexCard(expanded, collapseLeft, collapseRight, expandedWidth, collapsedWidth,
            heightOffset);
    return card;
}