本文整理了Java中org.eclipse.swt.graphics.Rectangle.intersection
方法的一些代码示例,展示了Rectangle.intersection
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.intersection
方法的具体详情如下:
包路径:org.eclipse.swt.graphics.Rectangle
类名称:Rectangle
方法名:intersection
[英]Returns a new rectangle which represents the intersection of the receiver and the given rectangle.
The intersection of two rectangles is the rectangle that covers the area which is contained within both rectangles.
[中]返回一个新矩形,该矩形表示接收器和给定矩形的交点。
两个矩形的交点是覆盖两个矩形中包含的区域的矩形。
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
private Point[] getIncludedPositions(Rectangle[] rectangles, Rectangle widgetBounds) {
List result= new ArrayList();
for (int i= 0; i < rectangles.length; i++) {
Rectangle rectangle= rectangles[i];
Rectangle intersect= widgetBounds.intersection(rectangle);
if (intersect != null && intersect.height == rectangle.height) {
result.add(new Point(intersect.x, intersect.y + intersect.height));
}
}
return (Point[]) result.toArray(new Point[result.size()]);
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
private Point[] getIncludedPositions(Rectangle[] rectangles,
Rectangle widgetBounds) {
List result = new ArrayList();
for (Rectangle rectangle : rectangles) {
Rectangle intersect = widgetBounds.intersection(rectangle);
if (intersect != null && intersect.height == rectangle.height) {
result.add(new Point(intersect.x, intersect.y
+ intersect.height));
}
}
return (Point[]) result.toArray(new Point[result.size()]);
}
代码示例来源:origin: org.piccolo2d/piccolo2d-swt
/**
* This method isn't really supported by SWT - so will use the shape bounds.
*
* @param s shape of the clipping region to apply to graphics operations
*/
public void clip(final Shape s) {
final Rectangle2D clipBds = s.getBounds2D();
SWTShapeManager.transform(clipBds, transform);
SWTShapeManager.awtToSWT(clipBds, SWT_RECT);
org.eclipse.swt.graphics.Rectangle clip = gc.getClipping();
clip = clip.intersection(SWT_RECT);
gc.setClipping(SWT_RECT);
}
代码示例来源:origin: org.piccolo2d/piccolo2d-swt
/** {@inheritDoc} */
public void clipRect(final int x, final int y, final int width, final int height) {
TEMP_RECT.setRect(x, y, width, height);
SWTShapeManager.transform(TEMP_RECT, transform);
SWTShapeManager.awtToSWT(TEMP_RECT, SWT_RECT);
org.eclipse.swt.graphics.Rectangle clip = gc.getClipping();
clip = clip.intersection(SWT_RECT);
gc.setClipping(clip);
}
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
case 1:
Rectangle bounds= items[0].getBounds();
Rectangle intersect= clientArea.intersection(bounds);
if (intersect != null && intersect.height == bounds.height) {
return new Point(
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
case 1:
Rectangle bounds = items[0].getBounds();
Rectangle intersect = clientArea.intersection(bounds);
if (intersect != null && intersect.height == bounds.height) {
return new Point(Math.max(0, bounds.x
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
Rectangle bounds = items[0].getBounds(0);
Rectangle iBounds = items[0].getImageBounds(0);
Rectangle intersect = clientArea.intersection(bounds);
if (intersect != null && intersect.height == bounds.height) {
return new Point(Math.max(0, bounds.x + iBounds.width
代码示例来源:origin: org.eclipse/org.eclipse.jdt.ui
Rectangle bounds= items[0].getBounds(0);
Rectangle iBounds= items[0].getImageBounds(0);
Rectangle intersect= clientArea.intersection(bounds);
if (intersect != null && intersect.height == bounds.height) {
return new Point(
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
Rectangle rect = bounds.intersection (monitors [i].getBounds ());
int area = rect.width * rect.height;
if (area > 0 && area > value) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt
Rectangle handleRect = fHorizontalScrollHandler.getHandleRect();
if (!handleRect.equals(fLastHorizontalHandleRect)) {
if (clipping.intersection(handleRect).height != handleRect.height) {
Rectangle handleRect = fVerticalScrollHandler.getHandleRect();
if (!handleRect.equals(fLastVerticalHandleRect)) {
if (clipping.intersection(handleRect).width != handleRect.width) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples
toolBounds.x = pt.x;
toolBounds.y = pt.y;
Rectangle intersection = itemBounds.intersection (toolBounds);
if (!intersection.equals (toolBounds)) break;
i++;
代码示例来源:origin: BiglySoftware/BiglyBT
Rectangle intersection = monitorBounds.intersection(bounds);
if (intersection.width != bounds.width) {
bounds.x = monitorBounds.x + monitorBounds.width - WIDTH;
代码示例来源:origin: BiglySoftware/BiglyBT
Rectangle trimmedShellBounds = shellBounds.intersection(monitorClientArea);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
rect = rect.intersection(new Rectangle(destX, destY, destWidth, destHeight));
if (rect.isEmpty()) return;
代码示例来源:origin: BiglySoftware/BiglyBT
event.detail = selected ? SWT.SELECTED : SWT.NONE;
Rectangle newClip = bounds.intersection(itemBounds);
代码示例来源:origin: BiglySoftware/BiglyBT
area.intersection(cellBounds), true, false, SWT.RIGHT);
内容来源于网络,如有侵权,请联系作者删除!