////////////////////////////////////////////////////////////////////////////
/**
* Test for {@link DockLayoutPanelInfo#getEdge(WidgetInfo)}.
*/
public void test_getEdge() throws Exception {
DockLayoutPanelInfo panel =
parseJavaInfo(
"public class Test extends DockLayoutPanel {",
" public Test() {",
" super(Unit.CM);",
" {",
" Button button_1 = new Button();",
" addWest(button_1, 1.0);",
" }",
" {",
" Button button_2 = new Button();",
" addNorth(button_2, 1.0);",
" }",
" {",
" Button button_3 = new Button();",
" addEast(button_3, 1.0);",
" }",
" {",
" Button button_4 = new Button();",
" addSouth(button_4, 1.0);",
" }",
" {",
" Button button_5 = new Button();",
" add(button_5);",
" }",
" }",
"}");
panel.refresh();
{
WidgetInfo button_1 = getJavaInfoByName("button_1");
assertEquals("WEST", panel.getEdge(button_1));
assertTrue(panel.isHorizontalEdge(button_1));
assertFalse(panel.isVerticalEdge(button_1));
}
{
WidgetInfo button_2 = getJavaInfoByName("button_2");
assertEquals("NORTH", panel.getEdge(button_2));
assertFalse(panel.isHorizontalEdge(button_2));
assertTrue(panel.isVerticalEdge(button_2));
}
{
WidgetInfo button_3 = getJavaInfoByName("button_3");
assertEquals("EAST", panel.getEdge(button_3));
assertTrue(panel.isHorizontalEdge(button_3));
assertFalse(panel.isVerticalEdge(button_3));
}
{
WidgetInfo button_4 = getJavaInfoByName("button_4");
assertEquals("SOUTH", panel.getEdge(button_4));
assertFalse(panel.isHorizontalEdge(button_4));
assertTrue(panel.isVerticalEdge(button_4));
}
{
WidgetInfo button_5 = getJavaInfoByName("button_5");
assertEquals("CENTER", panel.getEdge(button_5));
assertFalse(panel.isHorizontalEdge(button_5));
assertFalse(panel.isVerticalEdge(button_5));
}
}