/**
* Collect bounds property from simple properties.
*/
private static void collectBoundsProperty(FormItemInfo item, List<Property> properties) {
final String key = "FormItem_Info.boundsProperty";
ComplexProperty boundsProperty = (ComplexProperty) item.getArbitraryValue(key);
if (boundsProperty == null) {
boundsProperty = new ComplexProperty("Bounds", null);
item.putArbitraryValue(key, boundsProperty);
}
// show bounds-property for absolute item layout
boundsProperty.setCategory(item.getForm().isAbsoluteItemLayout()
? PropertyCategory.PREFERRED
: PropertyCategory.ADVANCED);
// move bounds items properties
boundsProperty.setProperties(new Property[]{
extractPropertyByTitle(properties, "left"),
extractPropertyByTitle(properties, "top"),
extractPropertyByTitle(properties, "width(int)"),
extractPropertyByTitle(properties, "width(java.lang.String)"),
extractPropertyByTitle(properties, "height(int)"),
extractPropertyByTitle(properties, "height(java.lang.String)")});
// apply current bounds
Rectangle modelBounds = item.getModelBounds();
if (modelBounds != null) {
boundsProperty.setText("("
+ modelBounds.x
+ ", "
+ modelBounds.y
+ ", "
+ modelBounds.width