當前位置: 首頁>>代碼示例>>Java>>正文


Java Style.setTop方法代碼示例

本文整理匯總了Java中com.google.gwt.dom.client.Style.setTop方法的典型用法代碼示例。如果您正苦於以下問題:Java Style.setTop方法的具體用法?Java Style.setTop怎麽用?Java Style.setTop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.dom.client.Style的用法示例。


在下文中一共展示了Style.setTop方法的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: alignWidget

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
private void alignWidget(Widget widget, Point anchorPoint, String horizontalAlign, String verticalAlign) {
    Style style = widget.getElement().getStyle();
    double xPos = anchorPoint.getX();
    double yPos = anchorPoint.getY();

    if ("center".equals(horizontalAlign)) {
        xPos -= widget.getOffsetWidth() / 2;
    } else if ("right".equals(horizontalAlign)) {
        xPos -= widget.getOffsetWidth();
    }

    if ("center".equals(verticalAlign)) {
        yPos -= widget.getOffsetHeight() / 2;
    } else if ("bottom".equals(verticalAlign)) {
        yPos -= widget.getOffsetHeight();
    }

    style.setPosition(Position.ABSOLUTE);
    style.setTop(yPos, Unit.PX);
    style.setLeft(xPos, Unit.PX);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:22,代碼來源:LabelledImgContent.java

示例3: 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);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:21,代碼來源:PanelCache.java

示例4: 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();
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:21,代碼來源:MultiPageView.java

示例5: setThumb

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
public void setThumb(double center, double width) {
	Style style = getElement().getStyle();
	if (width >= 1) {
		style.setVisibility(Visibility.HIDDEN);
		return;
	} else {
		style.setVisibility(Visibility.VISIBLE);
	}
	if (isHorizontal) {
		style.setLeft(100 * (center - width / 2), Unit.PCT);
		style.setRight(100 * (1 - center - width / 2), Unit.PCT);
	} else {
		style.setTop(100.0 * (center - width / 2), Unit.PCT);
		style.setBottom(100 * (1 - center - width / 2), Unit.PCT);
	}
}
 
開發者ID:mateusz-matela,項目名稱:djvu-html5,代碼行數:17,代碼來源:Scrollbar.java

示例6: 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

示例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;
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:22,代碼來源:ResizableMovableHeader.java

示例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();
        }
    }
}
 
開發者ID:kiegroup,項目名稱:appformer,代碼行數:18,代碼來源:WorkbenchLayoutImpl.java

示例9: placeGaps

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
private void placeGaps() {
    for (MathGap gap : getMathGaps()) {
        Widget gapContainer = gap.getContainer();
        Style gapStyle = gapContainer.getElement().getStyle();

        gapStyle.setTop(0, Unit.PX);
        gapStyle.setLeft(0, Unit.PX);
        gapStyle.setPosition(Position.ABSOLUTE);
    }
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:11,代碼來源:MathModule.java

示例10: initializePanels

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
private void initializePanels() {
    applyIdAndClassToView(mainPanel);

    outerPanel.getElement().getStyle().setOverflow(Overflow.VISIBLE);
    gapsPanel.getElement().getStyle().setOverflow(Overflow.VISIBLE);

    Style mainPanelStyle = mainPanel.getElement().getStyle();
    mainPanelStyle.setPosition(Position.ABSOLUTE);
    mainPanelStyle.setTop(0, Unit.PX);
    mainPanelStyle.setLeft(0, Unit.PX);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:12,代碼來源:MathModule.java

示例11: 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

示例12: setSwipeType

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
public void setSwipeType(SwipeType swipeType) {
    this.swipeType = swipeType;
    if (parent != null) {
        Style style = parent.getElement().getStyle();

        if (swipeType == SwipeType.DISABLED) {
            style.clearTop();
            style.clearPosition();
        } else {
            style.setTop(0, Unit.PX);
            style.setPosition(Position.ABSOLUTE);
        }
    }
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:15,代碼來源:PanelCache.java

示例13: 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

示例14: setPopupPositionAndMakeVisible

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
@Override
public void setPopupPositionAndMakeVisible(Element reference, final Element popup) {
  Style popupStyle = popup.getStyle();

  // TODO(danilatos): Do something more intelligent than arbitrary constants (which might be
  // susceptible to font size changes, etc)
  popupStyle.setLeft(popupAnchor.getAbsoluteLeft() - popup.getOffsetWidth() + 26, Unit.PX);
  popupStyle.setTop(popupAnchor.getAbsoluteBottom() + 5, Unit.PX);

  popupStyle.setVisibility(Visibility.VISIBLE);
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:12,代碼來源:InteractiveSuggestionsManager.java

示例15: putCover

import com.google.gwt.dom.client.Style; //導入方法依賴的package包/類
/**
 * Puts cover element on the covered element.
 * The cover and covered elements have the same position and size.
 * 
 * @param cover the cover element
 * @param covered the covered element
 */
public static void putCover(Element cover, Element covered) {
    Element parent = covered.getParentElement();
    Rect coveredRect = DomUtil.getElementAbsoluteRect(covered);
    Rect parentRect = DomUtil.getElementAbsoluteRect(parent);
    Style coverStyle = cover.getStyle();
    coverStyle.setPosition(Style.Position.ABSOLUTE);      
    coverStyle.setTop(coveredRect.getTop() - parentRect.getTop(), Style.Unit.PX);
    coverStyle.setLeft(coveredRect.getLeft() - parentRect.getLeft(), Style.Unit.PX);
    coverStyle.setRight(parentRect.getRight() - coveredRect.getRight(), Style.Unit.PX);
    coverStyle.setBottom(parentRect.getBottom() - coveredRect.getBottom(), Style.Unit.PX);      
    parent.appendChild(cover);    
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:20,代碼來源:DomUtil.java


注:本文中的com.google.gwt.dom.client.Style.setTop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。