com.google.gwt.user.client.ui.Widget.getLayoutData()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(115)

本文整理了Java中com.google.gwt.user.client.ui.Widget.getLayoutData()方法的一些代码示例,展示了Widget.getLayoutData()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Widget.getLayoutData()方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.Widget
类名称:Widget
方法名:getLayoutData

Widget.getLayoutData介绍

[英]Gets the panel-defined layout data associated with this widget.
[中]

代码示例

代码示例来源:origin: kaaproject/kaa

/**
 * Hide the widget that just slid out of view.
 */
private void doAfterLayout() {
 if (hidingWidget != null) {
  Layer layer = (Layer) hidingWidget.getLayoutData();
  setWidgetVisible(hidingWidget, layer, false);
  layout.layout();
  hidingWidget = null;
 }
}

代码示例来源:origin: kaaproject/kaa

@Override
public boolean remove(Widget widget) {
 boolean removed = super.remove(widget);
 if (removed) {
  Layer layer = (Layer) widget.getLayoutData();
  layout.removeChild(layer);
  widget.setLayoutData(null);
  if (visibleWidget == widget) {
   visibleWidget = null;
  }
  if (hidingWidget == widget) {
   hidingWidget = null;
  }
  if (lastVisibleWidget == widget) {
   lastVisibleWidget = null;
  }
 }
 return removed;
}

代码示例来源:origin: kaaproject/kaa

: (Layer) lastVisibleWidget.getLayoutData();
Layer newLayer = (visibleWidget == null) ? null
  : (Layer) visibleWidget.getLayoutData();

代码示例来源:origin: com.google.gwt/gwt-servlet

public void setMinSize(int minSize) {
 this.minSize = minSize;
 LayoutData layout = (LayoutData) target.getLayoutData();
 // Try resetting the associated widget's size, which will enforce the new
 // minSize value.
 setAssociatedWidgetSize((int) layout.size);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

private double getMaxSize() {
 // To avoid seeing stale center size values due to deferred layout
 // updates, maintain our own copy up to date and resync when the
 // DockLayoutPanel value changes.
 double newCenterSize = getCenterSize();
 if (syncedCenterSize != newCenterSize) {
  syncedCenterSize = newCenterSize;
  centerSize = newCenterSize;
 }
 return Math.max(((LayoutData) target.getLayoutData()).size + centerSize,
      0);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Gets the layout direction of the given child widget.
 *
 * @param w the widget to be queried
 * @return the widget's layout direction, or <code>null</code> if it is not
 *         a child of this panel
 */
public DockLayoutConstant getWidgetDirection(Widget w) {
 if (w.getParent() != this) {
  return null;
 }
 return ((LayoutData) w.getLayoutData()).direction;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

private Layout.Layer getLayer(Widget child) {
  assert child.getParent() == this : "The requested widget is not a child of this panel";
  return (Layout.Layer) child.getLayoutData();
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Gets the container element wrapping the given child widget.
 *
 * @param child
 * @return the widget's container element
 */
public Element getWidgetContainerElement(Widget child) {
 assertIsChild(child);
 return ((LayoutData) child.getLayoutData()).layer.getContainerElement();
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public void setCellVerticalAlignment(Widget w, VerticalAlignmentConstant align) {
 LayoutData data = (LayoutData) w.getLayoutData();
 data.vAlign = align.getVerticalAlignString();
 if (data.td != null) {
  setCellVerticalAlignment(data.td, align);
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public void setCellWidth(Widget w, String width) {
 LayoutData data = (LayoutData) w.getLayoutData();
 data.width = width;
 if (data.td != null) {
  data.td.getStyle().setProperty("width", data.width);
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public boolean remove(Widget w) {
 boolean removed = super.remove(w);
 if (removed) {
  layout.removeChild((Layer) w.getLayoutData());
 }
 return removed;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Hide the widget that just slid out of view.
 */
private void doAfterLayout() {
 if (hidingWidget != null) {
  Layer layer = (Layer) hidingWidget.getLayoutData();
  setWidgetVisible(hidingWidget, layer, false);
  layout.layout();
  hidingWidget = null;
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public void setCellHeight(Widget w, String height) {
 LayoutData data = (LayoutData) w.getLayoutData();
 data.height = height;
 if (data.td != null) {
  data.td.getStyle().setProperty("height", data.height);
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public boolean remove(Widget w) {
 boolean removed = super.remove(w);
 if (removed) {
  // Clear the center widget.
  if (w == center) {
   center = null;
  }
  LayoutData data = (LayoutData) w.getLayoutData();
  layout.removeChild(data.layer);
 }
 return removed;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public void setCellHorizontalAlignment(Widget w,
  HorizontalAlignmentConstant align) {
 LayoutData data = (LayoutData) w.getLayoutData();
 data.hAlign = align.getTextAlignString();
 if (data.td != null) {
  setCellHorizontalAlignment(data.td, align);
 }
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Gets the layout size of the given child widget.
 * 
 * @param child the widget to be queried
 * @return the widget's layout size, or <code>null</code> if it is not a child of
 *         this panel
 * @throws AssertionError if the widget is not a child and assertions are enabled
 */
public Double getWidgetSize(Widget child) {
 assertIsChild(child);
 if (child.getParent() != this) {
  return null;
 }
 return ((LayoutData) child.getLayoutData()).size;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Updates the size of the widget passed in as long as it is not the center
 * widget and updates the layout of the dock.
 *
 * @param widget the widget that needs to update its size
 * @param size the size to update the widget to
 */
public void setWidgetSize(Widget widget, double size) {
 assertIsChild(widget);
 LayoutData data = (LayoutData) widget.getLayoutData();
 assert data.direction != Direction.CENTER :
   "The size of the center widget can not be updated.";
 data.size = size;
 // Update the layout.
 animate(0);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Gets the layout direction of the given child widget.
 *
 * @param child the widget to be queried
 * @return the widget's layout direction, or <code>null</code> if it is not a
 *         child of this panel
 * @throws AssertionError if the widget is not a child and assertions are enabled
 */
public Direction getWidgetDirection(Widget child) {
 assertIsChild(child);
 if (child.getParent() != this) {
  return null;
 }
 return ((LayoutData) child.getLayoutData()).direction;
}

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Sets whether or not the given widget should be hidden.
 * 
 * @param widget the widget to hide or display
 * @param hidden true to hide the widget, false to display it
 */
public void setWidgetHidden(Widget widget, boolean hidden) {
 assertIsChild(widget);
 
 LayoutData data = (LayoutData) widget.getLayoutData();
 if (data.hidden == hidden) {
  return;
 }
 
 data.hidden = hidden;
 animate(0);
}

代码示例来源:origin: com.google.gwt/gwt-servlet

@Override
public boolean remove(Widget w) {
 boolean removed = super.remove(w);
 if (removed) {
  Layer layer = (Layer) w.getLayoutData();
  layout.removeChild(layer);
  w.setLayoutData(null);
  if (visibleWidget == w) {
   visibleWidget = null;
  }
  if (hidingWidget == w) {
   hidingWidget = null;
  }
  if (lastVisibleWidget == w) {
   lastVisibleWidget = null;
  }
 }
 return removed;
}

相关文章