本文整理了Java中com.google.gwt.dom.client.Element.getOffsetWidth()
方法的一些代码示例,展示了Element.getOffsetWidth()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.getOffsetWidth()
方法的具体详情如下:
包路径:com.google.gwt.dom.client.Element
类名称:Element
方法名:getOffsetWidth
[英]The width of an element relative to the layout.
[中]元素相对于布局的宽度。
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Get the width in pixels of the scrollable content that the scrollbar
* controls.
*
* <p>
* This is not the same as the maximum scroll left position. The maximum
* scroll position equals the <code>scrollWidth - offsetWidth</code>;
*
* @return the scroll width
* @see #setScrollWidth(int)
*/
public int getScrollWidth() {
return contentDiv.getOffsetWidth();
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Gets an element's absolute right coordinate in the document's coordinate
* system.
*/
public final int getAbsoluteRight() {
return getAbsoluteLeft() + getOffsetWidth();
}
代码示例来源:origin: com.haulmont.cuba/cuba-web-toolkit
protected boolean isBordersVisible() {
CubaGroupBoxWidget panel = getWidget();
return panel.captionStartDeco.getOffsetWidth() > 0 || panel.captionEndDeco.getOffsetWidth() > 0;
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
int offsetWidth = parent.getOffsetWidth();
int height = offsetHeight + 100;
int width = offsetWidth + 100;
代码示例来源:origin: net.wetheinter/gwt-user
/**
* Gets an element's absolute right coordinate in the document's coordinate
* system.
*/
public final int getAbsoluteRight() {
return getAbsoluteLeft() + getOffsetWidth();
}
代码示例来源:origin: com.vaadin.external.gwt/gwt-user
/**
* Gets an element's absolute right coordinate in the document's coordinate
* system.
*/
public final int getAbsoluteRight() {
return getAbsoluteLeft() + getOffsetWidth();
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
public boolean f(Element e, int index) {
return (e.getOffsetWidth() + e.getOffsetHeight()) > 0 &&
!"none".equalsIgnoreCase(styleImpl.curCSS(e, "display", true));
}
});
代码示例来源:origin: pl.touk.gwtaculous/gwtaculous-lib
public static void centerElementOnPosition(Element elem, int posX, int posY){
int elementWidth = elem.getOffsetWidth();
int elementHeight = elem.getOffsetHeight();
setElementPosition(elem, posX - elementWidth/2, posY - elementHeight/2);
}
代码示例来源:origin: info.magnolia.ui/magnolia-ui-vaadin-common-widgets
private void detectIndent(VTreeTableRow vTreeTableRow) {
indentWidth = vTreeTableRow.treeSpacer.getOffsetWidth();
if (indentWidth == 0) {
indentWidth = -1;
return;
}
for (Widget w : this) {
((VTreeTableRow) w).setIndent();
}
calculateMaxIndent();
}
代码示例来源:origin: de.esoco/gewt
@Override
void animate(Element rElement, double fProgress)
{
double fWidth = rElement.getOffsetWidth();
rElement.getStyle()
.setHeight(fWidth * (1.0d - fProgress), Unit.PX);
}
},
代码示例来源:origin: com.googlecode.mgwt/mgwt
private void setSliderPos(int value) {
if (!isAttached()) {
return;
}
int width = bar.getOffsetWidth();
int sliderPos = value * width / max;
setPos(sliderPos);
}
代码示例来源:origin: fr.lteconsulting/hexa.core
@Override
public Size getDisplaySize()
{
Element td = getTd();
Size size = new Size( td.getOffsetWidth(), td.getOffsetHeight() );
return size;
}
代码示例来源:origin: OpenNMS/opennms
@Override
public int getPhysicalWidth() {
return getSVGElement().getParentElement().getOffsetWidth() - getLeftMargin();
}
代码示例来源:origin: ltearno/hexa.tools
@Override
public Size getDisplaySize()
{
Element td = getTd();
Size size = new Size( td.getOffsetWidth(), td.getOffsetHeight() );
return size;
}
代码示例来源:origin: org.kie.workbench/kie-wb-common-dmn-client
@Override
public void onResize() {
final Element parentElement = getElement().getParentElement();
final Integer width = parentElement.getOffsetWidth();
final Integer height = parentElement.getOffsetHeight();
if (width > 0 && height > 0) {
setPixelSize(width, height);
}
resizableContent.ifPresent(RequiresResize::onResize);
}
}
代码示例来源:origin: fr.lteconsulting/hexa.core
public Size getSize()
{
Element td = getTdElement();
return new Size( td.getOffsetWidth(), td.getOffsetHeight() );
}
}
代码示例来源:origin: com.google.gwt/gwt-servlet
/**
* Recalculate the height and width of a native scrollbar.
*/
private static void maybeRecalculateNativeScrollbarSize() {
// Check if the size has already been calculated.
if (nativeHeight > -1) {
return;
}
// Create a scrollable element and attach it to the body.
Element scrollable = Document.get().createDivElement();
scrollable.getStyle().setPosition(Position.ABSOLUTE);
scrollable.getStyle().setTop(-1000.0, Unit.PX);
scrollable.getStyle().setLeft(-1000.0, Unit.PX);
scrollable.getStyle().setHeight(100.0, Unit.PX);
scrollable.getStyle().setWidth(100.0, Unit.PX);
scrollable.getStyle().setOverflow(Overflow.SCROLL);
scrollable.getStyle().setProperty("direction", "rtl");
Document.get().getBody().appendChild(scrollable);
// Add some content.
Element content = Document.get().createDivElement();
content.setInnerText("content");
scrollable.appendChild(content);
// Measure the height and width.
nativeHeight = scrollable.getOffsetHeight() - scrollable.getClientHeight();
nativeWidth = scrollable.getOffsetWidth() - scrollable.getClientWidth();
nativeRtl = (content.getAbsoluteLeft() > scrollable.getAbsoluteLeft());
// Detach the scrollable element.
scrollable.removeFromParent();
}
代码示例来源:origin: org.uberfire/uberfire-wires-core-grids
@Override
public void updatePanelSize() {
final Element parentElement = getElement().getParentElement();
final Integer width = parentElement.getOffsetWidth();
final Integer height = parentElement.getOffsetHeight();
if (width > 0 && height > 0) {
updatePanelSize(width,
height);
}
}
代码示例来源:origin: com.googlecode.gwtquery/gwtquery
@Override
public int getWidth(Element e) {
return (int) (e.getOffsetWidth() - num(curCSS(e, "paddingLeft", true))
- num(curCSS(e, "paddingRight", true))
- num(curCSS(e, "borderRightWidth", true)) - num(curCSS(e, "borderRightWidth", true)));
}
代码示例来源:origin: io.github.nibiruos.ui/org.nibiru.ui.gwt
@Override
protected int getNativeWidth() {
Element e = DOM.createDiv();
e.setInnerText(getValue().get() != null ? getValue().get() : "I");
e.getStyle().setPosition(Style.Position.ABSOLUTE);
Document.get().getBody().appendChild(e);
int width = e.getOffsetWidth();
e.removeFromParent();
return width + MAGIC_PADDING;
}
内容来源于网络,如有侵权,请联系作者删除!