当前位置: 首页>>代码示例>>Java>>正文


Java Style.setHeight方法代码示例

本文整理汇总了Java中com.google.gwt.dom.client.Style.setHeight方法的典型用法代码示例。如果您正苦于以下问题:Java Style.setHeight方法的具体用法?Java Style.setHeight怎么用?Java Style.setHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.dom.client.Style的用法示例。


在下文中一共展示了Style.setHeight方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onClick

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
@Override
public void onClick(ClickEvent event) {
    if (animationEnabled) {
        Element inkElement = ink.getElement();

        inkElement.removeClassName(Class.ANIMATE.getName());

        Style style = inkElement.getStyle();
        int size = panel.getOffsetWidth();

        style.setWidth(size, Style.Unit.PX);
        style.setHeight(size, Style.Unit.PX);
        style.setMarginLeft(-size / 2, Style.Unit.PX);
        style.setMarginTop(-size / 2, Style.Unit.PX);

        style.setLeft(event.getX(), Style.Unit.PX);
        style.setTop(event.getY(), Style.Unit.PX);

        inkElement.addClassName(Class.ANIMATE.getName());
    }
}
 
开发者ID:snogaraleal,项目名称:wbi,代码行数:22,代码来源:MaterialItem.java

示例2: downloadFileById

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
public void downloadFileById(String resourceId) {
    final String url = getResourceUrl(resourceId);
    if (url != null && !url.isEmpty()) {
        final IFrameElement iframe = Document.get().createIFrameElement();

        Style style = iframe.getStyle();
        style.setVisibility(Style.Visibility.HIDDEN);
        style.setHeight(0, Style.Unit.PX);
        style.setWidth(0, Style.Unit.PX);

        iframe.setFrameBorder(0);
        iframe.setTabIndex(-1);
        iframe.setSrc(url);
        RootPanel.getBodyElement().appendChild(iframe);

        Timer removeTimer = new Timer() {
            @Override
            public void run() {
                iframe.removeFromParent();
            }
        };
        removeTimer.schedule(60 * 1000);
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:25,代码来源:CubaFileDownloaderConnector.java

示例3: onClick

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
@Override
public void onClick(ClickEvent event) {
    if (animationEnabled) {
        ink.removeClassName(Class.ANIMATE.getName());

        Style style = ink.getStyle();
        int size = anchor.getOffsetWidth();

        style.setWidth(size, Style.Unit.PX);
        style.setHeight(size, Style.Unit.PX);
        style.setMarginLeft(-size / 2, Style.Unit.PX);
        style.setMarginTop(-size / 2, Style.Unit.PX);

        style.setLeft(event.getX(), Style.Unit.PX);
        style.setTop(event.getY(), Style.Unit.PX);

        ink.addClassName(Class.ANIMATE.getName());
    }
}
 
开发者ID:snogaraleal,项目名称:wbi,代码行数:20,代码来源:MaterialButton.java

示例4: showMap

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
/**
 * @param element
 * @param lines
 * @param params
 */
public static void showMap (Element element, List<String> lines,
		Map<String, String> params) {
	Style s = element.getStyle();

	float width = floatParam(params, "width", 100);
	Unit widthUnits = unitParam(params, "widthUnits", Unit.PCT);
	s.setWidth(width, widthUnits);

	float height = floatParam(params, "height", 200);
	Unit heightUnits = unitParam(params, "heightUnits", Unit.PT);
	s.setHeight(height, heightUnits);

	float lat = floatParam(params, "lat", -34.397f);
	float lng = floatParam(params, "lng", 150.644f);

	int zoom = intParam(params, "zoom", 8);

	String markerName = params.get("markerName");

	showMap(element, lat, lng, zoom, markerName);
}
 
开发者ID:billy1380,项目名称:blogwt,代码行数:27,代码来源:MapHelper.java

示例5: createSpanElement

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private SpanElement createSpanElement(final Cursor cursor,
                                      final double left,
                                      final double width) {
    final SpanElement span = document.createSpanElement();
    span.setAttribute("title",
                      title);
    final Style style = span.getStyle();
    style.setCursor(cursor);
    style.setPosition(Position.ABSOLUTE);
    style.setBottom(0,
                    PX);
    style.setHeight(source.getOffsetHeight(),
                    PX);
    style.setTop(source.getOffsetTop(),
                 PX);
    style.setWidth(width,
                   PX);
    style.setLeft(left,
                  PX);
    return span;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:ResizableMovableHeader.java

示例6: updateMaximizedPanelSizes

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private void updateMaximizedPanelSizes() {
    for (Widget w : maximizedWidgetOriginalStyles.keySet()) {
        Style style = w.getElement().getStyle();
        style.setTop(perspectiveRootContainer.getAbsoluteTop(),
                     Unit.PX);
        style.setLeft(perspectiveRootContainer.getAbsoluteLeft(),
                      Unit.PX);
        style.setWidth(perspectiveRootContainer.getOffsetWidth(),
                       Unit.PX);
        style.setHeight(perspectiveRootContainer.getOffsetHeight(),
                        Unit.PX);

        if (w instanceof RequiresResize) {
            ((RequiresResize) w).onResize();
        }
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:WorkbenchLayoutImpl.java

示例7: resizeToFullScreen

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
protected void resizeToFullScreen(Widget widget, Position position) {
    Style style = widget.getElement().getStyle();
    style.setPosition(position);
    style.setTop(0, Unit.PX);
    style.setLeft(0, Unit.PX);
    style.setWidth(100, Unit.PCT);
    style.setHeight(100, Unit.PCT);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:9,代码来源:VideoFullScreenHelper.java

示例8: fixIE8FocusCaptureIssue

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private void fixIE8FocusCaptureIssue() {
    Element e = DOM.createInputText();
    Style elemStyle = e.getStyle();
    elemStyle.setPosition(Style.Position.ABSOLUTE);
    elemStyle.setTop(-10, Style.Unit.PX);
    elemStyle.setWidth(0, Style.Unit.PX);
    elemStyle.setHeight(0, Style.Unit.PX);

    contentPanel.getElement().appendChild(e);
    e.focus();
    contentPanel.getElement().removeChild(e);
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:13,代码来源:CubaFileUploadProgressWindow.java

示例9: setImageSize

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private void setImageSize() {
  int width = isFullSize?attachmentWidth:thumbnailWidth;
  int height = isFullSize?attachmentHeight:thumbnailHeight;
  image.setPixelSize(width, height);
  //TODO(user,danilatos): Whinge about how declarative UI doesn't let us avoid this hack:
  Style pstyle = image.getElement().getParentElement().getParentElement().getStyle();
  if (width == 0) {
    image.setWidth("");
    pstyle.clearWidth();
  } else {
    pstyle.setWidth(width, Unit.PX);
  }
  if (height == 0) {
    image.setHeight("");
    pstyle.clearHeight();
  } else {
    pstyle.setHeight(height, Unit.PX);
  }

  String url = isFullSize?attachmentUrl:thumbnailUrl;
  if (url != null) {
    if (doubleBufferLoader == null) {
      doubleBufferLoader = new DoubleBufferImage(spin, errorLabel, image);
    }
    doubleBufferLoader.loadImage(url);
    DOM.setStyleAttribute(image.getElement(), "visibility", "");
  }

  // NOTE(user): IE requires that the imageCaptionContainer element has a width
  //   in order to correctly center the caption.
  if (DO_FRAME_WIDTH_UPDATE) {
    captionPanel.getElement().getStyle().setWidth(width, Unit.PX);
  }
}
 
开发者ID:jorkey,项目名称:Wiab.pro,代码行数:35,代码来源:ImageThumbnailWidget.java

示例10: buildDateItemView

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
public static NavigationDateItemView buildDateItemView(final DateNavigationItem item, final NavigationItemSelectedEventHandler handler) {
    final NavigationDateItemView navigationItemView = GWT.create(NavigationDateItemView.class);
    navigationItemView.setEmptyText(Constants.INSTANCE.newLiteral(), Constants.INSTANCE.createNewForThisType());
    final Style style = navigationItemView.getElement().getStyle();
    style.setWidth(200, Style.Unit.PX);
    style.setHeight(200, Style.Unit.PX);
    navigationItemView.addNavigationItemSelectedEventHandler(handler);
    navigationItemView.show(item);
    return navigationItemView;
}
 
开发者ID:kiegroup,项目名称:kie-docker-ci,代码行数:11,代码来源:NavigationItemViewBuilder.java

示例11: buildDefaultItemView

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
public static NavigationItemView buildDefaultItemView(final DefaultNavigationItem item, final NavigationItemSelectedEventHandler handler) {
    final NavigationItemView navigationItemView = GWT.create(NavigationItemView.class);
    navigationItemView.setEmptyText(Constants.INSTANCE.newLiteral(), Constants.INSTANCE.createNewForThisType());
    final Style style = navigationItemView.getElement().getStyle();
    style.setWidth(200, Style.Unit.PX);
    style.setHeight(200, Style.Unit.PX);
    navigationItemView.setImageSizePx(150);
    navigationItemView.addNavigationItemSelectedEventHandler(handler);
    navigationItemView.show(item);
    return navigationItemView;
}
 
开发者ID:kiegroup,项目名称:kie-docker-ci,代码行数:12,代码来源:NavigationItemViewBuilder.java

示例12: applySize

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private void applySize() {
  Style style = element().getStyle();
  style.setWidth(widthSet ? width : htmlImage.img.getWidth(), Unit.PX);
  style.setHeight(heightSet ? height : htmlImage.img.getHeight(), Unit.PX);
  if (sourceRectSet) {
    applyBackgroundSize();
  }
}
 
开发者ID:fredsa,项目名称:forplay,代码行数:9,代码来源:HtmlImageLayerDom.java

示例13: onAttach

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
@Override
protected void onAttach() {
  super.onAttach();

  Style style = getElement().getParentElement().getStyle();
  style.setHeight(100, PCT);
  style.setWidth(100, PCT);
}
 
开发者ID:eclipse,项目名称:che,代码行数:9,代码来源:EditorMultiPartStackViewImpl.java

示例14: onAttach

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected void onAttach() {
  super.onAttach();

  Style style = getElement().getParentElement().getStyle();
  style.setHeight(100, PCT);
  style.setWidth(100, PCT);
}
 
开发者ID:eclipse,项目名称:che,代码行数:10,代码来源:EditorPartStackView.java

示例15: addColumnElem

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private void addColumnElem(int i, Element elem, int elemWidth, int elemHeight, int rowspan) {
  ImageSize newSize = fitWidth(elemWidth, elemHeight, 1 + Math.abs(rowspan));
  newSize.height_ -= (columnsHeight_[i] + newSize.height_ + margin_) % DELTA;

  Style elemStyle = elem.getStyle();
  elemStyle.setMarginLeft(
      extraMargin_ + margin_ + (columnsWidth_ + margin_) * (i + (rowspan == -1 ? -1 : 0)),
      Style.Unit.PX);
  elemStyle.setMarginTop(columnsHeight_[i], Style.Unit.PX);
  elemStyle.setWidth(newSize.width_, Style.Unit.PX);
  elemStyle.setHeight(newSize.height_, Style.Unit.PX);

  int nextHeight = columnsHeight_[i] + newSize.height_ + margin_;
  columnsHeight_[i + rowspan] = columnsHeight_[i] = nextHeight;
}
 
开发者ID:MNCC,项目名称:minus,代码行数:16,代码来源:LightBox.java


注:本文中的com.google.gwt.dom.client.Style.setHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。