List of usage examples for com.vaadin.client ComputedStyle getMargin
public final int[] getMargin()
From source file:info.magnolia.ui.vaadin.gwt.client.layout.thumbnaillayout.widget.ThumbnailsSizeKeeper.java
License:Open Source License
private void updateCalculatedOffsetSizes() { ComputedStyle cs; int[] padding; int[] border; int[] margin; if (thumbnailParent.getChildCount() > 0) { final Element firstThumbnail = Element.as(thumbnailParent.getFirstChild()); cs = new ComputedStyle(firstThumbnail); padding = cs.getPadding();//from ww w. j a va2s .c o m border = cs.getBorder(); margin = cs.getMargin(); } else { final Element stub = Element.as(DOM.createDiv()); stub.addClassName("thumbnail"); thumbnailParent.appendChild(stub); cs = new ComputedStyle(stub); padding = cs.getPadding(); border = cs.getBorder(); margin = cs.getMargin(); thumbnailParent.removeChild(stub); } horizontalDecorations = padding[1] + padding[3] + border[1] + border[3] + margin[1] + margin[3]; verticalDecorations = padding[0] + padding[2] + border[0] + border[2] + margin[0] + margin[2]; this.unscaledWidth = baseWidth + horizontalDecorations; this.unscaledHeight = baseHeight + verticalDecorations; this.calculatedWidth = scaleDimension(baseWidth, ratio); this.calculatedHeight = scaleDimension(baseHeight, ratio); }