本文整理匯總了Java中com.google.gwt.user.client.ui.DockLayoutPanel.Direction方法的典型用法代碼示例。如果您正苦於以下問題:Java DockLayoutPanel.Direction方法的具體用法?Java DockLayoutPanel.Direction怎麽用?Java DockLayoutPanel.Direction使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.DockLayoutPanel
的用法示例。
在下文中一共展示了DockLayoutPanel.Direction方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: maximize
import com.google.gwt.user.client.ui.DockLayoutPanel; //導入方法依賴的package包/類
@Override
public void maximize() {
DockLayoutPanel.Direction direction = splitLayoutPanel.getWidgetDirection(widget);
if (DockLayoutPanel.Direction.NORTH == direction
|| DockLayoutPanel.Direction.SOUTH == direction) {
int maxHeight = splitLayoutPanel.getOffsetHeight() - splitLayoutPanel.getSplitterSize();
splitLayoutPanel.setWidgetSize(widget, maxHeight);
splitLayoutPanel.animate(DURATION);
} else if (DockLayoutPanel.Direction.WEST == direction
|| DockLayoutPanel.Direction.EAST == direction) {
int maxWidth = splitLayoutPanel.getOffsetWidth() - splitLayoutPanel.getSplitterSize();
splitLayoutPanel.setWidgetSize(widget, maxWidth);
splitLayoutPanel.animate(DURATION);
}
}
示例2: processRegion
import com.google.gwt.user.client.ui.DockLayoutPanel; //導入方法依賴的package包/類
private static void processRegion(DockLayoutPanel p, String region, boolean show) {
DockLayoutPanel.Direction dir = region.equals("north") ? DockLayoutPanel.Direction.NORTH :
region.equals("south") ? DockLayoutPanel.Direction.SOUTH :
region.equals("east") ? DockLayoutPanel.Direction.EAST :
region.equals("west") ? DockLayoutPanel.Direction.WEST : DockLayoutPanel.Direction.CENTER;
for(int i = 0; i < p.getWidgetCount(); i++) {
DockLayoutPanel.Direction wd = p.getWidgetDirection(p.getWidget(i));
if (wd == dir) {
if (show) {
GwtUtil.DockLayout.showWidget(p, p.getWidget(i));
} else {
GwtUtil.DockLayout.hideWidget(p, p.getWidget(i));
}
}
}
}