本文整理匯總了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());
}
}
示例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);
}
}
示例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());
}
}
示例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);
}
示例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;
}
示例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();
}
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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();
}
}
示例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);
}
示例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);
}
示例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;
}