org.eclipse.swt.graphics.Rectangle.contains()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(6.1k)|赞(0)|评价(0)|浏览(98)

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

Rectangle.contains介绍

[英]Returns true if the point specified by the arguments is inside the area specified by the receiver, and false otherwise.
[中]如果参数指定的点位于接收方指定的区域内,则返回true,否则返回false

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

private boolean isInAdd( Point screen ) {
 if ( size_add == null || screen == null ) {
  return false;
 }
 return size_add.contains( screen );
}

代码示例来源:origin: pentaho/pentaho-kettle

private boolean isInRightValue( Point screen ) {
 if ( size_rightval == null ) {
  return false;
 }
 return Real2Screen( size_rightval ).contains( screen );
}

代码示例来源:origin: pentaho/pentaho-kettle

private boolean isInNot( Point screen ) {
 if ( size_not == null ) {
  return false;
 }
 return Real2Screen( size_not ).contains( screen );
}

代码示例来源:origin: pentaho/pentaho-kettle

private boolean isInUp( Point screen ) {
 if ( size_up == null || parents.isEmpty() ) {
  return false; // not displayed!
 }
 return Real2Screen( size_up ).contains( screen );
}

代码示例来源:origin: pentaho/pentaho-kettle

private int getNrSubcondition( Point screen ) {
 if ( size_cond == null ) {
  return -1;
 }
 for ( int i = 0; i < size_cond.length; i++ ) {
  if ( size_cond[i] != null && Screen2Real( size_cond[i] ).contains( screen ) ) {
   return i;
  }
 }
 return -1;
}

代码示例来源:origin: pentaho/pentaho-kettle

private boolean isInFunction( Point screen ) {
 if ( size_fn == null ) {
  return false;
 }
 return Real2Screen( size_fn ).contains( screen );
}

代码示例来源:origin: pentaho/pentaho-kettle

private boolean isInLeft( Point screen ) {
 if ( size_left == null ) {
  return false;
 }
 return Real2Screen( size_left ).contains( screen );
}

代码示例来源:origin: pentaho/pentaho-kettle

private boolean isInWidget( Point screen ) {
 if ( size_widget == null ) {
  return false;
 }
 return Real2Screen( size_widget ).contains( screen );
}

代码示例来源:origin: pentaho/pentaho-kettle

private boolean isInRightExact( Point screen ) {
 if ( size_rightex == null ) {
  return false;
 }
 return Real2Screen( size_rightex ).contains( screen );
}

代码示例来源:origin: pentaho/pentaho-kettle

private int getNrOperator( Point screen ) {
 if ( size_oper == null ) {
  return -1;
 }
 for ( int i = 0; i < size_oper.length; i++ ) {
  if ( size_oper[i] != null && Screen2Real( size_oper[i] ).contains( screen ) ) {
   return i;
  }
 }
 return -1;
}

代码示例来源:origin: pentaho/pentaho-kettle

/**
 * This method is needed in the case where the display has multiple monitors, but they do not form a uniform
 * rectangle. In this case, it is possible for Geometry.moveInside() to not detect that the window is partially or
 * completely clipped. We check to make sure at least the upper left portion of the rectangle is visible to give the
 * user the ability to reposition the dialog in this rare case.
 *
 * @param constrainee
 * @param display
 * @return
 */
private boolean isClippedByUnalignedMonitors( Rectangle constrainee, Display display ) {
 boolean isClipped;
 Monitor[] monitors = display.getMonitors();
 if ( monitors.length > 0 ) {
  // Loop searches for a monitor proving false
  isClipped = true;
  for ( Monitor monitor : monitors ) {
   if ( monitor.getClientArea().contains( constrainee.x + 10, constrainee.y + 10 ) ) {
    isClipped = false;
    break;
   }
  }
 } else {
  isClipped = false;
 }
 return isClipped;
}

代码示例来源:origin: pentaho/pentaho-kettle

protected TreeItem searchMouseOverTreeItem( TreeItem[] treeItems, int x, int y ) {
 for ( TreeItem treeItem : treeItems ) {
  if ( treeItem.getBounds().contains( x, y ) ) {
   return treeItem;
  }
  if ( treeItem.getItemCount() > 0 ) {
   treeItem = searchMouseOverTreeItem( treeItem.getItems(), x, y );
   if ( treeItem != null ) {
    return treeItem;
   }
  }
 }
 return null;
}

代码示例来源:origin: caoxinyu/RedisClient

@Override
public void handleEvent(Event event) {
    Rectangle clientArea = table.getClientArea();
    Point pt = new Point(event.x, event.y);
    int index = table.getTopIndex();
    int count = table.getItemCount();
    while (index < count) {
      boolean visible = false;
      TableItem item = table.getItem(index);
      
      for (int i = 0; i < table.getColumnCount(); i++) {
        Rectangle rect = item.getBounds(i);
        if (rect.contains(pt)) {
          beforeEdit();
          clickRow(item, i);
          return;
        }
        if (!visible && rect.intersects(clientArea)) {
          visible = true;
        }
      }
      if (!visible)
        return;
      index++;
    }
}
protected void beforeEdit() {

代码示例来源:origin: pentaho/pentaho-kettle

for ( int i = 0; i < table.getColumnCount(); i++ ) {
 Rectangle rect = item.getBounds( i );
 if ( rect.contains( pt ) ) {
  activeTableItem = item;
  activeTableColumn = i;

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms

@Override
public void getChildAtPoint(AccessibleControlEvent e) {
  Point pt = toControl(new Point(e.x, e.y));
  e.childID = (getBounds().contains(pt)) ? ACC.CHILDID_SELF
      : ACC.CHILDID_NONE;
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

protected boolean allowMouseEvent( T control, int x, int y ) {
 Point size = control.getSize();
 int borderWidth = control.getBorderWidth();
 Rectangle outerBounds =  new Rectangle( - borderWidth, - borderWidth, size.x, size.y );
 Rectangle innerBounds = new Rectangle( 0, 0, size.x - 2 * borderWidth, size.y - 2 * borderWidth );
 return !outerBounds.contains( x, y ) || innerBounds.contains( x, y );
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.compare

@Override
  public void mouseDoubleClick(MouseEvent e) {
    Control content= getContent();
    if (content != null && content.getBounds().contains(e.x, e.y))
      return;
    Control parent= getParent();
    if (parent instanceof Splitter)
      ((Splitter)parent).setMaximizedControl(CompareViewerPane.this);
  }
};

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public void mouseMove(MouseEvent event) {
  if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(getCurrentInformationControl())) {
    if (!fSubjectArea.contains(event.x, event.y))
      deactivate();
  } else {
    if (!inKeepUpZone(event.x, event.y, fSubjectControl, fSubjectArea, false))
      deactivate();
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface.text

@Override
public void mouseMove(MouseEvent event) {
  if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(getCurrentInformationControl())) {
    if (!fSubjectArea.contains(event.x, event.y))
      deactivate();
  } else {
    if (!inKeepUpZone(event.x, event.y, fSubjectControl, fSubjectArea, false))
      deactivate();
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text

@Override
public void mouseMove(MouseEvent event) {
  if (!hasInformationControlReplacer() || !canMoveIntoInformationControl(getCurrentInformationControl())) {
    if (!fSubjectArea.contains(event.x, event.y)) {
      hideInformationControl();
    }
  } else if (getCurrentInformationControl() != null && !getCurrentInformationControl().isFocusControl()) {
    if (!inKeepUpZone(event.x, event.y, fSubjectControl, fSubjectArea, true)) {
      hideInformationControl();
    }
  }
}

相关文章