Java Code Examples for com.google.gwt.dom.client.Element#getAbsoluteBottom()

The following examples show how to use com.google.gwt.dom.client.Element#getAbsoluteBottom() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SelectionCoordinatesHelperW3C.java    From swellrt with Apache License 2.0 5 votes vote down vote up
private IntRange getBounds(Node node, int offset) {
  if (node == null || node.getParentElement() == null) {
    // Return null if cannot get selection, or selection is inside an
    // "unattached" node.
    return null;
  }

  if (DomHelper.isTextNode(node)) {
    Element parentElement = node.getParentElement();
    return new IntRange(parentElement.getAbsoluteTop(), parentElement.getAbsoluteBottom());
  } else {
    Element e = node.<Element>cast();
    return new IntRange(e.getAbsoluteTop(), e.getAbsoluteBottom());
  }
}
 
Example 2
Source File: SelectionCoordinatesHelperW3C.java    From incubator-retired-wave with Apache License 2.0 5 votes vote down vote up
private IntRange getBounds(Node node, int offset) {
  if (node == null || node.getParentElement() == null) {
    // Return null if cannot get selection, or selection is inside an
    // "unattached" node.
    return null;
  }

  if (DomHelper.isTextNode(node)) {
    Element parentElement = node.getParentElement();
    return new IntRange(parentElement.getAbsoluteTop(), parentElement.getAbsoluteBottom());
  } else {
    Element e = node.<Element>cast();
    return new IntRange(e.getAbsoluteTop(), e.getAbsoluteBottom());
  }
}
 
Example 3
Source File: MeasurerInstance.java    From swellrt with Apache License 2.0 4 votes vote down vote up
@Override
public double bottom(Element base, Element e) {
  return e.getAbsoluteBottom() - (base != null ? base.getAbsoluteTop() : 0);
}
 
Example 4
Source File: MeasurerInstance.java    From incubator-retired-wave with Apache License 2.0 4 votes vote down vote up
@Override
public double bottom(Element base, Element e) {
  return e.getAbsoluteBottom() - (base != null ? base.getAbsoluteTop() : 0);
}