Example usage for com.google.gwt.dom.client Style setOpacity

List of usage examples for com.google.gwt.dom.client Style setOpacity

Introduction

In this page you can find the example usage for com.google.gwt.dom.client Style setOpacity.

Prototype

public void setOpacity(double value) 

Source Link

Usage

From source file:org.cruxframework.crux.widgets.client.uploader.FileButton.java

License:Apache License

public FileButton() {
    mainPanel = new FlowPanel();
    mainPanel.getElement().getStyle().setPosition(Position.RELATIVE);

    fileInput = new FileInput();

    Style style = fileInput.getElement().getStyle();
    style.setPosition(Position.ABSOLUTE);
    style.setTextAlign(TextAlign.RIGHT);
    style.setOpacity(0);
    style.setProperty("cursor", "inherit");
    style.setZIndex(2);//  w w w .  j av a  2 s .  c o m
    style.setWidth(100, Unit.PCT);
    style.setHeight(100, Unit.PCT);
    style.setTop(0, Unit.PX);
    style.setLeft(0, Unit.PX);
    mainPanel.add(fileInput);

    visibleButton = new Label();
    visibleButton.setStyleName("chooseButton");
    style = visibleButton.getElement().getStyle();
    style.setPosition(Position.ABSOLUTE);
    style.setTop(0, Unit.PX);
    style.setLeft(0, Unit.PX);
    style.setZIndex(1);
    style.setWidth(100, Unit.PCT);
    style.setHeight(100, Unit.PCT);
    mainPanel.add(visibleButton);

    initWidget(mainPanel);
    setStyleName("crux-FileButton");
}

From source file:org.nsesa.editor.gwt.core.client.ui.document.sourcefile.SourceFileController.java

License:EUPL

private void setOpacity(Widget overlayWidget, String color, double opacity) {
    final Style style = overlayWidget.getElement().getStyle();
    style.setOpacity(opacity);
    if (opacity != 0.0 && opacity < 0.3) {

    }//from   w w  w.j av a 2  s  .c  o m
}

From source file:org.nsesa.editor.gwt.core.client.ui.notification.NotificationController.java

License:EUPL

/**
 * Set the opacity on this view./*from   www. j  a  va2s.co m*/
 *
 * @param opacity the new opacity
 */
private void setOpacity(double opacity) {
    final Style style = popupPanel.getElement().getStyle();
    style.setOpacity(opacity);
    if (opacity != 0.0 && opacity < 0.3) {
        hide();
    }
}

From source file:org.rstudio.core.client.layout.FadeOutAnimation.java

License:Open Source License

@Override
protected void onComplete() {
    for (Widget w : widgets_) {
        Style style = w.getElement().getStyle();
        style.setDisplay(Style.Display.NONE);
        style.setOpacity(1.0);
    }/*from   w w  w.j  av  a 2s  . c om*/
    if (callback_ != null)
        callback_.execute();
}

From source file:org.uberfire.ext.wires.core.grids.client.widget.dom.impl.BaseDOMElement.java

License:Apache License

/**
 * Transform the DOMElement based on the render context, such as scale and position.
 * @param context/*from  w w w  .j a  v  a  2 s.c  o  m*/
 */
protected void transform(final GridBodyCellRenderContext context) {
    final Transform transform = context.getTransform();
    final double width = context.getCellWidth();
    final double height = context.getCellHeight();

    final Style style = widgetContainer.getElement().getStyle();

    //Copy across GridWidget's opacity to DOMElements
    style.setOpacity(gridWidget.getAlpha());

    //Reposition and transform the DOM Element
    style.setLeft((context.getAbsoluteCellX() * transform.getScaleX()) + transform.getTranslateX(),
            Style.Unit.PX);
    style.setTop((context.getAbsoluteCellY() * transform.getScaleY()) + transform.getTranslateY(),
            Style.Unit.PX);
    style.setWidth(width, Style.Unit.PX);
    style.setHeight(height, Style.Unit.PX);

    //If the DOMElement overlaps a fixed header clip content
    style.clearProperty("clip");
    final double top = context.getAbsoluteCellY() + transform.getTranslateY();
    final double left = context.getAbsoluteCellX() + transform.getTranslateX();
    final boolean isFloating = context.isFloating();
    boolean clip = false;
    double ct = 0.0;
    double cr = width;
    double cb = height;
    double cl = 0.0;

    final Group header = gridWidget.getHeader();
    final double clipMinY = context.getClipMinY() + transform.getTranslateY();
    final double clipMinX = context.getClipMinX() + transform.getTranslateX();
    if (header != null) {
        if (top < clipMinY) {
            ct = clipMinY - top;
            clip = true;
        }
    }
    if (!isFloating && left < clipMinX) {
        cl = clipMinX - left;
        clip = true;
    }
    if (clip) {
        style.setProperty("clip",
                "rect(" + (int) ct + "px," + (int) cr + "px," + (int) cb + "px," + (int) cl + "px)");
    }

    // --- Workaround for BS2 ---
    style.setProperty("WebkitBoxSizing", "border-box");
    style.setProperty("MozBoxSizing", "border-box");
    style.setProperty("boxSizing", "border-box");
    style.setProperty("lineHeight", "normal");
    // --- End workaround ---

    if (MathUtilities.isOne(transform.getScaleX()) && MathUtilities.isOne(transform.getScaleY())) {
        style.clearProperty("WebkitTransform");
        style.clearProperty("MozTransform");
        style.clearProperty("Transform");
        style.clearProperty("MsTransform");
        return;
    }

    final String scale = "scale(" + FORMAT.format(transform.getScaleX()) + ", "
            + FORMAT.format(transform.getScaleY()) + ")";
    final String translate = "translate(" + FORMAT.format(((width - width * transform.getScaleX()) / -2.0))
            + "px, " + FORMAT.format(((height - height * transform.getScaleY()) / -2.0)) + "px)";
    style.setProperty("WebkitTransform", translate + " " + scale);
    style.setProperty("MozTransform", translate + " " + scale);
    style.setProperty("Transform", translate + " " + scale);
    style.setProperty("MsTransform", translate + " " + scale);
}

From source file:org.vaadin.sasha.portallayout.client.dnd.MouseDragHandler.java

License:Apache License

private void initCapturingWidget() {
    capturingWidget = new FocusPanel();
    capturingWidget.addMouseMoveHandler(this);
    capturingWidget.addMouseUpHandler(this);
    capturingWidget.addTouchMoveHandler(this);
    capturingWidget.addTouchEndHandler(this);
    capturingWidget.addTouchCancelHandler(this);
    Style style = capturingWidget.getElement().getStyle();
    // workaround for IE8 opacity
    // http://code.google.com/p/google-web-toolkit/issues/detail?id=5538
    style.setProperty("filter", "alpha(opacity=0)");
    style.setOpacity(0);
    style.setZIndex(1000);//from   w ww .  j  av  a 2s. co m
    style.setMargin(0, Style.Unit.PX);
    style.setBorderStyle(BorderStyle.NONE);
    style.setBackgroundColor("blue");
}

From source file:stroom.dashboard.client.vis.VisPresenter.java

License:Apache License

@Inject
public VisPresenter(final EventBus eventBus, final VisView view,
        final Provider<VisSettingsPresenter> settingsPresenterProvider, final ClientDispatchAsync dispatcher) {
    super(eventBus, view, settingsPresenterProvider);
    this.visFunctionCache = new VisFunctionCache(eventBus);
    this.scriptCache = new ScriptCache(eventBus);
    this.dispatcher = dispatcher;

    visFrame = new VisFrame();
    visPane = visFrame;/*from  w ww .ja v  a  2s  .c o m*/
    view.setVisPane(visPane);

    final Style style = visFrame.getElement().getStyle();
    style.setPosition(Position.ABSOLUTE);
    style.setOpacity(0);
    style.setZIndex(2);

    RootPanel.get().add(visFrame);
}