@Override
protected void onFirstShowPage() {
super.onFirstShowPage();
final PWidget fill = buildComponent("Fill panel", "#75ffdc");
final PWidget leftPane = buildComponent("Left panel top/left 50.50 200x100", "#b879fc");
final PWidget rightPane = buildComponent("Right panel bottom/right 50.50 200x100", "#e8b6ea");
layoutPanel.add(fill);
layoutPanel.add(leftPane);
layoutPanel.add(rightPane);
layoutPanel.setWidgetLeftRight(fill, 0, 0, PUnit.PX);
layoutPanel.setWidgetTopBottom(fill, 0, 0, PUnit.PX);
layoutPanel.setWidgetLeftWidth(leftPane, 50, 200, PUnit.PX);
layoutPanel.setWidgetTopHeight(leftPane, 50, 100, PUnit.PX);
layoutPanel.setWidgetRightWidth(rightPane, 50, 200, PUnit.PX);
layoutPanel.setWidgetBottomHeight(rightPane, 50, 100, PUnit.PX);
// test animation
leftPane.addDomHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
// permute left/right
layoutPanel.setWidgetLeftWidth(rightPane, 50, 200, PUnit.PX);
layoutPanel.setWidgetTopHeight(rightPane, 50, 100, PUnit.PX);
layoutPanel.setWidgetRightWidth(leftPane, 50, 200, PUnit.PX);
layoutPanel.setWidgetBottomHeight(leftPane, 50, 100, PUnit.PX);
layoutPanel.animate(2000);
}
}, PClickEvent.TYPE);
rightPane.addDomHandler(new PClickHandler() {
@Override
public void onClick(final PClickEvent event) {
// restore
layoutPanel.setWidgetLeftWidth(leftPane, 50, 200, PUnit.PX);