本文整理匯總了Java中com.google.gwt.dom.client.Style.setWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java Style.setWidth方法的具體用法?Java Style.setWidth怎麽用?Java Style.setWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.dom.client.Style
的用法示例。
在下文中一共展示了Style.setWidth方法的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: getElement
import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
@Override
protected KeyValue<FlowPanel, FlowPanel> getElement(Integer index) {
parent = panelFactory.getFlowPanel();
FlowPanel childPanel = panelFactory.getFlowPanel();
Style style = parent.getElement().getStyle();
parent.getElement().setId(styleNames.QP_PAGE() + index.intValue());
if (swipeType != SwipeType.DISABLED) {
style.setPosition(Position.ABSOLUTE);
style.setTop(0, Unit.PX);
style.setLeft(WIDTH * index, Unit.PCT);
style.setWidth(WIDTH, Unit.PCT);
}
childPanel.setHeight("100%");
childPanel.setWidth("100%");
parent.add(childPanel);
return new KeyValue<FlowPanel, FlowPanel>(parent, childPanel);
}
示例3: setSwipeDisabled
import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
public void setSwipeDisabled(boolean swipeDisabled) {
Style style = controller.getStyle();
Style elementStyle = getElement().getStyle();
style.setWidth(controller.getWidth(), Unit.PCT);
if (swipeDisabled) {
style.clearPosition();
style.clearTop();
style.clearLeft();
elementStyle.clearPosition();
} else {
style.setPosition(Position.ABSOLUTE);
style.setTop(0, Unit.PX);
style.setLeft(0, Unit.PX);
elementStyle.setPosition(Position.RELATIVE);
}
setSwipeLength();
}
示例4: 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);
}
}
示例5: 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());
}
}
示例6: 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);
}
示例7: 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;
}
示例8: 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();
}
}
}
示例9: getPreloaderCallback
import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
@Override
public PreloaderCallback getPreloaderCallback () {
final Panel preloaderPanel = new VerticalPanel();
preloaderPanel.setStyleName("gdx-preloader");
final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png");
logo.setStyleName("logo");
preloaderPanel.add(logo);
final Panel meterPanel = new SimplePanel();
meterPanel.setStyleName("gdx-meter");
meterPanel.addStyleName("red");
final InlineHTML meter = new InlineHTML();
final Style meterStyle = meter.getElement().getStyle();
meterStyle.setWidth(0, Unit.PCT);
meterPanel.add(meter);
preloaderPanel.add(meterPanel);
getRootPanel().add(preloaderPanel);
return new PreloaderCallback() {
@Override
public void error (String file) {
System.out.println("error: " + file);
}
@Override
public void update (PreloaderState state) {
meterStyle.setWidth(100f * state.getProgress(), Unit.PCT);
}
};
}
示例10: 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);
}
示例11: setAfterButtonPositionAndStyle
import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
private void setAfterButtonPositionAndStyle(final int leftOffsetForProgressButton) {
Style afterButtonStyle = afterButton.getElement().getStyle();
double percentWidth = positionCalculator.getPercentWidth(leftOffsetForProgressButton);
afterButtonStyle.setWidth(100 - percentWidth, Unit.PCT);
afterButtonStyle.setProperty(positionCalculator.getPositionPropertyForAfterProgressElement(), "0px");
}
示例12: setBeforeButtonPositionAndStyle
import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
private void setBeforeButtonPositionAndStyle(final int leftOffsetForProgressButton) {
Style beforeButtonStyle = beforeButton.getElement().getStyle();
double percentWidth = positionCalculator.getPercentWidth(leftOffsetForProgressButton);
beforeButtonStyle.setWidth(percentWidth, Unit.PCT);
beforeButtonStyle.setProperty(positionCalculator.getPositionPropertyForBeforeProgressElement(), "0px");
}
示例13: getPreloaderCallback
import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
@Override
public Preloader.PreloaderCallback getPreloaderCallback() {
final VerticalPanel preloaderPanel = new VerticalPanel();
preloaderPanel.setStyleName("gdx-preloader");
preloaderPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
final Image logo = new Image(GWT.getModuleBaseURL() + "logo.gif");
logo.setStyleName("logo");
preloaderPanel.add(logo);
final Panel meterPanel = new SimplePanel();
meterPanel.setStyleName("gdx-meter");
meterPanel.addStyleName("red");
final InlineHTML meter = new InlineHTML();
final Style meterStyle = meter.getElement().getStyle();
meterStyle.setWidth(0, Style.Unit.PCT);
meterPanel.add(meter);
preloaderPanel.add(meterPanel);
getRootPanel().add(preloaderPanel);
return new Preloader.PreloaderCallback() {
@Override
public void error(String file) {
System.out.println("error: " + file);
}
@Override
public void update(Preloader.PreloaderState state) {
meterStyle.setWidth(100f * state.getProgress(), Style.Unit.PCT);
}
};
}
示例14: 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);
}
示例15: 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);
}
}