Example usage for com.google.gwt.user.client.ui AbstractImagePrototype applyTo

List of usage examples for com.google.gwt.user.client.ui AbstractImagePrototype applyTo

Introduction

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

Prototype

public void applyTo(ImagePrototypeElement imageElement) 

Source Link

Document

Transforms an existing ImagePrototypeElement into the image represented by this prototype.

Usage

From source file:com.anzsoft.client.ui.RosterPanel.java

License:Open Source License

private String formatStatusIcon(XmppContactStatus status) {
    final AbstractImagePrototype icon = iconFromStatus(status);
    final Image iconImg = new Image();
    icon.applyTo(iconImg);
    return iconImg.toString();
}

From source file:com.anzsoft.client.utils.ChatTextFormatter.java

License:Open Source License

private static String getImgHtml(final AbstractImagePrototype img) {
    final Image image = new Image();
    DOM.setStyleAttribute(image.getElement(), "vertical-align", "bottom");
    img.applyTo(image);
    image.setStyleName("vamiddle");
    return img.getHTML();
}

From source file:com.anzsoft.client.utils.emotions.EmoticonPalettePanel.java

License:Open Source License

private Image createEmoticon(final AbstractImagePrototype imageProto, final String emoticonText,
        final EmoticonPaletteListener listener) {
    final Image img = new Image();
    imageProto.applyTo(img);
    img.addClickListener(new ClickListener() {

        public void onClick(final Widget arg0) {
            listener.onEmoticonSelected(emoticonText);
        }//w  w w .j  av  a2 s .co m
    });
    img.setTitle(emoticonText);
    return img;
}

From source file:com.calclab.emiteuimodule.client.users.UserGridPanel.java

License:Open Source License

private String formatStatusIcon(final ChatUserUI user) {
    final AbstractImagePrototype icon = ChatUIUtils.getIcon(user.getStatusIcon());
    final Image iconImg = new Image();
    icon.applyTo(iconImg);
    // Don't works:
    // final ToolTip tooltip = new ToolTip();
    // tooltip.setHtml("foo foo foo <b>bold</b> foo foo.");
    // tooltip.setWidth(150);
    // tooltip.applyTo(iconImg.getElement());
    return iconImg.toString();
}

From source file:com.calclab.emiteuimodule.client.utils.ChatTextFormatter.java

License:Open Source License

private static String getImgHtml(final AbstractImagePrototype absImg) {
    final Image image = new Image();
    absImg.applyTo(image);
    image.setStyleName("vamiddle");
    return image.getElement().getString();
}

From source file:com.calclab.emiteuimodule.client.utils.emoticons.EmoticonPalettePanel.java

License:Open Source License

private Image createEmoticon(final AbstractImagePrototype imageProto, final String emoticonText,
        final EmoticonPaletteListener listener) {
    final Image img = new Image();
    imageProto.applyTo(img);
    img.addClickHandler(new ClickHandler() {

        public void onClick(final ClickEvent event) {
            listener.onEmoticonSelected(emoticonText);
        }//from  w  ww. jav a 2s. c om
    });
    img.setTitle(emoticonText);
    return img;
}

From source file:com.fullmetalgalaxy.client.game.board.layertoken.WgtBoardLayerToken.java

License:Open Source License

protected void addWarningImage(Image p_image, AbstractImagePrototype p_absImage, EbToken p_token,
        int p_landPixOffset) {
    if (p_absImage == null) {
        p_image.setVisible(false);/*from   w  w  w. j a  v  a  2  s  . co  m*/
        return;
    }
    add(p_image);
    p_image.setVisible(true);
    p_absImage.applyTo(p_image);

    if (p_token.getPosition().getY() < m_cropTopHex) {
        DOM.setStyleAttribute(p_image.getElement(), "zIndex",
                Integer.toString(p_token.getZIndex(GameEngine.game().getLandHeight())));
    } else {
        DOM.setStyleAttribute(p_image.getElement(), "zIndex", Integer.toString(p_token.getZIndex()));
    }

    setWidgetHexPosition(p_image, p_token.getPosition(), p_landPixOffset);
}

From source file:com.fullmetalgalaxy.client.game.board.WgtBoardLayerAction.java

License:Open Source License

private void drawImage(AbstractImagePrototype p_image, AnBoardPosition p_position) {
    Image image = m_images.getNextImage();
    p_image.applyTo(image);
    DOM.setStyleAttribute(image.getElement(), "zIndex", "1000");
    image.removeStyleName("transparent50");
    setWidgetHexPosition(image, p_position);
}

From source file:com.fullmetalgalaxy.client.game.board.WgtBoardLayerAction.java

License:Open Source License

private void drawTransparentImage(AbstractImagePrototype p_image, AnBoardPosition p_position) {
    Image image = m_images.getNextImage();
    p_image.applyTo(image);
    DOM.setStyleAttribute(image.getElement(), "zIndex", "1000");
    image.addStyleName("transparent50");
    setWidgetHexPosition(image, p_position);
}

From source file:com.fullmetalgalaxy.client.game.board.WgtBoardLayerLocked.java

License:Open Source License

private Image addImage() {
    AbstractImagePrototype imageprototype = AbstractImagePrototype.create(Icons.s_instance.strategy_padlock());
    if (GameEngine.model().getZoomDisplayed().getValue() == EnuZoom.Medium) {
        imageprototype = AbstractImagePrototype.create(Icons.s_instance.tactic_padlock());
    }//w w  w  .  ja  v  a 2  s.c o m
    Image image = null;
    if (!m_unusedImages.isEmpty()) {
        image = m_unusedImages.iterator().next();
        imageprototype.applyTo(image);
        image.setVisible(true);
        m_unusedImages.remove(image);
    } else {
        image = imageprototype.createImage();
        add(image);
        DOM.setStyleAttribute(image.getElement(), "zIndex", "1000");
        image.addStyleName("transparent50");
    }
    m_usedImages.add(image);
    return image;
}