int clientWidth = size.width;
int clientHeight = size.height;
// exclude decorations
if (m_object.getObject() != null) {
if (executeBooleanScript("setSize.excludeMargin")) {
Insets margins = m_object.getMargins();
clientWidth -= margins.getWidth();
clientHeight -= margins.getHeight();
}
if (executeBooleanScript("setSize.excludeBorder")) {
Insets borders = m_object.getBorders();
clientWidth -= borders.getWidth();
clientHeight -= borders.getHeight();
}
if (executeBooleanScript("setSize.excludePadding")) {
Insets paddings = m_object.getPaddings();
clientWidth -= paddings.getWidth();
clientHeight -= paddings.getHeight();
}
}
// set size in pixels
String width = clientWidth + "px";
String height = clientHeight + "px";