public class ComputedStyle extends Object
Modifier and Type | Field and Description |
---|---|
protected com.google.gwt.core.client.JavaScriptObject |
computedStyle |
Constructor and Description |
---|
ComputedStyle(com.google.gwt.dom.client.Element elem)
Gets this element's computed style object which can be used to gather
information about the current state of the rendered node.
|
Modifier and Type | Method and Description |
---|---|
int[] |
getBorder()
Get current border values from the DOM.
|
double |
getBorderHeight()
Returns the sum of the top and bottom border width
|
double |
getBorderWidth()
Returns the sum of the left and right border width
|
double |
getDoubleProperty(String name)
Retrieves the given computed property as a double
Returns NaN if the property cannot be converted to a double
|
double |
getHeight()
Returns the current height from the DOM.
|
int |
getIntProperty(String name)
Retrieves the given computed property as an integer
Returns 0 if the property cannot be converted to an integer
|
int[] |
getMargin()
Get current margin values from the DOM.
|
double |
getMarginHeight()
Returns the sum of the top and bottom margin
|
double |
getMarginWidth()
Returns the sum of the top and bottom margin
|
int[] |
getPadding()
Get current padding values from the DOM.
|
double |
getPaddingHeight()
Returns the sum of the top and bottom padding
|
double |
getPaddingWidth()
Returns the sum of the top and bottom padding
|
String |
getProperty(String name) |
double |
getWidth()
Returns the current width from the DOM.
|
static Integer |
parseInt(String value)
Deprecated.
Since 7.1.4, the method
parseIntNative(String) is
used internally and this method does not belong in the public
API of ComputedStyle . parseInt(String) might
be removed or moved to a utility class in future versions. |
protected final com.google.gwt.core.client.JavaScriptObject computedStyle
public ComputedStyle(com.google.gwt.dom.client.Element elem)
Note that this method is expensive. Wherever possible, reuse the returned object.
elem
- the elementpublic final String getProperty(String name)
name
- name of the CSS property in camelCasepublic final int getIntProperty(String name)
name
- the property to retrievepublic final double getDoubleProperty(String name)
name
- the property to retrievepublic final int[] getMargin()
public final int[] getPadding()
public final int[] getBorder()
public double getWidth()
public double getHeight()
@Deprecated public static Integer parseInt(String value)
parseIntNative(String)
is
used internally and this method does not belong in the public
API of ComputedStyle
. parseInt(String)
might
be removed or moved to a utility class in future versions.String
- a value starting with a numbernull
.public double getBorderHeight()
public double getBorderWidth()
public double getPaddingHeight()
public double getPaddingWidth()
public double getMarginHeight()
public double getMarginWidth()
Copyright © 2019 Vaadin Ltd. All rights reserved.