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


Java Style类代码示例

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


Style类属于com.google.gwt.dom.client包,在下文中一共展示了Style类的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: move

import com.google.gwt.dom.client.Style; //导入依赖的package包/类
@Override
public void move(boolean swipeRight, float length) {
    if (!focusDropped && UserAgentChecker.isStackAndroidBrowser()) {
        dropFocus();
    }
    if (swipeRight) {
        showProgressBarForPage(currentVisiblePage + 1);
    } else {
        showProgressBarForPage(currentVisiblePage - 1);
    }
    Style style = getStyle();
    float position = getPositionLeft();
    if (swipeRight) {
        style.setLeft(position - length, Unit.PCT);
    } else {
        style.setLeft(position + length, Unit.PCT);
    }
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:19,代码来源:MultiPageController.java

示例6: testPageViewWithSwipeAndWithout

import com.google.gwt.dom.client.Style; //导入依赖的package包/类
public void testPageViewWithSwipeAndWithout() {
    PanelCache cache = PlayerGinjectorFactory.getNewPlayerGinjectorForGWTTestCase().getPanelCache();
    assertTrue(cache.isEmpty());
    KeyValue<FlowPanel, FlowPanel> value = cache.getOrCreateAndPut(0);
    Style style = value.getKey().getElement().getStyle();
    assertTrue(style.getPosition().equals(Position.ABSOLUTE.getCssName()));
    assertTrue(style.getTop().equals("0px"));
    assertEquals("0.0%", style.getLeft());
    assertEquals("100.0%", style.getWidth());
    value = cache.getOrCreateAndPut(2);
    style = value.getKey().getElement().getStyle();
    assertEquals(Position.ABSOLUTE.getCssName(), style.getPosition());
    assertEquals("0px", style.getTop());
    assertEquals("200.0%", style.getLeft());
    assertEquals("100.0%", style.getWidth());
    cache.setSwipeType(SwipeType.DISABLED);
    value = cache.getOrCreateAndPut(3);
    assertNotSame(Position.ABSOLUTE.getCssName(), style.getPosition());
    assertNotSame("0px", style.getTop());
    assertNotSame("200.0%", style.getLeft());
    assertNotSame("100.0%", style.getWidth());

}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:24,代码来源:PanelCacheGWTTestCase.java

示例7: createView

import com.google.gwt.dom.client.Style; //导入依赖的package包/类
public void createView() {
  shell = new ResizeLayoutPanel();
  shell.setSize("100%", "100%");
  shell.addResizeHandler(new ResizeHandler() {
    @Override
    public void onResize(ResizeEvent event) {
      forceLayout();
    }
  });

  panel = new DockLayoutPanel(Style.Unit.PX);
  panel.setSize("100%", "100%");
  shell.add(panel);

  Widget header = createNorth();
  panel.addNorth(header, 128);

  Widget footer = createSouth();
  panel.addSouth(footer, 42);
}
 
开发者ID:mvp4g,项目名称:mvp4g2-examples,代码行数:21,代码来源:ShellView.java

示例8: setWidgetsSize

import com.google.gwt.dom.client.Style; //导入依赖的package包/类
/**
 * SetWidgetsSize
 */
private void setWidgetsSize() {
	// Calculating real height
	usableHeight = Window.getClientHeight();
	if (Main.get().hasHeaderCustomization) {
		usableHeight -= 72;
		RootLayoutPanel.get().setWidgetTopBottom(Main.get().mainPanel, 72, Style.Unit.PX, 0, Style.Unit.PX);
	}

	// Initialize dockPanel size
	dockPanel.setSize("" + Window.getClientWidth() + "px", "" + usableHeight + "px");

	// The active panel must be the last on initalization because establishes coordenates
	leftBorderPanel.setSize(VERTICAL_BORDER_PANEL_WIDTH, usableHeight - (TopPanel.PANEL_HEIGHT + BottomPanel.PANEL_HEIGHT));
	rightBorderPanel.setSize(VERTICAL_BORDER_PANEL_WIDTH, usableHeight - (TopPanel.PANEL_HEIGHT + BottomPanel.PANEL_HEIGHT));

	centerWidth = Window.getClientWidth() - (2 * VERTICAL_BORDER_PANEL_WIDTH);
	centerHeight = usableHeight - (TopPanel.PANEL_HEIGHT + BottomPanel.PANEL_HEIGHT);

	topPanel.setWidth("" + Window.getClientWidth() + "px");
	desktop.setSize(centerWidth, centerHeight);
	search.setSize(centerWidth, centerHeight);
	dashboard.setSize(centerWidth, centerHeight);
	administration.setSize(centerWidth, centerHeight);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:28,代码来源:ExtendedDockPanel.java

示例9: drawTagCloud

import com.google.gwt.dom.client.Style; //导入依赖的package包/类
/**
 * Draws a tag cloud
 */
private void drawTagCloud(Collection<String> keywords) {
	// Deletes all tag clouds keys
	keywordsCloud.clear();
	keywordsCloud.setMinFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMinFrequency());
	keywordsCloud.setMaxFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMaxFrequency());

	for (Iterator<String> it = keywords.iterator(); it.hasNext(); ) {
		String keyword = it.next();
		HTML tagKey = new HTML(keyword);
		tagKey.setStyleName("okm-cloudTags");
		Style linkStyle = tagKey.getElement().getStyle();
		int fontSize = keywordsCloud.getLabelSize(Main.get().mainPanel.dashboard.keyMapDashboard
				.getKeywordRate(keyword));
		linkStyle.setProperty("fontSize", fontSize + "pt");
		linkStyle.setProperty("color", keywordsCloud.getColor(fontSize));
		if (fontSize > 0) {
			linkStyle.setProperty("top", (keywordsCloud.getMaxFontSize() - fontSize) / 2 + "px");
		}
		keywordsCloud.add(tagKey);
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:25,代码来源:KeywordsPopup.java

示例10: drawTagCloud

import com.google.gwt.dom.client.Style; //导入依赖的package包/类
/**
 * Draws a tag cloud
 */
private void drawTagCloud(Collection<String> keywords) {
	// Deletes all tag clouds keys
	keywordsCloud.clear();
	keywordsCloud.setMinFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMinFrequency());
	keywordsCloud.setMaxFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMaxFrequency());

	for (Iterator<String> it = keywords.iterator(); it.hasNext(); ) {
		String keyword = it.next();
		HTML tagKey = new HTML(keyword);
		tagKey.setStyleName("okm-cloudTags");
		Style linkStyle = tagKey.getElement().getStyle();
		int fontSize = keywordsCloud.getLabelSize(Main.get().mainPanel.dashboard.keyMapDashboard.getKeywordRate(keyword));
		linkStyle.setProperty("fontSize", fontSize + "pt");
		linkStyle.setProperty("color", keywordsCloud.getColor(fontSize));
		if (fontSize > 0) {
			linkStyle.setProperty("top", (keywordsCloud.getMaxFontSize() - fontSize) / 2 + "px");
		}
		keywordsCloud.add(tagKey);
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:24,代码来源:KeywordsWidget.java

示例11: drawTagCloud

import com.google.gwt.dom.client.Style; //导入依赖的package包/类
/**
 * Draws a tag cloud
 */
public static void drawTagCloud(final TagCloud keywordsCloud, Collection<String> keywords) {
	// Deletes all tag clouds keys
	keywordsCloud.clear();
	keywordsCloud.setMinFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMinFrequency());
	keywordsCloud.setMaxFrequency(Main.get().mainPanel.dashboard.keyMapDashboard.getTotalMaxFrequency());

	for (Iterator<String> it = keywords.iterator(); it.hasNext(); ) {
		String keyword = it.next();
		HTML tagKey = new HTML(keyword);
		tagKey.setStyleName("okm-cloudTags");
		Style linkStyle = tagKey.getElement().getStyle();
		int fontSize = keywordsCloud.getLabelSize(Main.get().mainPanel.dashboard.keyMapDashboard.getKeywordRate(keyword));
		linkStyle.setProperty("fontSize", fontSize + "pt");
		linkStyle.setProperty("color", keywordsCloud.getColor(fontSize));
		if (fontSize > 0) {
			linkStyle.setProperty("top", (keywordsCloud.getMaxFontSize() - fontSize) / 2 + "px");
		}
		keywordsCloud.add(tagKey);
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:24,代码来源:WidgetUtil.java

示例12: init

import com.google.gwt.dom.client.Style; //导入依赖的package包/类
@PostConstruct
private void init() {
    navBar.setBackgroundColor("light-blue");
    navBar.setActivates("side-nav");
    header.add(navBar);
    header.add(tabs);
    navBrand.setText("GMD Errai");

    for(Links l : DataHelper.getAllNavSectionLinks()){
        MaterialLink link = new MaterialLink();
        link.setIconType(l.getIcon());
        link.setHref(l.getLink());
        navSection.add(link);
    }

    navBar.add(navBrand);
    navSection.setFloat(Style.Float.RIGHT);
    navBar.add(navSection);
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-errai,代码行数:20,代码来源:Header.java

示例13: init

import com.google.gwt.dom.client.Style; //导入依赖的package包/类
@PostConstruct
public void init() {
    cardImage.add(image);
    card.add(cardImage);

    content.setTextColor("white");
    content.setHeight("120px");

    profileImage.setHeight("32px");
    profileImage.setWidth("32px");
    profileImage.setCircle(true);
    profileImage.setMarginTop(-32);
    profileImage.setLayoutPosition(Style.Position.ABSOLUTE);
    content.add(profileImage);

    title.setFontSize("1em");
    content.add(title);

    description.setOpacity(0.6);
    description.setMarginTop(4);
    content.add(description);

    card.add(content);
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-errai,代码行数:25,代码来源:CollectionCard.java

示例14: attachLogPanel

import com.google.gwt.dom.client.Style; //导入依赖的package包/类
/** Reveals the log div, and executes a task when done. */
// The async API for this method is intended to support two things: a cool
// spew animation, and also the potential to runAsync the whole LogPanel code.
private static void attachLogPanel() {
  Logs.get().addHandler(domLogger);
  final Panel logHolder = RootPanel.get("logHolder");
  logHolder.setVisible(true);

  // Need one layout and paint cycle after revealing it to start animation.
  // Use high priority to avoid potential starvation by other tasks if a
  // problem is occurring.
  SchedulerInstance.getHighPriorityTimer().scheduleDelayed(new Task() {
    @Override
    public void execute() {
      logHolder.add(domLogger);
      Style waveStyle = Document.get().getElementById(WAVEPANEL_PLACEHOLDER).getStyle();
      Style logStyle = logHolder.getElement().getStyle();
      logStyle.setHeight(250, Unit.PX);
      waveStyle.setBottom(250, Unit.PX);
    }
  }, 50);
}
 
开发者ID:ArloJamesBarnes,项目名称:walkaround,代码行数:23,代码来源:Walkaround.java

示例15: onAttach

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

    /*
     * When this window gets reattached, set the tabstop to the previous
     * state.
     */
    setTabStopEnabled(doTabStop);

    // Fix for #14413. Any pseudo elements inside these elements are not
    // visible on initial render unless we shake the DOM.
    if (BrowserInfo.get().isIE8()) {
        closeBox.getStyle().setDisplay(Style.Display.NONE);
        Scheduler.get().scheduleFinally(new Command() {
            @Override
            public void execute() {
                closeBox.getStyle().clearDisplay();
            }
        });
    }
}
 
开发者ID:cuba-platform,项目名称:cuba,代码行数:23,代码来源:CubaFileUploadProgressWindow.java


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