" }",
"}");
}
public void test_item_BOUNDS() throws Exception {
DynamicFormInfo form = parseJavaInfo( // filler
"public class Test extends DynamicForm {",
" public Test() {",
" setItemLayout(FormLayoutType.ABSOLUTE);",
" setFields(new FormItem[] { new TextItem('newTextItem')});",
" }",
"}");
form.refresh();
// set location
FormItemInfo formItem = form.getItems().get(0);
Point location = new Point(30, 20);
form.command_BOUNDS(formItem, location, null);
form.refresh();
assertThat(formItem.getBounds().getLocation()).isEqualTo(location);
assertEditor(
"public class Test extends DynamicForm {",
" public Test() {",
" setItemLayout(FormLayoutType.ABSOLUTE);",
" TextItem textItem = new TextItem('newTextItem');",
" textItem.setLeft(30);",
" textItem.setTop(20);",
" setFields(new FormItem[] { textItem});",
" }",
"}");
// set size
form.command_BOUNDS(formItem, null, new Dimension(60, 50));
form.refresh();
assertThat(formItem.getBounds().getSize()).isEqualTo(new Dimension(60, 50));
assertEditor(
"public class Test extends DynamicForm {",
" public Test() {",
" setItemLayout(FormLayoutType.ABSOLUTE);",
" TextItem textItem = new TextItem('newTextItem');",
" textItem.setWidth(60);",
" textItem.setHeight(50);",
" textItem.setLeft(30);",
" textItem.setTop(20);",
" setFields(new FormItem[] { textItem});",
" }",
"}");
// change location
form.command_BOUNDS(formItem, new Point(10, 10), null);
form.refresh();
assertThat(formItem.getBounds().getLocation()).isEqualTo(new Point(10, 10));
assertEditor(
"public class Test extends DynamicForm {",
" public Test() {",
" setItemLayout(FormLayoutType.ABSOLUTE);",