本文整理了Java中org.eclipse.swt.graphics.Rectangle.add
方法的一些代码示例,展示了Rectangle.add
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.add
方法的具体详情如下:
包路径:org.eclipse.swt.graphics.Rectangle
类名称:Rectangle
方法名:add
[英]Destructively replaces the x, y, width and height values in the receiver with ones which represent the union of the rectangles specified by the receiver and the given rectangle.
The union of two rectangles is the smallest single rectangle that completely covers both of the areas covered by the two given rectangles.
[中]以破坏性方式将接收器中的x、y、宽度和高度值替换为代表接收器指定的矩形和给定矩形的并集的值。
两个矩形的并集是完全覆盖两个给定矩形覆盖的两个区域的最小单个矩形。
代码示例来源:origin: org.eclipse.e4.ui.workbench.addons/swt
private Rectangle getOverlayBounds() {
Rectangle bounds = null;
for (Rectangle fr : frames) {
if (fr.width > 6) {
Rectangle outerBounds = new Rectangle(fr.x - 3, fr.y - 3, fr.width + 6,
fr.height + 6);
if (bounds == null)
bounds = outerBounds;
bounds.add(outerBounds);
} else {
if (bounds == null)
bounds = fr;
bounds.add(fr);
}
}
for (Rectangle ir : imageRects) {
if (bounds == null)
bounds = ir;
bounds.add(ir);
}
return bounds;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.workbench.addons.swt
private Rectangle getOverlayBounds() {
Rectangle bounds = null;
for (Rectangle fr : frames) {
if (fr.width > 6) {
Rectangle outerBounds = new Rectangle(fr.x - 3, fr.y - 3, fr.width + 6,
fr.height + 6);
if (bounds == null) {
bounds = outerBounds;
}
bounds.add(outerBounds);
} else {
if (bounds == null) {
bounds = fr;
}
bounds.add(fr);
}
}
for (Rectangle ir : imageRects) {
if (bounds == null) {
bounds = ir;
}
bounds.add(ir);
}
return bounds;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
public Rectangle getBounds() {
if (areaRectangles.size() == 0)
return new Rectangle(0, 0, 0, 0);
AreaRectangle ar0 = areaRectangles.get(0);
Rectangle bounds = Geometry.copy(ar0.rect);
for (int i = 1; i < areaRectangles.size(); i++) {
AreaRectangle ar = areaRectangles.get(i);
bounds.add(ar.rect);
}
return bounds;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
public Rectangle getBounds() {
if (areaRectangles.isEmpty())
return new Rectangle(0, 0, 0, 0);
AreaRectangle ar0 = areaRectangles.get(0);
Rectangle bounds = Geometry.copy(ar0.rect);
for (int i = 1; i < areaRectangles.size(); i++) {
AreaRectangle ar = areaRectangles.get(i);
bounds.add(ar.rect);
}
return bounds;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.forms
@Override
public Rectangle getBounds() {
if (segments.isEmpty())
return new Rectangle(Integer.MAX_VALUE, Integer.MAX_VALUE, 0, 0);
IHyperlinkSegment segment0 = (IHyperlinkSegment) segments.get(0);
Rectangle bounds = segment0.getBounds();
for (int i = 1; i < segments.size(); i++) {
IHyperlinkSegment segment = (IHyperlinkSegment) segments.get(i);
Rectangle sbounds = segment.getBounds();
bounds.add(sbounds);
}
return bounds;
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.forms
@Override
public Rectangle getBounds() {
if (segments.size() == 0)
return new Rectangle(Integer.MAX_VALUE, Integer.MAX_VALUE, 0, 0);
IHyperlinkSegment segment0 = (IHyperlinkSegment) segments.get(0);
Rectangle bounds = segment0.getBounds();
for (int i = 1; i < segments.size(); i++) {
IHyperlinkSegment segment = (IHyperlinkSegment) segments.get(i);
Rectangle sbounds = segment.getBounds();
bounds.add(sbounds);
}
return bounds;
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.workbench
/**
* Perform any initialization you want to have happen -before- the
* amination starts
*/
@Override
public boolean jobInit(AnimationEngine engine) {
if (!super.jobInit(engine))
return false;
// Compute the shell's bounds
Rectangle shellBounds = Geometry.copy((Rectangle) getStartRects()
.get(0));
Iterator startIter = getStartRects().iterator();
Iterator endIter = getEndRects().iterator();
while (startIter.hasNext()) {
shellBounds.add((Rectangle) startIter.next());
shellBounds.add((Rectangle) endIter.next());
}
getAnimationShell().setBounds(shellBounds);
// Making the shell visible will be slow on old video cards, so only start
// the timer once it is visible.
getAnimationShell().setVisible(true);
return true; // OK to go...
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui
@Override
public void mouseExit(MouseEvent e) {
if (fComposite == null)
return;
Control[] children= fComposite.getChildren();
Rectangle bounds= null;
for (int i= 0; i < children.length; i++) {
if (bounds == null)
bounds= children[i].getBounds();
else
bounds.add(children[i].getBounds());
if (bounds.contains(e.x, e.y))
return;
}
// if none of the children contains the event, we leave the popup
dispose();
}
代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui
@Override
public void mouseExit(MouseEvent e) {
if (fComposite == null)
return;
Control[] children= fComposite.getChildren();
Rectangle bounds= null;
for (int i= 0; i < children.length; i++) {
if (bounds == null)
bounds= children[i].getBounds();
else
bounds.add(children[i].getBounds());
if (bounds.contains(e.x, e.y))
return;
}
// if none of the children contains the event, we leave the popup
dispose();
}
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
damage.add(oldBounds);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
damage.add(oldBounds);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
damage.add(oldBounds);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
damage.add(oldBounds);
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
bounds = new Rectangle(rect.x, rect.y, rect.width, rect.height);
} else {
bounds.add(rect);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
bounds = new Rectangle(rect.x, rect.y, rect.width, rect.height);
} else {
bounds.add(rect);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
bounds = new Rectangle(rect.x, rect.y, rect.width, rect.height);
} else {
bounds.add(rect);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
bounds = new Rectangle(rect.x, rect.y, rect.width, rect.height);
} else {
bounds.add(rect);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
bounds = new Rectangle(rect.x, rect.y, rect.width, rect.height);
} else {
bounds.add(rect);
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface.text
totalBounds.add(subjectArea);
if (totalBounds.contains(x, y))
return true;
代码示例来源:origin: com.google.code.maven-play-plugin.org.xhtmlrenderer/core-renderer
java.awt.Rectangle rect = paintInfo
.getAggregateBounds();
repaintTarget.add(new Rectangle(rect.x, rect.y,
rect.width, rect.height));
内容来源于网络,如有侵权,请联系作者删除!