Example usage for com.google.gwt.user.client.ui HTML HTML

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

Introduction

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

Prototype

protected HTML(Element element) 

Source Link

Document

This constructor may be used by subclasses to explicitly use an existing element.

Usage

From source file:at.ait.dme.yuma.client.image.shape.ShapePanel.java

License:EUPL

/**
 * reset the js graphics panel to redraw the shape.
 * //  w w w  .ja v  a2s  .  c o m
 * @param width
 * @param height
 */
private void resetGraphicsPanel(int width, int height) {
    String graphicsId = "graphic" + new Integer(counter++).toString();
    if (dragPanel.getWidget() != null)
        dragPanel.remove(graphicsPanel);

    graphicsDiv = new HTML("<div id=\"" + graphicsId + "\"></div>");
    boundaryPanel.add(graphicsDiv);

    graphicsPanel = new JsGraphicsPanel(graphicsId);
    graphicsPanel.setPixelSize(width, height);
    graphicsPanel
            .setColor(new Color(shape.getColor().getR(), shape.getColor().getG(), shape.getColor().getB()));
    graphicsPanel.setStrokeWidth(shape.getStrokeWidth());
}

From source file:at.ait.dme.yuma.client.map.annotation.ControlPointComposite.java

License:EUPL

@Override
protected Widget createHeader() {
    // The parent header panel
    FlowPanel header = new FlowPanel();

    // 'Help geo-Reference' label
    Label addAnnotationLabel = new Label(Application.getConstants().helpGeoreference());
    addAnnotationLabel.setStyleName("imageAnnotation-add-annotation");
    header.add(addAnnotationLabel);/*from w  ww  .j a va 2s.  c om*/

    // 'Help' link
    HTML help = new HTML(
            "<a target=\"_blank\" href=\"userguide_" + LocaleInfo.getCurrentLocale().getLocaleName()
                    + ".html\">" + Application.getConstants().help() + "</a>");
    help.setStyleName("imageAnnotation-help");
    header.add(help);

    // Instructions text
    Label addAnnotationHint = new Label(Application.getConstants().helpGeoreferenceHint());
    addAnnotationHint.setStyleName("imageAnnotation-add-annotation-hint");
    header.add(addAnnotationHint);

    // Button panel
    HorizontalPanel buttons = new HorizontalPanel();

    // 'Create Control Point' button
    createButton = new PushButton(Application.getConstants().actionCreateCP());
    createButton.setStyleName("imageAnnotation-button");
    createButton.addClickHandler(new CreateImageAnnotationClickHandler(this, null, false, false));
    createButton.setEnabled(!Application.getUser().isEmpty());
    buttons.add(createButton);

    header.add(buttons);

    // Placeholder for the annotation form 
    header.add(annotationFormPanel);

    return header;
}

From source file:at.ait.dme.yuma.client.map.explore.ExplorationComposite.java

License:EUPL

public ExplorationComposite(TiledImageComposite imageComposite) {
    // Container stack panel
    containerPanel = new StackLayoutPanel(Unit.EM);

    AnnotationConstants i18n = Application.getConstants();

    // Map metadata
    containerPanel.add(new HTML("Map thumbnail and metadata will be shown here..."), i18n.aboutThisMap(), 3);

    // Search panel
    containerPanel.add(new SearchPanel(imageComposite), i18n.placeSearch(), 3);

    // Vector overlay panel
    containerPanel.add(new KMLOverlayPanel(imageComposite), i18n.dataOverlay(), 3);
    containerPanel.showWidget(0);// w w w . j  a  v a 2s .  c  o m

    initWidget(containerPanel);
}

From source file:at.ait.dme.yuma.client.map.tagcloud.RaphaelTag.java

License:EUPL

public RaphaelTag(SemanticTag tag, int x, int y, int fontsize, String hiliteColor, String hAlign, String vAlign,
        Raphael paper, TagSelectionListener listener) {
    this.tag = tag;
    this.fontsize = fontsize;
    this.hiliteCol = hiliteColor;
    this.listener = listener;

    // Text/*from   w  w  w.ja v  a 2s .  co  m*/
    textEl = paper.text(x, y, tag.getTitle(), TagCloud.FONT, fontsize, hAlign, TagCloud.TAG_TEXT_COLOR, 0);
    bbox = textEl.getBBox();

    // Background
    backgroundEl = paper.rect((int) bbox.getX() - 5, (int) bbox.getY(), (int) bbox.getWidth() + 10,
            (int) bbox.getHeight(), TagCloud.TAG_CORNER_RADIUS, TagCloud.TAG_BACKGROUND_COLOR,
            TagCloud.TAG_BACKGROUND_COLOR, 0);
    backgroundEl.toBack();

    // Foreground (invisible - only for catching mouse events!)
    foregroundEl = paper.rect((int) bbox.getX(), (int) bbox.getY(), (int) bbox.getWidth(),
            (int) bbox.getHeight(), 0, TagCloud.TAG_TEXT_COLOR, TagCloud.TAG_TEXT_COLOR, 0,
            new MouseEventHandler() {
                @Override
                public void onMouseOver(NativeEvent event) {
                    textEl.setFillColor(hiliteCol);
                    tooltip.setPopupPosition(event.getClientX() + 15, event.getClientY());
                    tooltip.show();
                }

                @Override
                public void onMouseMove(NativeEvent event) {
                    tooltip.setPopupPosition(event.getClientX() + 15, event.getClientY());
                }

                @Override
                public void onMouseOut(NativeEvent event) {
                    textEl.setFillColor(TagCloud.TAG_TEXT_COLOR);
                    tooltip.hide();
                }

                @Override
                public void onClick(NativeEvent event) {
                    setSelected(!isSelected);
                }
            });
    foregroundEl.setCursorStyle("pointer");
    foregroundEl.toFront();

    // 'Selected' icon
    iconEl = paper.image(TagCloud.TAG_SELECTED_ICON, (int) bbox.getX() + (int) bbox.getWidth() - 15,
            (int) bbox.getY() + (int) bbox.getHeight() - 30, TagCloud.TAG_SELECTED_ICON_WIDTH,
            TagCloud.TAG_SELECTED_ICON_HEIGHT);
    iconEl.hide();

    // Adjust vertical alignment
    int dy;
    if (vAlign.equals(TagCloud.VALIGN_BOTTOM)) {
        dy = -(int) bbox.getHeight() / 2;
        textEl.translate(0, dy);
        backgroundEl.translate(0, dy);
        foregroundEl.translate(0, dy);
        iconEl.translate(0, dy);
    } else if (vAlign.equals(TagCloud.VALIGN_TOP)) {
        dy = (int) bbox.getHeight() / 2;
        textEl.translate(0, dy);
        backgroundEl.translate(0, dy);
        foregroundEl.translate(0, dy);
        iconEl.translate(0, dy);
    }

    // Tooltip
    tooltip = new PopupPanel();
    tooltip.setStyleName("tooltip");
    tooltip.setWidget(new HTML(tag.getDescription() + "<br/><b>" + tag.getURI()));
    tooltip.hide();
}

From source file:at.ait.dme.yuma.suite.apps.core.client.treeview.AnnotationPanel.java

License:EUPL

/**
 * show hints and create link to help page
 *///from   w w  w.j av a  2  s.com
protected Widget createHeader() {
    // The parent header panel
    FlowPanel header = new FlowPanel();

    // 'Add your Annotation' label
    Label addAnnotationLabel = new Label(YUMACoreProperties.getConstants().addAnnotation());
    addAnnotationLabel.setStyleName("imageAnnotation-add-annotation");
    header.add(addAnnotationLabel);

    // 'Loading' animation
    header.add(loadingImage);

    // 'Help' link
    HTML help = new HTML(
            "<a target=\"_blank\" href=\"userguide_" + LocaleInfo.getCurrentLocale().getLocaleName()
                    + ".html\">" + YUMACoreProperties.getConstants().help() + "</a>");
    help.setStyleName("imageAnnotation-help");
    header.add(help);

    // Instructions text
    Label addAnnotationHint = new Label(YUMACoreProperties.getConstants().addAnnotationHint());
    addAnnotationHint.setStyleName("imageAnnotation-add-annotation-hint");
    header.add(addAnnotationHint);

    // Button panel
    HorizontalPanel buttons = new HorizontalPanel();

    // 'Annotate' button
    annotateButton.setStyleName("imageAnnotation-button");
    annotateButton.setText(YUMACoreProperties.getConstants().annotate());
    annotateButton.addClickHandler(new AnnotateClickHandler(this, null, null, false));
    annotateButton.setEnabled(!User.get().isAnonymous());
    buttons.add(annotateButton);

    // 'Annotate Fragment' button
    annotateFragmentButton.setStyleName("imageAnnotation-button");
    annotateFragmentButton.setText(YUMACoreProperties.getConstants().annotateFragment());
    annotateFragmentButton.addClickHandler(new AnnotateClickHandler(this, null, null, true));
    annotateFragmentButton.setEnabled(!User.get().isAnonymous());
    buttons.add(annotateFragmentButton);

    header.add(buttons);
    return header;
}

From source file:at.ait.dme.yuma.suite.apps.image.core.client.tagcloud.RaphaelTag.java

License:EUPL

public RaphaelTag(SemanticTag tag, int x, int y, int fontsize, String hiliteColor, String hAlign, String vAlign,
        Raphael paper, TagSelectionListener listener) {
    this.tag = tag;
    this.fontsize = fontsize;
    this.hiliteCol = hiliteColor;
    this.listener = listener;

    // Text/*from   w  w  w.  j a va  2 s .c o  m*/
    textEl = paper.text(x, y, tag.getPrimaryLabel(), TagCloud.FONT, fontsize, hAlign, TagCloud.TAG_TEXT_COLOR,
            0);
    bbox = textEl.getBBox();

    // Background
    backgroundEl = paper.rect((int) bbox.getX() - 5, (int) bbox.getY(), (int) bbox.getWidth() + 10,
            (int) bbox.getHeight(), TagCloud.TAG_CORNER_RADIUS, TagCloud.TAG_BACKGROUND_COLOR,
            TagCloud.TAG_BACKGROUND_COLOR, 0);
    backgroundEl.toBack();

    // Foreground (invisible - only for catching mouse events!)
    foregroundEl = paper.rect((int) bbox.getX(), (int) bbox.getY(), (int) bbox.getWidth(),
            (int) bbox.getHeight(), 0, TagCloud.TAG_TEXT_COLOR, TagCloud.TAG_TEXT_COLOR, 0,
            new MouseEventHandler() {
                @Override
                public void onMouseOver(NativeEvent event) {
                    textEl.setFillColor(hiliteCol);
                    tooltip.setPopupPosition(event.getClientX() + 15, event.getClientY());
                    tooltip.show();
                }

                @Override
                public void onMouseMove(NativeEvent event) {
                    tooltip.setPopupPosition(event.getClientX() + 15, event.getClientY());
                }

                @Override
                public void onMouseOut(NativeEvent event) {
                    textEl.setFillColor(TagCloud.TAG_TEXT_COLOR);
                    tooltip.hide();
                }

                @Override
                public void onClick(NativeEvent event) {
                    setSelected(!isSelected);
                }
            });
    foregroundEl.setCursorStyle("pointer");
    foregroundEl.toFront();

    // 'Selected' icon
    iconEl = paper.image(TagCloud.TAG_SELECTED_ICON, (int) bbox.getX() + (int) bbox.getWidth() - 15,
            (int) bbox.getY() + (int) bbox.getHeight() - 30, TagCloud.TAG_SELECTED_ICON_WIDTH,
            TagCloud.TAG_SELECTED_ICON_HEIGHT);
    iconEl.hide();

    // Adjust vertical alignment
    int dy;
    if (vAlign.equals(TagCloud.VALIGN_BOTTOM)) {
        dy = -(int) bbox.getHeight() / 2;
        textEl.translate(0, dy);
        backgroundEl.translate(0, dy);
        foregroundEl.translate(0, dy);
        iconEl.translate(0, dy);
    } else if (vAlign.equals(TagCloud.VALIGN_TOP)) {
        dy = (int) bbox.getHeight() / 2;
        textEl.translate(0, dy);
        backgroundEl.translate(0, dy);
        foregroundEl.translate(0, dy);
        iconEl.translate(0, dy);
    }

    // Tooltip
    tooltip = new PopupPanel();
    tooltip.setStyleName("tooltip");
    tooltip.setWidget(new HTML(tag.getPrimaryDescription() + "<br/><b>" + tag.getURI()));
    tooltip.hide();
}

From source file:at.ait.dme.yuma.suite.apps.map.client.georeferencing.ControlPointPanel.java

License:EUPL

@Override
protected Widget createHeader() {
    // The parent header panel
    FlowPanel header = new FlowPanel();

    // 'Help geo-Reference' label
    Label addAnnotationLabel = new Label(YUMACoreProperties.getConstants().helpGeoreference());
    addAnnotationLabel.setStyleName("imageAnnotation-add-annotation");
    header.add(addAnnotationLabel);/*from ww  w  .  ja  v  a  2s.co m*/

    // 'Help' link
    HTML help = new HTML(
            "<a target=\"_blank\" href=\"userguide_" + LocaleInfo.getCurrentLocale().getLocaleName()
                    + ".html\">" + YUMACoreProperties.getConstants().help() + "</a>");
    help.setStyleName("imageAnnotation-help");
    header.add(help);

    // Instructions text
    Label addAnnotationHint = new Label(YUMACoreProperties.getConstants().helpGeoreferenceHint());
    addAnnotationHint.setStyleName("imageAnnotation-add-annotation-hint");
    header.add(addAnnotationHint);

    // Button panel
    HorizontalPanel buttons = new HorizontalPanel();

    // 'Create Control Point' button
    createButton = new PushButton(YUMACoreProperties.getConstants().actionCreateCP());
    createButton.setStyleName("imageAnnotation-button");
    createButton.addClickHandler(new AnnotateClickHandler(this, null, null, false));
    createButton.setEnabled(!User.get().isAnonymous());
    buttons.add(createButton);

    if (YUMACoreProperties.getObjectURI().startsWith("http://georeferencer"))
        createButton.setEnabled(false);

    header.add(buttons);

    // Placeholder for the annotation form 
    header.add(editFormPanel);

    return header;
}

From source file:bingo.client.BingoCell.java

License:Open Source License

public void setVotes(String votes, String total) {
    this.remove(this.votes);
    this.votes = new HTML(votes + "/" + total);
    this.votes.setStyleName("cell-votes");
    this.setWidget(2, 0, this.votes);
}

From source file:br.com.pegasus.solutions.smartgwt.lib.client.upload.FileUploader.java

License:Apache License

public void setMultipleFilesTrue() {
    form.add(new HTML("<input type='file' id='fileselect' name='fileselect[]' multiple />"));
}

From source file:br.usp.icmc.gazetteer.client.view.impl.Mapa.java

License:Apache License

public void addButtons() {

    addPoint(map);/*from w w  w.j a v  a 2 s.c o m*/
    addLineString(map);
    addPolygon(map);
    deleteFeatures(map);
    components.addStyleName("button_map");
    components.add(rbNavigate);
    components.add(rbDrawPoint);
    components.add(rbDrawLine);
    components.add(rbDrawPolygon);
    components.add(cbClickOut);
    final HorizontalPanel hpCbClickOut = new HorizontalPanel();
    hpCbClickOut.add(new HTML("         "));
    components.add(hpCbClickOut);

    rbNavigate.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            desativeAll();
        }
    });
    rbDrawPoint.addClickHandler(new ClickHandler() {
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            drawPointFeatureControl.activate();
        }
    });
    rbDrawLine.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            drawLineFeatureControl.activate();

        }
    });
    rbDrawPolygon.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            drawPolygonFeatureControl.activate();
        }
    });
    cbClickOut.addClickHandler(new ClickHandler() {

        @Override
        public void onClick(ClickEvent event) {
            desativeAll();
            clearAllPoint();
            deleteFeatureControl.activate();
        }
    });

}