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


Java Style.setMarginLeft方法代码示例

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


在下文中一共展示了Style.setMarginLeft方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: positionItems

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private void positionItems() {
    
    // Day text.
    final Style dayStyle = day.getElement().getStyle();
    dayStyle.setPosition(Style.Position.ABSOLUTE);
    dayStyle.setMarginTop( (ICON_SIZE / 2) * -1, Style.Unit.PX);
    dayStyle.setMarginLeft( ( ICON_SIZE / 2 ) + 10, Style.Unit.PX);

    // Month text.
    final Style monthStyle = month.getElement().getStyle();
    monthStyle.setPosition(Style.Position.ABSOLUTE);
    monthStyle.setMarginTop(25, Style.Unit.PX);
    monthStyle.setMarginLeft( ( ICON_SIZE / 2 ) + (month.getOffsetWidth() / 2), Style.Unit.PX);

    // Count number.
    final Style countStyle = countText.getElement().getStyle();
    countStyle.setPosition(Style.Position.ABSOLUTE);
    countStyle.setMarginTop(20, Style.Unit.PX);
    countStyle.setMarginLeft( ( ICON_SIZE - 20 ), Style.Unit.PX);
}
 
开发者ID:kiegroup,项目名称:kie-docker-ci,代码行数:21,代码来源:NavigationDateItemView.java

示例3: update

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
@Override
public void update(ActionEvent e) {
  panel.clear();

  Project project = appContext.getRootProject();
  if (project != null && project.getAttributes().containsKey(GIT_CURRENT_HEAD_NAME)) {
    Label projectNameLabel = new Label(project.getName());
    projectNameLabel.ensureDebugId("statusBarProjectBranchRepositoryName");
    projectNameLabel.getElement().getStyle().setMarginLeft(5., Unit.PX);
    panel.add(projectNameLabel);

    SVGImage branchIcon = new SVGImage(resources.checkoutReference());
    branchIcon.getSvgElement().getStyle().setMarginLeft(5., Unit.PX);
    panel.add(branchIcon);

    Label headLabel = new Label(project.getAttribute(GIT_CURRENT_HEAD_NAME));
    headLabel.ensureDebugId("statusBarProjectBranchName");
    headLabel.setTitle(constant.branchesControlTitle());
    Style headLabelStyle = headLabel.getElement().getStyle();
    headLabelStyle.setCursor(Cursor.POINTER);
    headLabelStyle.setMarginLeft(5., Unit.PX);
    headLabel.addClickHandler(event -> branchPresenter.showBranches(project));
    panel.add(headLabel);
  }
}
 
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:StatusBarBranchPointer.java

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

示例5: show

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
private void show(final String id, final String _title, final String _text, final SafeUri imageUri, final int containersRunningCount) {
    showTitle(_title);
    showRunningContainers(id, containersRunningCount);
    
    // Show the navigation item image.
    final boolean isImage = imageUri != null;
    if (isImage) {
        image.setUrl(imageUri);
        image.setSize(getSizeInPx(), getSizeInPx());
    }
    image.setVisible(isImage);

    // Show the navigation item text.
    final boolean isText = _text != null;
    if (isText) {
        text.setText(new SafeHtmlBuilder().appendEscaped(_text).toSafeHtml().asString());
    }
    
    // Styles for placing the text over the image.
    final Style textStyle = text.getElement().getStyle();
    if (isImage && isText) {
        textStyle.setPosition(Style.Position.ABSOLUTE);
        textStyle.setMarginTop(size / 2, Style.Unit.PX);
        final int tSize = (int) (_text.length() * 5);
        textStyle.setMarginLeft( ( size / 2 ) - tSize, Style.Unit.PX);
    } else if (isText) {
        textStyle.setPosition(Style.Position.RELATIVE);
        textStyle.clearMarginTop();
        textStyle.clearMarginLeft();
    }
    text.setVisible(isText);

    // Add the click handler.
    addItemDetailClickHandler(id);
}
 
开发者ID:kiegroup,项目名称:kie-docker-ci,代码行数:36,代码来源:NavigationItemView.java

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

示例7: CheckBoxDOMElement

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
public CheckBoxDOMElement(final CheckBox widget,
                          final GridLayer gridLayer,
                          final GridWidget gridWidget) {
    super(widget,
          gridLayer,
          gridWidget);
    final Style style = widget.getElement().getStyle();
    style.setMarginTop(0,
                       Style.Unit.PX);
    style.setMarginLeft(2,
                        Style.Unit.PX);
    style.setWidth(SIZE,
                   Style.Unit.PX);
    style.setHeight(SIZE,
                    Style.Unit.PX);

    // --- Workaround for BS2 ---
    style.setPosition(Style.Position.RELATIVE);
    style.setPaddingTop(0,
                        Style.Unit.PX);
    style.setPaddingBottom(0,
                           Style.Unit.PX);
    style.setProperty("WebkitBoxSizing",
                      "border-box");
    style.setProperty("MozBoxSizing",
                      "border-box");
    style.setProperty("boxSizing",
                      "border-box");
    style.setProperty("lineHeight",
                      "normal");
    // --- End workaround ---

    getContainer().setWidget(widget);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:35,代码来源:CheckBoxDOMElement.java

示例8: setUpHoverStyle

import com.google.gwt.dom.client.Style; //导入方法依赖的package包/类
@Override
protected void setUpHoverStyle(final Style style,
                               int size) {
    style.setWidth(size,
                   Unit.PX);
    style.setMarginLeft(-(size / 2),
                        Unit.PX);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:9,代码来源:WorkbenchSplitLayoutPanel.java


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